use of org.talend.mdm.repository.model.mdmproperties.ContainerItem in project tmdm-studio-se by Talend.
the class NewProcessAction method getType.
private int getType() {
int type = 0;
IRepositoryViewObject repositoryViewObject = (IRepositoryViewObject) selectObj;
ContainerItem containerItem = (ContainerItem) repositoryViewObject.getProperty().getItem();
String path = containerItem.getState().getPath();
if (path.isEmpty()) {
type = TYPE_PROCESS;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_BEFORESAVE)) {
type = TYPE_BEFORESAVE;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_BEFOREDEL)) {
type = TYPE_BEFOREDEL;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_ENTITYACTION)) {
type = TYPE_ENTITYACTION;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_WELCOMEACTION)) {
type = TYPE_WELCOMEACTION;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_SMARTVIEW)) {
type = TYPE_SMARTVIEW;
} else if (path.startsWith(IPath.SEPARATOR + ITransformerV2NodeConsDef.PATH_OTHER)) {
type = TYPE_OTHER;
}
return type;
}
use of org.talend.mdm.repository.model.mdmproperties.ContainerItem in project tmdm-studio-se by Talend.
the class NewProcessAction method doRun.
@Override
protected void doRun() {
parentItem = null;
selectObj = getSelectedObject().get(0);
int type = getType();
if (selectObj instanceof IRepositoryViewObject) {
Item pItem = ((IRepositoryViewObject) selectObj).getProperty().getItem();
if (pItem instanceof ContainerItem) {
parentItem = (ContainerItem) pItem;
}
}
IWorkbenchPartSite site = commonViewer.getCommonNavigator().getSite();
// wizard
NewProcessWizard newProcessWizard = new NewProcessWizard(site, type);
WizardDialog wizardDialog = new WizardDialog(getShell(), newProcessWizard);
wizardDialog.setPageSize(500, 260);
if (wizardDialog.open() == IDialogConstants.OK_ID) {
WSTransformerV2E newProcess = newProcessWizard.getNewProcess();
final Item item = createServerObject(newProcess);
commonViewer.refresh(selectObj);
commonViewer.expandToLevel(selectObj, 1);
openEditor(item);
if (newProcessWizard.isCreateJob()) {
generateJobTemplate(newProcessWizard.getType(), newProcessWizard.getProcessName(), newProcessWizard.getReturnMessages(), newProcessWizard.isEnableRedirect(), newProcessWizard.getRedirectUrl(), newProcessWizard.getJobTemplates());
refreshJobEditorTitle(item);
}
}
}
use of org.talend.mdm.repository.model.mdmproperties.ContainerItem in project tmdm-studio-se by Talend.
the class RepositoryViewFilterDialog method updateForEventManager.
private void updateForEventManager(Set<String> values) {
ERepositoryObjectType[] types = new ERepositoryObjectType[] { IServerObjectRepositoryType.TYPE_TRANSFORMERV2, IServerObjectRepositoryType.TYPE_ROUTINGRULE };
for (ERepositoryObjectType type : types) {
IRepositoryNodeConfiguration conf = RepositoryNodeConfigurationManager.getConfiguration(type);
IRepositoryViewObject viewObject = RepositoryResourceUtil.getCategoryViewObject(conf);
if (viewObject != null) {
ContainerItem item = (ContainerItem) viewObject.getProperty().getItem();
values.add(item.getLabel());
}
}
}
use of org.talend.mdm.repository.model.mdmproperties.ContainerItem in project tmdm-studio-se by Talend.
the class NewDataModelAction method createDataContainerObject.
protected void createDataContainerObject(final String key) {
if (!RepositoryResourceUtil.isExistByName(IServerObjectRepositoryType.TYPE_DATACLUSTER, key)) {
NewDataContainerAction newDataContainerAction = new NewDataContainerAction() {
@Override
protected String getInputName() {
return key;
}
@Override
protected void updateParentItem() {
IRepositoryViewObject folderViewObj = ContainerCacheService.get(IServerObjectRepositoryType.TYPE_DATACLUSTER, // $NON-NLS-1$
"");
if (folderViewObj != null) {
Item pItem = folderViewObj.getProperty().getItem();
setParentItem((ContainerItem) pItem);
}
}
};
newDataContainerAction.run();
}
}
use of org.talend.mdm.repository.model.mdmproperties.ContainerItem in project tmdm-studio-se by Talend.
the class NewDataModelAction method run.
public void run(IIntroSite site, Properties params) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
if (factory.isUserReadOnlyOnCurrentProject()) {
MessageDialog.openWarning(null, Messages.NewDataModelAction_UserAuthority, Messages.NewDataModelAction_CanNotCreateModel);
} else {
PlatformUI.getWorkbench().getIntroManager().closeIntro(PlatformUI.getWorkbench().getIntroManager().getIntro());
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == workbenchWindow) {
return;
}
IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
if (null == workbenchPage) {
return;
}
IPerspectiveDescriptor currentPerspective = workbenchPage.getPerspective();
if (!IBrandingConfiguration.PERSPECTIVE_MDM_ID.equals(currentPerspective.getId())) {
// show mdm perspective
try {
workbenchWindow.getWorkbench().showPerspective(IBrandingConfiguration.PERSPECTIVE_MDM_ID, workbenchWindow);
workbenchPage = workbenchWindow.getActivePage();
} catch (WorkbenchException e) {
ExceptionHandler.process(e);
return;
}
}
//
// $NON-NLS-1$
IRepositoryViewObject folderViewObj = ContainerCacheService.get(IServerObjectRepositoryType.TYPE_DATAMODEL, "");
selectObj = folderViewObj;
if (folderViewObj != null && folderViewObj instanceof FolderRepositoryObject) {
Item pItem = folderViewObj.getProperty().getItem();
if (pItem instanceof ContainerItem) {
setParentItem((ContainerItem) pItem);
}
}
run();
}
}
Aggregations