private static String getMDMDemoPluginId() { if (!PluginChecker.isPluginLoaded("org.talend.mdm.workbench.enterprise")) { // CE //$NON-NLS-1$ return "org.talend.mdm.repository"; //$NON-NLS-1$ } else { // EE return "org.talend.mdm.repository.enterprise"; //$NON-NLS-1$ } }
public static Object createTreeData() { List<AnalysisTypeNode> returnList = new ArrayList<AnalysisTypeNode>(); // use CategoryHandler AnalysisCategories analysisCategories = CategoryHandler.getAnalysisCategories(); // use this tree (use label attribute of each Category instance) EList<AnalysisCategory> categories = analysisCategories.getCategories(); for (AnalysisCategory category : categories) { AnalysisTypeNode typeNode = new AnalysisTypeNode(category.getLabel(), category.getAnalysisType().getLiteral(), null); if (category.getSubCategories() != null) { List<AnalysisTypeNode> subCategories = new ArrayList<AnalysisTypeNode>(); for (AnalysisCategory subCategory : category.getSubCategories()) { // the Semantic analysis must not appear in TOS DQ. String label = subCategory.getLabel(); if (org.talend.commons.utils.platform.PluginChecker.isOnlyTopLoaded()) { if (label.equals("Semantic Discovery Analysis")) { // $NON-NLS-1$ continue; } } subCategories.add(new AnalysisTypeNode(label, label, typeNode)); } typeNode.setChildren(subCategories.toArray()); } returnList.add(typeNode); } return returnList; }
/** * Gets all demo projects information. * * @return a list of <code>DemoProjectBean</code> */ public static List<DemoProjectBean> getAllDemoProjects() { SAXReader reader = new SAXReader(); Document doc = null; List<DemoProjectBean> demoProjectList = new ArrayList<DemoProjectBean>(); DemoProjectBean demoProject = null; List<File> xmlFilePath = getXMLFilePath(); for (int t = 0; t < xmlFilePath.size(); t++) { try { doc = reader.read(xmlFilePath.get(t)); } catch (DocumentException e) { ExceptionHandler.process(e); return null; } Element demoProjectsInfo = doc.getRootElement(); IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class); String[] availableLanguages = brandingService.getBrandingConfiguration().getAvailableLanguages(); for (Iterator<DemoProjectBean> i = demoProjectsInfo.elementIterator("project"); i.hasNext(); ) { // $NON-NLS-1$ Element demoProjectElement = (Element) i.next(); demoProject = new DemoProjectBean(); demoProject.setProjectName(demoProjectElement.attributeValue("name")); // $NON-NLS-1$ String language = demoProjectElement.attributeValue("language"); // $NON-NLS-1$ if (!ArrayUtils.contains(availableLanguages, language)) { // if the language is not available in current branding, don't display this demo project continue; } demoProject.setLanguage(ECodeLanguage.getCodeLanguage(language)); String demoProjectFileType = demoProjectElement.attributeValue("demoProjectFileType"); // $NON-NLS-1$ demoProject.setDemoProjectFileType( EDemoProjectFileType.getDemoProjectFileTypeName(demoProjectFileType)); demoProject.setDemoProjectFilePath( demoProjectElement.attributeValue("demoFilePath")); // $NON-NLS-1$ demoProject.setDescriptionFilePath( demoProjectElement.attributeValue("descriptionFilePath")); // $NON-NLS-1$ // get the demo plugin Id demoProject.setPluginId(demoProjectElement.attributeValue("pluginId")); // $NON-NLS-1$ if (demoProject.getProjectName().equals("ESBDEMOS")) { if (!PluginChecker.isPluginLoaded("org.talend.repository.services")) { continue; } } demoProjectList.add(demoProject); } } return demoProjectList; }