use of com.centurylink.mdw.plugin.designer.properties.PageletTab in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method getImportAttributeActions.
private List<IAction> getImportAttributeActions(IStructuredSelection selection) {
List<IAction> importAttributesActions = new ArrayList<>();
if (selection != null && selection.getFirstElement() instanceof WorkflowElement) {
// bam
IAction action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(WorkAttributeConstant.BAM_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.monitoring");
action.setText("Monitoring...");
importAttributesActions.add(action);
// simulation
action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(WorkAttributeConstant.SIMULATION_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.simulation");
action.setText("Simulation...");
importAttributesActions.add(action);
// pagelet-driven attributes
WorkflowProject project = ((WorkflowElement) selection.getFirstElement()).getProject();
List<PageletTab> pageletTabs = project.getPageletTabs();
if (pageletTabs != null) {
for (PageletTab pageletTab : pageletTabs) {
final String prefix = pageletTab.getOverrideAttributePrefix();
action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(prefix, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.attributes." + prefix);
action.setText(pageletTab.getLabel() + "...");
importAttributesActions.add(action);
}
}
}
return importAttributesActions;
}
use of com.centurylink.mdw.plugin.designer.properties.PageletTab in project mdw-designer by CenturyLinkCloud.
the class WorkflowProject method findWorkflowAssets.
/**
* Returns the workflow assets belonging to a package version.
*/
private List<WorkflowAsset> findWorkflowAssets(WorkflowPackage aPackage) {
List<WorkflowAsset> assets = new ArrayList<>();
if (!aPackage.isDefaultPackage()) {
for (RuleSetVO ruleSetVO : getDataAccess().getRuleSets(false)) {
if (aPackage.getPackageVO().containsRuleSet(ruleSetVO.getId())) {
WorkflowAsset asset = WorkflowAssetFactory.createAsset(ruleSetVO, aPackage);
if (asset != null) {
asset.addElementChangeListener(this);
if (!asset.isArchived())
WorkflowAssetFactory.registerAsset(asset);
assets.add(asset);
if (RuleSetVO.PAGELET.equals(asset.getLanguage()) && // BAM's
!BAM_PAGELET.equals(asset.getName())) // special
{
if (pageletTabs == null)
pageletTabs = new ArrayList<>();
String name = asset.getName();
if (name.indexOf('.') >= 0)
name = name.substring(0, name.lastIndexOf('.'));
PageletTab pageletTab = new PageletTab(name, designerProxy.loadWorkflowAsset(asset).getContent());
// check if already added from a later package
// version
boolean already = false;
for (PageletTab existing : pageletTabs) {
if (existing.getId().equals(pageletTab.getId())) {
already = true;
break;
}
}
if (!already)
pageletTabs.add(pageletTab);
}
}
}
}
Collections.sort(assets);
}
return assets;
}
use of com.centurylink.mdw.plugin.designer.properties.PageletTab in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method getExportAttributeActions.
private List<IAction> getExportAttributeActions(IStructuredSelection selection) {
List<IAction> exportAttributesActions = new ArrayList<>();
if (selection != null && selection.getFirstElement() instanceof WorkflowElement) {
// bam
IAction action = new Action() {
@Override
public void run() {
if (!exportAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.exportAttributes(WorkAttributeConstant.BAM_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "export.monitoring");
action.setText("Monitoring...");
exportAttributesActions.add(action);
// simulation
action = new Action() {
@Override
public void run() {
if (!exportAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.exportAttributes(WorkAttributeConstant.SIMULATION_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "export.simulation");
action.setText("Simulation...");
exportAttributesActions.add(action);
// pagelet-driven attributes
WorkflowProject project = ((WorkflowElement) selection.getFirstElement()).getProject();
List<PageletTab> pageletTabs = project.getPageletTabs();
if (pageletTabs != null) {
for (PageletTab pageletTab : pageletTabs) {
final String prefix = pageletTab.getOverrideAttributePrefix();
action = new Action() {
@Override
public void run() {
if (!exportAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.exportAttributes(prefix, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "export.attributes." + prefix);
action.setText(pageletTab.getLabel() + "...");
exportAttributesActions.add(action);
}
}
}
return exportAttributesActions;
}
Aggregations