示例#1
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);
  }
示例#2
0
  /**
   * SpaceServiceImpl constructor Initialize <tt>org.exoplatform.social.space.impl.JCRStorage</tt>
   *
   * @param params
   * @throws Exception
   */
  @SuppressWarnings("unchecked")
  public SpaceServiceImpl(
      InitParams params, SpaceStorage spaceStorage, IdentityStorage identityStorage)
      throws Exception {

    this.spaceStorage = spaceStorage;
    this.identityStorage = identityStorage;

    // backward compatible
    if (params != null) {
      LOG.warn(
          "The SpaceService configuration you attempt to use is deprecated, please update it by"
              + "using external-component-plugins configuration");
      spaceApplicationConfigPlugin = new SpaceApplicationConfigPlugin();
      Iterator<?> it = params.getValuesParamIterator();

      while (it.hasNext()) {
        ValuesParam param = (ValuesParam) it.next();
        String name = param.getName();
        if (name.endsWith("homeNodeApp")) {
          String homeNodeApp = param.getValue();
          SpaceApplication spaceHomeApplication = new SpaceApplication();
          spaceHomeApplication.setPortletName(homeNodeApp);
          spaceHomeApplication.setAppTitle(homeNodeApp);
          spaceHomeApplication.setIcon("SpaceHomeIcon");
          spaceApplicationConfigPlugin.setHomeApplication(spaceHomeApplication);
        }
        if (name.endsWith("apps")) {
          List<String> apps = param.getValues();
          for (String app : apps) {
            String[] splitedString = app.trim().split(":");
            String appName;
            boolean isRemovable;
            if (splitedString.length >= 2) {
              appName = splitedString[0];
              isRemovable = Boolean.getBoolean(splitedString[1]);
            } else { // suppose app is just the name
              appName = app;
              isRemovable = false;
            }
            SpaceApplication spaceApplication = new SpaceApplication();
            spaceApplication.setPortletName(appName);
            spaceApplication.isRemovable(isRemovable);

            spaceApplicationConfigPlugin.addToSpaceApplicationList(spaceApplication);
          }
        }
      }
    }
  }
 /**
  * Instantiates a new mime type map.
  *
  * @param params the params
  * @throws ConfigurationException the configuration exception
  */
 public MimeTypeMap(InitParams params) throws ConfigurationException {
   ValuesParam param = params.getValuesParam("mimetypes-properties");
   if (param != null) {
     ArrayList<String> paths = new ArrayList<String>();
     for (Object v : param.getValues()) {
       if (v instanceof String) {
         paths.add((String) v);
       }
     }
     this.paths = paths;
   } else {
     throw new ConfigurationException(
         "Values param mimetypes-properties required in "
             + this.getClass().getName()
             + " plugin");
   }
 }
 /** {@inheritDoc} */
 public ApplicationContext getApplicationContext(ApplicationContext parent) {
   try {
     AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
     ctx.setParent(parent);
     for (String value : params.getValues()) {
       Class<?> clazz =
           ClassLoading.forName(value, AnnotationConfigApplicationContextProvider.class);
       ctx.register(clazz);
     }
     ctx.refresh();
     return ctx;
   } catch (Exception e) {
     throw new RuntimeException("Could not create the ApplicationContext", e);
   }
 }
示例#5
0
 public IgnorePortalPlugin(InitParams initParams) {
   ValuesParam valuesParam = initParams.getValuesParam("ignored.portals");
   if (valuesParam != null) {
     ignorePortals = valuesParam.getValues();
   }
 }