Example #1
0
 /**
  * Instantiates a new site search service impl.
  *
  * @param portalManagerService the portal manager service
  * @param templateService the template service
  * @param configurationService the configuration service
  * @param repositoryService the repository service
  * @param initParams the init params
  * @throws Exception the exception
  */
 public SiteSearchServiceImpl(
     LivePortalManagerService portalManagerService,
     TemplateService templateService,
     WCMConfigurationService configurationService,
     RepositoryService repositoryService,
     InitParams initParams)
     throws Exception {
   this.livePortalManagerService = portalManagerService;
   this.templateService = templateService;
   this.repositoryService = repositoryService;
   this.configurationService = configurationService;
   if (initParams != null) {
     ValueParam isEnabledFuzzySearchValue = initParams.getValueParam(IS_ENABLED_FUZZY_SEARCH);
     if (isEnabledFuzzySearchValue != null)
       isEnabledFuzzySearch = Boolean.parseBoolean(isEnabledFuzzySearchValue.getValue());
     ValueParam enabledFuzzySearchValue = initParams.getValueParam(FUZZY_SEARCH_INDEX);
     if (enabledFuzzySearchValue != null) {
       try {
         fuzzySearchIndex = Double.parseDouble(enabledFuzzySearchValue.getValue());
       } catch (NumberFormatException e) {
         //          log.warn("The current fuzzySearchIndex value is not a number, default value
         // 0.8 will be used");
         fuzzySearchIndex = 0.8;
       }
     }
     if (fuzzySearchIndex < 0 || fuzzySearchIndex >= 1) {
       //        log.warn("The current fuzzySearchIndex value is out of range from 0 to 1, default
       // value 0.8 will be used");
       fuzzySearchIndex = 0.8;
     }
   }
 }
Example #2
0
  public UserACL(InitParams params) {
    UserACLMetaData md = new UserACLMetaData(params);

    ValuesParam mandatoryGroupsParam = params.getValuesParam("mandatory.groups");
    if (mandatoryGroupsParam != null) {
      mandatoryGroups_ = mandatoryGroupsParam.getValues();
    } else {
      mandatoryGroups_ = new ArrayList<String>();
    }

    ValuesParam mandatoryMSTypesParam = params.getValuesParam("mandatory.mstypes");
    if (mandatoryMSTypesParam != null) mandatoryMSTypes_ = mandatoryMSTypesParam.getValues();
    else mandatoryMSTypes_ = new ArrayList<String>();

    // tam.nguyen get admin group value
    ValueParam adminGroupsParam = params.getValueParam("portal.administrator.groups");
    if (adminGroupsParam != null) {
      setAdminGroups(adminGroupsParam.getValue());
    }

    // tam.nguyen get administrator member type
    ValueParam adminMSTypeParam = params.getValueParam("portal.administrator.mstype");
    if (adminMSTypeParam != null) {
      setAdminMSType(adminMSTypeParam.getValue());
    }

    init(md);
  }
 private String getParam(InitParams initParams, String param, String df) {
   ValueParam p = initParams.getValueParam(param);
   if (p != null) {
     return p.getValue();
   } else {
     return df;
   }
 }
 private boolean getParam(InitParams initParams, String param) {
   ValueParam p = initParams.getValueParam(param);
   if (p != null) {
     return Boolean.parseBoolean(p.getValue());
   } else {
     return false;
   }
 }
  private String getParam(InitParams params, String paramName) {
    ValueParam param = params.getValueParam(paramName);
    if (param == null) {
      throw new IllegalArgumentException("Parameter '" + paramName + "' needs to be provided");
    }

    return param.getValue();
  }
  public MimeTypeUploadPlugin(InitParams initParams, ConfigurationManager configurationService)
      throws Exception {
    ValueParam param = initParams.getValueParam(MIMETYPE_PATH);
    URL filePath = configurationService.getURL(param.getValue());
    URLConnection connection = filePath.openConnection();
    mimeTypes.load(connection.getInputStream());

    param = initParams.getValueParam(DEFAULT_MIMETYPE);
    if (param != null) mimetypeDefault = param.getValue();
  }
 public ManageViewPlugin(
     RepositoryService repositoryService,
     InitParams params,
     ConfigurationManager cservice,
     NodeHierarchyCreator nodeHierarchyCreator,
     DMSConfiguration dmsConfiguration)
     throws Exception {
   params_ = params;
   repositoryService_ = repositoryService;
   nodeHierarchyCreator_ = nodeHierarchyCreator;
   cservice_ = cservice;
   ValueParam autoInitParam = params.getValueParam("autoCreateInNewRepository");
   if (autoInitParam != null) {
     autoCreateInNewRepository_ = Boolean.parseBoolean(autoInitParam.getValue());
   }
   ValueParam predefinedViewLocation = params.getValueParam("predefinedViewsLocation");
   if (predefinedViewLocation != null) {
     predefinedViewsLocation_ = predefinedViewLocation.getValue();
   }
   dmsConfiguration_ = dmsConfiguration;
   templateService = WCMCoreUtils.getService(TemplateService.class);
 }
Example #8
0
  /**
   * Instantiates a new WCM composer impl.
   *
   * @throws Exception the exception
   */
  public WCMComposerImpl(InitParams params) throws Exception {
    if (params != null) {
      ValueParam sharedGroupParam = params.getValueParam("sharedGroup");
      if (sharedGroupParam != null) {
        this.sharedGroup = sharedGroupParam.getValue();
      }
    }

    repositoryService = WCMCoreUtils.getService(RepositoryService.class);
    linkManager = WCMCoreUtils.getService(LinkManager.class);
    publicationService = WCMCoreUtils.getService(PublicationService.class);
    templateService = WCMCoreUtils.getService(TemplateService.class);
    wcmService = WCMCoreUtils.getService(WCMService.class);
    multiLanguageService = WCMCoreUtils.getService(MultiLanguageService.class);
    aclSessionProviderService = WCMCoreUtils.getService(ACLSessionProviderService.class);

    usedLanguages = new ArrayList<String>();
    usedLanguages.add(null);
    usedOrderBy = new ArrayList<String>();
    usedOrderBy.add(null);
    usedPrimaryTypes = new ArrayList<String>();
    usedPrimaryTypes.add(null);
  }