public RepositoryServiceConfigurationPlugin(InitParams params) { ValueParam param = params == null ? null : params.getValueParam("conf-path"); if (param == null || param.getValue() == null || param.getValue().trim().length() == 0) { throw new IllegalArgumentException("The value-param 'conf-path' is mandatory, please check your configuration"); } else { this.confPath = param.getValue().trim(); } }
public RequestHandlerImpl(RequestDispatcher dispatcher, DependencySupplier dependencySupplier, InitParams params) { this.dispatcher = dispatcher; this.dependencySupplier = dependencySupplier; if (params != null) { for (Iterator<ValueParam> i = params.getValueParamIterator(); i.hasNext();) { ValueParam vp = i.next(); properties.put(vp.getName(), vp.getValue()); } } }
private void initFileParameter(InitParams initialParameters) { ValueParam filePathValueParam = initialParameters.getValueParam(FILE_PATH_PARAMETER); if (filePathValueParam == null) { throw new IllegalStateException("No temporary file path is specified for " + SystemParametersPersistenceConfigurator.class.getSimpleName()); } filePath = filePathValueParam.getValue() + File.separator + FILE_NAME; }
public Class run() throws ClassNotFoundException { return ClassLoading.loadClass(injectAnnotationParameter.getValue(), DependencySupplier.class); } });
public UserDashboardConfigurationService(DataStorage dataStorageService, UserPortalConfigService userPortalConfigService, GadgetRegistryService gadgetRegistryService, InitParams initParams) { defaultTabName = initParams.getValueParam("dashboardTabName").getValue(); defaultTabLabel = initParams.getValueParam("dashboardTabLabel").getValue(); dashboardPageTemplate = initParams.getValueParam("dashboardPageTemplate").getValue(); involvedUsers = initParams.getValueParam("involvedUsers").getValue(); if (involvedUsers.equals(SEPARATE_INVOLVED_USERS)) { separateUsersconfig = initParams.getObjectParamValues(UserDashboardConfiguration.class); // separateUsersconfig should not be null if (separateUsersconfig == null) { throw new IllegalStateException(involvedUsers + " is used for " + initParams.getValueParam("involvedUsers").getName() + " init param..\nObject param values can not be null..\nPlease check your configuration"); } } else if (involvedUsers.equals(ALL_INVOLVED_USERS)) { allUsersConfig = initParams.getObjectParamValues(Gadget.class); // allUsersConfig should not be null if (allUsersConfig == null) { throw new IllegalStateException(involvedUsers + " is used for " + initParams.getValueParam("involvedUsers").getName() + " init param..\nObject param values can not be null..\nPlease check your configuration"); } } else { // error in configuration throw new IllegalStateException(initParams.getValueParam("involvedUsers").getName() + " init param is missing.. Please check your configuration"); } this.dataStorageService = dataStorageService; this.userPortalConfigService = userPortalConfigService; this.gadgetRegistryService = gadgetRegistryService; }
public OAuthRegistrationServicesImpl(InitParams initParams, OrganizationService orgService, IdentityManager identityManager) { ValueParam onFly = initParams.getValueParam("registerOnFly"); String onFlyValue = onFly == null ? "" : onFly.getValue(); if(onFlyValue != null && !onFlyValue.isEmpty()) { registerOnFly = Arrays.asList(onFlyValue.split(",")); } else { registerOnFly = Collections.EMPTY_LIST; } this.orgService = orgService; this.identityManager = identityManager; }
public PopulateGadgetRegisryService(GadgetRegistryService gadgetRegistryService, ApplicationRegistryService applicationRegistryService, InitParams initParams) { categoryName = initParams.getValueParam("gadgetsCategoryName").getValue(); if (categoryName == null) { categoryName = DEFAULT_GADGETS_CATEGORY_NAME; LOG.warn("Failed to retrieve " + initParams.getValueParam("gadgetsCategoryName").getName() + " init param. Default category name will be used: " + DEFAULT_GADGETS_CATEGORY_NAME); } gadgetsCategoryAccessPermission = initParams.getValueParam("gadgetsCategoryAccessPermission").getValue(); if (gadgetsCategoryAccessPermission == null) { gadgetsCategoryAccessPermission = UserACL.EVERYONE; LOG.warn("Failed to retrieve " + initParams.getValueParam("gadgetsCategoryAccessPermission").getName() + " init param. Default access permission will be used: " + UserACL.EVERYONE); } gadgets = initParams.getObjectParamValues(Gadget.class); this.gadgetRegistryService = gadgetRegistryService; this.applicationRegistryService = applicationRegistryService; }
public AuthenticationHandler(InitParams params) { String callbackEnabledParam = params.getValueParam("ssoCallbackEnabled").getValue(); this.callbackEnabled = Boolean.parseBoolean(callbackEnabledParam); }
ValueParam workspaceValueParam = initParams.getValueParam("workspace"); if (workspaceValueParam != null) { workspaceName = workspaceValueParam.getValue(); jcrRootPath = pathParam.getValue(); if (maxNodesParam != null) { try { maxTreatedNodes = Long.parseLong(maxNodesParam.getValue()); if (maxTreatedNodes < 0) { throw new IllegalArgumentException("'maxTreatedNodes' parameter should be a positive integer."); LOG.error("Parameter '" + maxNodesParam.getName() + "' is not a valid number.", e);
public UpgradeGroupSiteLayoutPlugin (DataStorage dataStorage, InitParams initParams) { super(initParams); dataStorage_ = dataStorage; groupSiteTemplateName = initParams.getValueParam(GROUP_SITE_TEMPLATE_NAME).getValue(); groupSiteTemplateLocation = initParams.getValueParam(GROUP_SITE_TEMPLATE_LOACTION).getValue(); } @Override
/** * {@inheritDoc} */ @Override public boolean isSkipPlatformRegistration() { String skipPLFRegister = initParams.getValueParam(SOFTWARE_REGISTRATION_SKIP).getValue(); if(skipPLFRegister==null) return false; return StringUtils.equals("true", skipPLFRegister.trim()); }
public UpgradeUserSiteLayoutPlugin (DataStorage dataStorage, InitParams initParams) { super(initParams); dataStorage_ = dataStorage; userSiteTemplateName = initParams.getValueParam(USER_SITE_TEMPLATE_NAME).getValue(); userSiteTemplateLocation = initParams.getValueParam(USER_SITE_TEMPLATE_LOACTION).getValue(); } @Override
public PingBackService(InitParams initParams, ProductInformations productInformations) { if (initParams != null) { ValueParam pingBackUrlValueParam = initParams.getValueParam("pingBackUrl"); pingBackUrl = pingBackUrlValueParam != null ? pingBackUrlValueParam.getValue() : ""; } this.productInformations = productInformations; }
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() ; }
/** * Returns the value of the ValueParam if and only if the value is not empty */ private static String getValueParam(InitParams params, String key) { if (params == null) { return null; } final ValueParam vp = params.getValueParam(key); String result; if (vp == null || (result = vp.getValue()) == null || (result = result.trim()).length() == 0) { return null; } return result; }
public DownloadService(PortalContainerInfo pinfo, InitParams params) throws Exception { int maxSize = Integer.parseInt(params.getValueParam("download.resource.cache.size").getValue()); downloadResources_ = new Cache(maxSize); defaultResources_ = new HashMap<String, DownloadResource>(); pinfo_ = pinfo; }
public UnlockService(ProductInformations productInformations, PingBackService pingBackService, InitParams params) throws MissingProductInformationException { this.productInformations = productInformations; this.pingBackService = pingBackService; registrationFormUrl = ((ValueParam) params.get("registrationFormUrl")).getValue(); defaultPingBackUrl = ((ValueParam) params.get("defaultPingBackUrl")).getValue(); extendFormUrl = ((ValueParam) params.get("extendFormUrl")).getValue(); subscriptionUrl = ((ValueParam) params.get("subscriptionUrl")).getValue(); keyContent = ((ValueParam) params.get("KeyContent")).getValue().trim(); String tmpValue = ((ValueParam) params.get("delayPeriod")).getValue(); delayPeriod = (tmpValue == null || tmpValue.isEmpty()) ? Utils.DEFAULT_DELAY_PERIOD : Integer.parseInt(tmpValue); String licensePath = params.getValueParam("exo.license.path").getValue(); Utils.HOME_CONFIG_LOCATION = Utils.EXO_HOME_FOLDER + "/" + Utils.PRODUCT_NAME; Utils.HOME_CONFIG_FILE_LOCATION = Utils.HOME_CONFIG_LOCATION + "/" + Utils.LICENSE_FILE; if(StringUtils.isNotBlank(licensePath) && !StringUtils.equals(licensePath, Utils.HOME_CONFIG_FILE_LOCATION)) { checkCustomizeFolder(licensePath); } }
@Override public boolean isRetainable() { if (configurationPersister != null) { return true; } String strfileUri = param.getValue(); URL fileURL; try { fileURL = configurationService.getURL(strfileUri); } catch (Exception e) { return false; } return fileURL.getProtocol().equals("file"); }
/** * Gives the value of the {@link ValueParam} corresponding to the given key * @param params the list of initial parameters from which we want to extract the {@link ValueParam} * @param parameterKey the name of the {@link ValueParam} that we are looking for * @return the value if it exists, null otherwise */ private static String getValueParam(InitParams params, String parameterKey) { if (params != null) { ValueParam parameterKeyValue = params.getValueParam(parameterKey); if (parameterKeyValue != null) { String parameterKeyValueString = parameterKeyValue.getValue(); if (parameterKeyValueString != null) { return parameterKeyValueString.trim(); } } } return null; }