use of org.talend.mdm.repository.core.AbstractRepositoryAction in project tmdm-studio-se by Talend.
the class RepositoryNodeActionProviderAdapter method getActions.
@Override
public List<AbstractRepositoryAction> getActions(IRepositoryViewObject viewObj) {
List<AbstractRepositoryAction> actions = new LinkedList<AbstractRepositoryAction>();
//
Item item = viewObj.getProperty().getItem();
if (item instanceof MDMItem) {
if (item instanceof ContainerItem) {
FolderType type = ((FolderItem) item).getType();
switch(type.getValue()) {
case FolderType.SYSTEM_FOLDER:
addAction(actions, createFolderAction, viewObj);
addAction(actions, pasteAction, viewObj);
actions.add(importServerObjectAction);
actions.add(importObjectAction);
break;
case FolderType.STABLE_SYSTEM_FOLDER:
break;
case FolderType.FOLDER:
addAction(actions, createFolderAction, viewObj);
if (!((ContainerItem) item).getRepObjType().equals(ERepositoryObjectType.PROCESS)) {
actions.add(removeFromRepositoryAction);
}
addAction(actions, pasteAction, viewObj);
break;
}
} else if (item instanceof MDMServerObjectItem) {
addAction(actions, removeFromRepositoryAction, viewObj);
addAction(actions, mdmEditPropertyAction, viewObj);
addAction(actions, openVersionAction, viewObj);
addAction(actions, copyAction, viewObj);
addAction(actions, pasteAction, viewObj);
addAction(actions, duplicateAction, viewObj);
if (exAdapter != null) {
exAdapter.addActions(actions, viewObj);
}
} else if (item instanceof WorkspaceRootItem) {
// fix bug TMDM-3168
actions.add(importObjectAction);
}
}
if (enableDebug) {
// for debug digestValue
addAction(actions, debugDigestValueAction, viewObj);
}
//
actions.add(refreshAction);
actions.add(exportObjectAction);
// action provider
for (IRepositoryNodeActionProvider provider : getExtendActionProviders()) {
List<AbstractRepositoryAction> providerActions = provider.getActions(viewObj);
if (providerActions != null) {
actions.addAll(providerActions);
}
}
if (viewObj.getRepositoryObjectType() != null && IServerObjectRepositoryType.TYPE_EVENTMANAGER.equals(viewObj.getRepositoryObjectType())) {
actions.add(emAction);
}
//
return actions;
}
use of org.talend.mdm.repository.core.AbstractRepositoryAction in project tmdm-studio-se by Talend.
the class TISProcessActionProvider method getActions.
@Override
public List<AbstractRepositoryAction> getActions(IRepositoryViewObject viewObj) {
List<AbstractRepositoryAction> actions = super.getActions(viewObj);
Item item = viewObj.getProperty().getItem();
if (item instanceof ContainerItem) {
FolderType type = ((FolderItem) item).getType();
switch(type.getValue()) {
case FolderType.SYSTEM_FOLDER:
addAction(actions, createProcessAction, viewObj);
break;
case FolderType.STABLE_SYSTEM_FOLDER:
break;
case FolderType.FOLDER:
addAction(actions, createProcessAction, viewObj);
addAction(actions, renameFolderAction, viewObj);
addAction(actions, deleteAction, viewObj);
break;
}
} else if (item instanceof ProcessItem) {
addAction(actions, editProcessAction, viewObj);
addAction(actions, readProcessAction, viewObj);
addAction(actions, runProcessAction, viewObj);
addAction(actions, openExistVersionProcessAction, viewObj);
addAction(actions, editPropAction, viewObj);
addAction(actions, deleteAction, viewObj);
addAction(actions, generateTransformerAction, viewObj);
addAction(actions, generateTriggerAction, viewObj);
// deploy
actions.add(deployToAction);
addAction(actions, deployToLastServerAction, viewObj);
addAction(actions, deployAnotherToAction, viewObj);
addAction(actions, undeployAction, viewObj);
}
actions.add(deployAllAction);
return actions;
}
use of org.talend.mdm.repository.core.AbstractRepositoryAction in project tmdm-studio-se by Talend.
the class DataModelActionProvider method getActions.
@Override
public List<AbstractRepositoryAction> getActions(IRepositoryViewObject viewObj) {
List<AbstractRepositoryAction> actions = super.getActions(viewObj);
if (RepositoryResourceUtil.hasContainerItem(viewObj, FolderType.SYSTEM_FOLDER_LITERAL, FolderType.FOLDER_LITERAL)) {
addAction(actions, addAction, viewObj);
}
if (viewObj.getProperty().getItem() instanceof MDMServerObjectItem) {
addAction(actions, renameAction, viewObj);
// validate
if (validateAction != null) {
addAction(actions, validateAction, viewObj);
}
// deploy
addAction(actions, deployToAction, viewObj);
addAction(actions, deployToLastServerAction, viewObj);
addAction(actions, deployAnotherToAction, viewObj);
addAction(actions, undeployAction, viewObj);
IDataModelActionProviderExAdapter exAdapter = getExAdapter();
if (exAdapter != null && exAdapter.getActions() != null) {
for (AbstractRepositoryAction action : exAdapter.getActions()) {
addAction(actions, action, viewObj);
}
}
}
addAction(actions, deployAllAction, viewObj);
return actions;
}
use of org.talend.mdm.repository.core.AbstractRepositoryAction in project tmdm-studio-se by Talend.
the class TreeViewerListener method fillLocalToolBar.
private void fillLocalToolBar(IToolBarManager manager) {
RefreshAction refreshViewAction = new RefreshAction(true);
refreshViewAction.initCommonViewer(((CommonNavigator) this).getCommonViewer());
manager.add(new Separator());
manager.add(refreshViewAction);
manager.add(new Separator());
deployAll = new DeployAllAction(true);
deployAll.initCommonViewer(((CommonNavigator) this).getCommonViewer());
manager.add(deployAll);
manager.add(new Separator());
AbstractRepositoryAction importObject = ImportObjectAction.createImportAction();
importObject.initCommonViewer(((CommonNavigator) this).getCommonViewer());
manager.add(importObject);
// manager.add(new Separator());
ExportObjectAction exportObject = new ExportObjectAction();
exportObject.initCommonViewer(((CommonNavigator) this).getCommonViewer());
manager.add(exportObject);
// manager.add(new Separator());
ImportServerObjectAction importServerObject = new ImportServerObjectAction();
importServerObject.initCommonViewer(((CommonNavigator) this).getCommonViewer());
manager.add(importServerObject);
manager.add(new Separator());
}
use of org.talend.mdm.repository.core.AbstractRepositoryAction in project tmdm-studio-se by Talend.
the class MDMRepositoryActionProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
return;
}
IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
List<AbstractRepositoryAction> finalActions = null;
for (Iterator il = selection.iterator(); il.hasNext(); ) {
Object obj = il.next();
if (obj instanceof IRepositoryViewObject) {
IRepositoryViewObject viewObj = (IRepositoryViewObject) obj;
IRepositoryNodeConfiguration conf = RepositoryNodeConfigurationManager.getConfiguration(viewObj);
IRepositoryNodeActionProvider actionProvider = conf.getActionProvider();
if (conf != null && actionProvider != null) {
actionProvider.updateSelection(selection);
List<AbstractRepositoryAction> actions = actionProvider.getActions(viewObj);
if (actions != null) {
if (finalActions == null) {
finalActions = actions;
}
finalActions = combineActions(finalActions, actions);
if (finalActions.size() == 0) {
return;
}
}
}
}
}
// hook action to menu
for (IAction action : finalActions) {
if (action instanceof AbstractRepositoryAction) {
AbstractRepositoryAction groupAction = (AbstractRepositoryAction) action;
groupAction.selectionChanged(selection);
if (groupAction.getGroupName() != null) {
menu.appendToGroup(groupAction.getGroupName(), action);
} else {
menu.add(action);
}
}
}
}
Aggregations