コード例 #1
0
  @Override
  public PortalDeployDefinition[] getPortalModules() {
    List<PortalDeployDefinition> moduleList = new ArrayList<PortalDeployDefinition>();
    String dir = RuntimeEnv.getInstance().getNCHome() + PortalEnv.PORTAL_HOME_DIR;
    File f = new File(dir);
    File[] fs = f.listFiles();
    for (int i = 0; i < fs.length; i++) {
      File mDir = fs[i];
      if (mDir.isDirectory()) {
        File specDir = new File(mDir.getAbsolutePath() + "/portalspec");
        if (specDir.exists() && specDir.isDirectory()) {
          File specFile = new File(specDir.getAbsolutePath() + "/portal.xml");
          if (specFile.exists() && specFile.isFile()) {
            PortalDeployDefinition definition = parseModule(mDir.getAbsolutePath());
            if (definition != null) moduleList.add(definition);
          }
        }
      }
    }

    try {
      return PortalModuleUtil.sortDefinition(moduleList);
    } catch (PortalServiceException e) {
      LfwLogger.info("Error:" + e.getMessage());
      return new PortalDeployDefinition[0];
    }
  }
コード例 #2
0
 @Override
 public PortalModule getPortal(String projectPath, String projectModuleName) {
   try {
     PortalModule pm =
         PortalModuleUtil.parsePortalModule(
             new File(getPortalSpecPath(projectPath, projectModuleName) + "/portal.xml"));
     return pm;
   } catch (PortalServiceException e) {
     LfwLogger.error(e.getMessage(), e);
   }
   return null;
 }
コード例 #3
0
 private PortalModule parsePortalModule(String modulePath) throws PortalServiceException {
   PortalModule pm =
       PortalModuleUtil.parsePortalModule(new File(modulePath + "/portalspec/portal.xml"));
   return pm;
 }