Package com.agiletec.plugins.jpmyportalplus.aps.system.services.config.model

Examples of com.agiletec.plugins.jpmyportalplus.aps.system.services.config.model.MyPortalConfig


    super.setUp();
    this.init();
  }

  public void testGetConfig() throws Throwable {
    MyPortalConfig config = this._myPortalConfigManager.getConfig();
    assertNotNull(config);
    assertEquals(3, config.getAllowedShowlets().size());
    assertTrue(config.getAllowedShowlets().contains("jpmyportalplus_sample_widget"));
    assertTrue(config.getAllowedShowlets().contains("jpmyportalplus_test_widget_1"));
  }
View Full Code Here


    assertTrue(config.getAllowedShowlets().contains("jpmyportalplus_sample_widget"));
    assertTrue(config.getAllowedShowlets().contains("jpmyportalplus_test_widget_1"));
  }
 
  public void testUpdateConfig() throws Throwable {
    MyPortalConfig config = this._myPortalConfigManager.getConfig();
    assertEquals(3, config.getAllowedShowlets().size());
    try {
      MyPortalConfig newConfig = new MyPortalConfig();
      assertNull(newConfig.getAllowedShowlets());
      Set<String> allowedShowlets = new HashSet<String>();
      allowedShowlets.addAll(config.getAllowedShowlets());
      allowedShowlets.add("jpmyportalplus_test_widget_2");
      newConfig.setAllowedShowlets(allowedShowlets);
      this._myPortalConfigManager.saveConfig(newConfig);
      MyPortalConfig extractedNewConfig = this._myPortalConfigManager.getConfig();
      assertEquals(4, extractedNewConfig.getAllowedShowlets().size());
    } catch (Exception e) {
      throw e;
    } finally {
      this._myPortalConfigManager.saveConfig(config);
      MyPortalConfig extractedConfig = this._myPortalConfigManager.getConfig();
      assertEquals(3, extractedConfig.getAllowedShowlets().size());
    }
  }
View Full Code Here

*/
public class MyPortalPlusConfigDOM {

  public MyPortalConfig extractConfig(String xml) throws ApsSystemException {
    Element root = this.getRootElement(xml);
    MyPortalConfig config = new MyPortalConfig();
    this.extractWidgetConfig(root, config);
    return config;
  }
View Full Code Here

  private String updateWidgetTypeConfig() {
    try {
      this.getWidgetTypeCode();
      boolean swappable = (null != this.getSwappable()) ? this.getSwappable().booleanValue() : false;
      if (this.isCustomizable()) {
        MyPortalConfig config = this.getMyPortalConfigManager().getConfig();
        if (swappable) {
          config.getAllowedShowlets().add(this.getWidgetTypeCode());
        } else {
          config.getAllowedShowlets().remove(this.getWidgetTypeCode());
        }
        this.getMyPortalConfigManager().saveConfig(config);
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "updateShowletTypeConfig");
View Full Code Here

          || cookie.getValue() == null
          || cookie.getValue().trim().length() == 0) {
        ApsSystemUtils.getLogger().trace("Cookie nullo o invalido per pagina " + page.getCode());
        return null;
      }
      MyPortalConfig mPortalConfig = this.getMyPortalConfigManager().getConfig();
      customConfig = new CustomPageConfig(cookie, page, this.getWidgetTypeManager(),
          mPortalConfig.getAllowedShowlets(), this.getVoidShowletCode());
      for (int i = 0; i < customConfig.getConfig().length; i++) {
        Widget showlet = customConfig.getConfig()[i];
        if (null != showlet) {
          if (null != showlet.getType()) {
            String mainGroup = showlet.getType().getMainGroup();
View Full Code Here

  }
 
  @Override
  public String edit() {
    try {
      MyPortalConfig config = this.getMyPortalConfigManager().getConfig();
      this.populateForm(config);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "edit");
      return FAILURE;
    }
View Full Code Here

  }
 
  @Override
  public String save() {
    try {
      MyPortalConfig config = this.prepareConfig();
      this.getMyPortalConfigManager().saveConfig(config);
      this.addActionMessage(this.getText("jpmyportalplus.message.configSavedOk"));
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "save");
      return FAILURE;
View Full Code Here

    if (type.getCode().equals(this.getMyPortalConfigManager().getVoidShowletCode())) return;
    super.addFlavourWidgetType(mapCode, type, mapping);
  }
 
  private MyPortalConfig prepareConfig() throws ApsSystemException {
    MyPortalConfig config = new MyPortalConfig();
    config.setAllowedShowlets(this.getWidgetTypeCodes());
    return config;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpmyportalplus.aps.system.services.config.model.MyPortalConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.