use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerDefService method getAllServerDefs.
public static List<MDMServerDef> getAllServerDefs(boolean includeDisabledServer) {
List<IRepositoryViewObject> viewObjects = getAllServerDefViewObjects(includeDisabledServer);
if (viewObjects != null) {
List<MDMServerDef> serverDefs = new ArrayList<MDMServerDef>(viewObjects.size());
for (IRepositoryViewObject viewObj : viewObjects) {
Item item = viewObj.getProperty().getItem();
MDMServerDef serverDef = ((MDMServerDefItem) item).getServerDef();
if (serverDef != null && (includeDisabledServer || serverDef.isEnabled())) {
serverDefs.add(serverDef.getDecryptedServerDef());
}
}
return serverDefs;
}
return null;
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ShowServerConsoleAction method run.
@Override
public void run() {
IRepositoryViewObject viewObject = getSelectedViewObject();
if (viewObject != null) {
MDMServerDefItem serverDefItem = getMDMItem(viewObject);
MDMServerDef selectedServerDef = serverDefItem.getServerDef();
if (selectedServerDef != null) {
showMDMServerConsole(selectedServerDef);
}
}
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class SelectServerDefDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
setTitle(Messages.SelectServerDefDialog_selectServerLocation);
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
container.setLayoutData(new GridData(GridData.FILL_BOTH));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setSorter(new ServerSorter());
treeViewer.setContentProvider(new TreeContentProvider());
treeViewer.setLabelProvider(new ViewerLabelProvider());
//
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IRepositoryViewObject viewObject = getCurSelectedViewObject();
if (viewObject == null)
return;
MDMServerDefItem item = (MDMServerDefItem) viewObject.getProperty().getItem();
serverDef = item.getServerDef();
okBun.setEnabled(serverDef != null);
}
});
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
//
initServerDefList();
return area;
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerExplorer method editServerDef.
private void editServerDef() {
IRepositoryViewObject viewObject = getCurSelectedViewObject();
if (viewObject != null) {
MDMServerDefItem mdmItem = getMDMItem(viewObject);
if (mdmItem != null) {
MDMServerDef serverDef = mdmItem.getServerDef();
ServerDefDialog dialog = new ServerDefDialog(getViewSite().getShell(), serverDef);
if (dialog.open() == IDialogConstants.OK_ID) {
String tempPasswd = serverDef.getTempPasswd();
ServerDefService.updateTempPassword(viewObject.getId(), tempPasswd);
boolean result = ServerDefService.saveServeDef(mdmItem);
if (result) {
refreshServerDefs();
}
}
}
}
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerExplorer method editServerDef.
private void editServerDef(IRepositoryViewObject viewObject) {
if (viewObject != null) {
MDMServerDefItem mdmItem = getMDMItem(viewObject);
if (mdmItem != null) {
MDMServerDef serverDef = mdmItem.getServerDef();
ServerDefDialog dialog = new ServerDefDialog(getViewSite().getShell(), serverDef);
if (dialog.open() == IDialogConstants.OK_ID) {
String tempPasswd = serverDef.getTempPasswd();
ServerDefService.updateTempPassword(viewObject.getId(), tempPasswd);
boolean result = ServerDefService.saveServeDef(mdmItem);
if (result) {
refreshServerDefs();
}
}
}
}
}
Aggregations