Exemplo n.º 1
0
 private String tranCH2En(String[] urls, IARESProject project) throws Exception {
   StringBuffer sb = new StringBuffer();
   IARESModuleRoot root = project.getModuleRoot(getModuleRootByCHName(urls[0], project));
   if (root != null) {
     for (int i = 1; i < urls.length; i++) {
       for (IARESModule module : root.getModules()) {
         IARESResource property = module.getARESResource(IARESModule.MODULE_PROPERTY_FILE);
         if (property != null && property.exists()) {
           try {
             ModuleProperty info = property.getInfo(ModuleProperty.class);
             if (info != null) {
               Object obj = info.getValue(ICommonModel.CNAME);
               if (obj != null) {
                 if (StringUtils.equals(urls[i], obj.toString())) {
                   sb.append("/");
                   sb.append(module.getShortName());
                   break;
                 }
               }
             }
           } catch (Exception e) {
             e.printStackTrace();
           }
         }
       }
     }
     for (String enname : urls) {
       root.getModule(enname);
     }
   }
   return sb.toString();
 }
Exemplo n.º 2
0
  /* (non-Javadoc)
   * @see com.hundsun.ares.devtool.common.core.ICommonModule#getSubModules()
   */
  public IARESModule[] getSubModules() throws ARESModelException {
    // default module
    if (isDefaultModule()) {
      return new IARESModule[0];
    }

    IARESModuleRoot root = getRoot();
    IARESModule[] all = root.getModules();
    List<IARESModule> modules = new ArrayList<IARESModule>();
    for (IARESModule module : all) {
      if (module.getElementName().startsWith(getElementName() + ".")) modules.add(module);
    }
    return modules.toArray(new IARESModule[0]);
  }