Пример #1
0
 /** {@inheritDoc} */
 public void setSpaceApplicationConfigPlugin(
     SpaceApplicationConfigPlugin spaceApplicationConfigPlugin) {
   // If not specify homeApplication config, use default from Social
   if (spaceApplicationConfigPlugin.getHomeApplication() == null) {
     spaceApplicationConfigPlugin.setHomeApplication(
         spaceApplicationConfigPlugin.getHomeApplication());
   }
   this.spaceApplicationConfigPlugin = spaceApplicationConfigPlugin;
 }
Пример #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);
          }
        }
      }
    }
  }