Package com.opensymphony.module.propertyset

Examples of com.opensymphony.module.propertyset.PropertySet


  private String getDefaultGUI(HttpServletRequest request)
  {
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      return ps.getString("principal_" + request.getRemoteUser() + "_defaultGUI");
  }
View Full Code Here


  private String getTheme(HttpServletRequest request)
  {
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      return ps.getString("principal_" + request.getRemoteUser() + "_theme");
  }
View Full Code Here

  private String getPreferredRepositoryId(HttpServletRequest request)
  {
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      return ps.getString("principal_" + request.getRemoteUser() + "_defaultRepositoryId");
  }
View Full Code Here

        this.contentTypeDefinitionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList(ContentTypeDefinitionVO.CONTENT);
        this.repositoryVOList = RepositoryController.getController().getRepositoryVOListNotMarkedForDeletion();
           
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      byte[] WYSIWYGConfigBytes = ps.getData("repository_" + this.getRepositoryId() + "_WYSIWYGConfig");
      if(WYSIWYGConfigBytes != null)
        this.WYSIWYGConfig = new String(WYSIWYGConfigBytes, "utf-8");

      byte[] StylesXMLBytes = ps.getData("repository_" + this.getRepositoryId() + "_StylesXML");
      if(StylesXMLBytes != null)
        this.stylesXML = new String(StylesXMLBytes, "utf-8");

      byte[] extraPropertiesBytes = ps.getData("repository_" + this.getRepositoryId() + "_extraProperties");
      if(extraPropertiesBytes != null)
        this.extraProperties = new String(extraPropertiesBytes, "utf-8");

      this.defaultFolderContentTypeName   = ps.getString("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName");
      this.defaultTemplateRepository     = ps.getString("repository_" + this.getRepositoryId() + "_defaultTemplateRepository");
      this.parentRepository         = ps.getString("repository_" + this.getRepositoryId() + "_parentRepository");
    }
View Full Code Here

   
    public String doSave() throws Exception
    {
      Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      ps.setData("repository_" + this.getRepositoryId() + "_WYSIWYGConfig", WYSIWYGConfig.getBytes("utf-8"));
      ps.setData("repository_" + this.getRepositoryId() + "_StylesXML", stylesXML.getBytes("utf-8"));
      ps.setData("repository_" + this.getRepositoryId() + "_extraProperties", extraProperties.getBytes("utf-8"));
      ps.setString("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName", defaultFolderContentTypeName);
      ps.setString("repository_" + this.getRepositoryId() + "_defaultTemplateRepository", defaultTemplateRepository);
      ps.setString("repository_" + this.getRepositoryId() + "_parentRepository", parentRepository);
     
      //TODO - hack to get the caches to be updated when properties are affected..
      RepositoryVO repositoryVO = RepositoryController.getController().getFirstRepositoryVO();
      repositoryVO.setDescription(repositoryVO.getDescription() + ".");
      RepositoryController.getController().update(repositoryVO);
View Full Code Here

       
        db.remove(content);
           
            Map args = new HashMap();
            args.put("globalKey", "infoglue");
            PropertySet ps = PropertySetManager.getInstance("jdbc", args);

            ps.remove( "content_" + content.getContentId() + "_allowedContentTypeNames");
            ps.remove( "content_" + content.getContentId() + "_defaultContentTypeName");
            ps.remove( "content_" + content.getContentId() + "_initialLanguageId");

      }
      else
      {
        throw new ConstraintException("ContentVersion.stateId", "3300", content.getName());
View Full Code Here

  public LanguageVO getInitialLanguageVO(Database db, Integer contentId, Integer repositoryId) throws Exception
  {
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

      String initialLanguageId = ps.getString("content_" + contentId + "_initialLanguageId");
      ContentVO content = ContentController.getContentController().getContentVOWithId(contentId, db);
      ContentVO parentContent = ContentController.getContentController().getContentVOWithId(content.getParentContentId(), db);
      while((initialLanguageId == null || initialLanguageId.equalsIgnoreCase("-1")) && parentContent != null)
      {
          initialLanguageId = ps.getString("content_" + parentContent.getId() + "_initialLanguageId");
          if(parentContent.getParentContentId() != null)
            parentContent = ContentController.getContentController().getContentVOWithId(parentContent.getParentContentId(), db);
          else
            parentContent = null;
          //parentContent = parentContent.getParentContent();
View Full Code Here

      SiteNodeVersionVO siteNodeVersion = SiteNodeVersionController.getController().createSmall(newSiteNode.getId(), principal, newSiteNodeVersionVO, db).getValueObject();
          RequestAnalyser.getRequestAnalyser().registerComponentStatistics("createSmall", t.getElapsedTime());
     
          Map args = new HashMap();
        args.put("globalKey", "infoglue");
        PropertySet ps = PropertySetManager.getInstance("jdbc", args);

        String disabledLanguagesString = ps.getString("siteNode_" + oldSiteNodeVO.getId() + "_disabledLanguages");
        String enabledLanguagesString = ps.getString("siteNode_" + oldSiteNodeVO.getId() + "_enabledLanguages");
        logger.info("disabledLanguagesString:" + disabledLanguagesString);
        logger.info("enabledLanguagesString:" + enabledLanguagesString);
       
        if(disabledLanguagesString != null && !disabledLanguagesString.equals(""))
          ps.setString("siteNode_" + newSiteNode.getId() + "_disabledLanguages", disabledLanguagesString);
        if(enabledLanguagesString != null && !enabledLanguagesString.equals(""))
          ps.setString("siteNode_" + newSiteNode.getId() + "_enabledLanguages", enabledLanguagesString);

        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ps", t.getElapsedTime());

        //Copy all access rights...
        SiteNodeStateController.getController().copyAccessRights("SiteNodeVersion", oldSiteNodeVersionId, siteNodeVersion.getId(), db);
View Full Code Here

    }

    //TEST
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

    Map<String,String> repositoryProperties = master.getRepositoryProperties();
    Iterator<String> repositoryPropertiesIterator = repositoryProperties.keySet().iterator();
    while(repositoryPropertiesIterator.hasNext())
    {
      String key = repositoryPropertiesIterator.next();
      String value = repositoryProperties.get(key);
      String[] splittedString = key.split("_");
      if(splittedString.length == 3)
      {
        String oldRepId = splittedString[1];
        key = key.replaceAll(oldRepId, "" + repositoryIdMap.get(oldRepId));
       
        if(value != null && !value.equals("null"))
        {
          try
          {
            if(key.indexOf("_WYSIWYGConfig") > -1 || key.indexOf("_StylesXML") > -1 || key.indexOf("_extraProperties") > -1)
              ps.setData(key, value.getBytes("utf-8"));
            else
              ps.setString(key, value);
          }
          catch (Exception e)
          {
            logger.error("Error saving property " + key + ":" + e.getMessage());
          }
        }
      }
    }

    Map<String,String> contentProperties = master.getContentProperties();
    Iterator<String> contentPropertiesIterator = contentProperties.keySet().iterator();
    while(contentPropertiesIterator.hasNext())
    {
      String key = contentPropertiesIterator.next();
      String value = contentProperties.get(key);
      String[] splittedString = key.split("_");
      if(splittedString.length == 3)
      {
        String oldContentId = splittedString[1];
        key = key.replaceAll(oldContentId, (String)contentIdMap.get(oldContentId));
        try
        {
          if(value != null && !value.equals("null"))
            ps.setString(key, value);
        }
        catch (Exception e)
        {
          logger.error("Error saving property " + key + ":" + e.getMessage());
        }
      }
    }

    Map<String,String> siteNodeProperties = master.getSiteNodeProperties();
    Iterator<String> siteNodePropertiesIterator = siteNodeProperties.keySet().iterator();
    while(siteNodePropertiesIterator.hasNext())
    {
      String key = siteNodePropertiesIterator.next();
      String value = siteNodeProperties.get(key);
      String[] splittedString = key.split("_");
      if(splittedString.length == 3)
      {
        String oldSiteNodeId = splittedString[1];
        key = key.replaceAll(oldSiteNodeId, (String)siteNodeIdMap.get(oldSiteNodeId));
        try
        {
          if(value != null && !value.equals("null"))
            ps.setString(key, value);
        }
        catch (Exception e)
        {
          logger.error("Error saving property " + key + ":" + e.getMessage());
        }
View Full Code Here

     
    ContentTypeDefinitionController.getController().update(contentTypeDefinitionVO.getParentId(), contentTypeDefinitionVO);
   
      Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      ps.setString("contentTypeDefinitionId_" + this.contentTypeDefinitionVO.getId() + "_versionsToKeep", "" + this.versionsToKeep);

    return "success";
  }
View Full Code Here

TOP

Related Classes of com.opensymphony.module.propertyset.PropertySet

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.