Package com.opensymphony.module.propertyset

Examples of com.opensymphony.module.propertyset.PropertySet


   
    this.availableLanguages = LanguageController.getController().getLanguageVOList(this.repositoryId);
   
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

      String disabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_disabledLanguages");
      logger.info("disabledLanguagesString:" + disabledLanguagesString);
      if(disabledLanguagesString != null && !disabledLanguagesString.equalsIgnoreCase(""))
      {
          String[] disabledLanguagesStringArray = disabledLanguagesString.split(",");
          for(int i=0; i<disabledLanguagesStringArray.length; i++)
          {
              try
              {
                LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(disabledLanguagesStringArray[i]));
                logger.info("Adding languageVO to disabledLanguages:" + languageVO.getName());
              this.disabledLanguages.add(languageVO);
              }
              catch(Exception e)
              {
                  logger.warn("An error occurred when we tried to get disabled language:" + e.getMessage(), e);
              }
          }
      }

      String enabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_enabledLanguages");
      logger.info("enabledLanguagesString:" + enabledLanguagesString);
      if(enabledLanguagesString != null && !enabledLanguagesString.equalsIgnoreCase(""))
      {
          String[] enabledLanguagesStringArray = enabledLanguagesString.split(",");
          for(int i=0; i<enabledLanguagesStringArray.length; i++)
View Full Code Here


   
    this.availableLanguages = LanguageController.getController().getLanguageVOList(this.repositoryId, db);
   
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

      String disabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_disabledLanguages");
      logger.info("disabledLanguagesString:" + disabledLanguagesString);
      if(disabledLanguagesString != null && !disabledLanguagesString.equalsIgnoreCase(""))
      {
          String[] disabledLanguagesStringArray = disabledLanguagesString.split(",");
          for(int i=0; i<disabledLanguagesStringArray.length; i++)
          {
              try
              {
                LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(new Integer(disabledLanguagesStringArray[i]), db);
                logger.info("Adding languageVO to disabledLanguages:" + languageVO.getName());
              this.disabledLanguages.add(languageVO);
              }
              catch(Exception e)
              {
                  logger.warn("An error occurred when we tried to get disabled language:" + e.getMessage(), e);
              }
          }
      }

      String enabledLanguagesString = ps.getString("siteNode_" + siteNodeId + "_enabledLanguages");
      logger.info("enabledLanguagesString:" + enabledLanguagesString);
      if(enabledLanguagesString != null && !enabledLanguagesString.equalsIgnoreCase(""))
      {
          String[] enabledLanguagesStringArray = enabledLanguagesString.split(",");
          for(int i=0; i<enabledLanguagesStringArray.length; i++)
View Full Code Here

   */
  public PropertySet getPropertySet()
  {
    //Timer t = new Timer();
      String key = "psCache_" + workflowId;
      PropertySet ps = (PropertySet)CacheController.getCachedObject("propertySetCache", key);
      if(ps == null)
      {
        ps = workflow.getPropertySet(workflowId);
        CacheController.cacheObject("propertySetCache", key, ps);
      }
View Full Code Here

    {
      return null;
    }
   
    final String key = (String) workflowDescriptor.getMetaAttributes().get(WORKFLOW_TITLE_EXTENSION_META_ATTRIBUTE);
    final PropertySet ps = getPropertySet();
    return ps.exists(key) ? ps.getString(key) : null;
  }
View Full Code Here

    {
      //if(true)
      //  return null;
     
      String key = "psCache_" + entryId;
      PropertySet ps = (PropertySet)CacheController.getCachedObject("propertySetCache", key);
     
      if(ps == null)
      {
        try
        {
          HashMap args = new HashMap();
            args.put("entityName", "OSWorkflowEntry");
            args.put("entityId", new Long(entryId));
   
            InfoglueDefaultHibernateConfigurationProvider configurationProvider = new InfoglueDefaultHibernateConfigurationProvider();
            configurationProvider.setSessionFactory(getSessionFactory());
   
            args.put("configurationProvider", configurationProvider);
           
        ps = new CachingPropertySet();
       
        Map args2 = new HashMap();
        args2.put("PropertySet", PropertySetManager.getInstance("hibernate", args));
        args2.put("bulkload", new Boolean(false));
       
        ps.init(new HashMap(), args2);
       
        CacheController.cacheObject("propertySetCache", key, ps);
          //logger.info("Caching propertySet for entry: " + entryId + ":" + ps);
       
            ps = PropertySetManager.getInstance("hibernate", args);
View Full Code Here

   *
   */
    public PropertySet getPropertySet(long entryId) {
       
      String key = "psCache_" + entryId;
      PropertySet ps = (PropertySet)CacheController.getCachedObject("propertySetCache", key);
     
      if(ps == null)
      {
        try
        {
          HashMap args = new HashMap();
            args.put("entityName", "OSWorkflowEntry");
            args.put("entityId", new Long(entryId));
   
        InfoglueDefaultHibernateConfigurationProvider configurationProvider = new InfoglueDefaultHibernateConfigurationProvider();
            configurationProvider.setSessionFactory(sessionFactory);
   
            args.put("configurationProvider", configurationProvider);
           
        ps = new CachingPropertySet();
       
        Map args2 = new HashMap();
        args2.put("PropertySet", PropertySetManager.getInstance("hibernate", args));
        args2.put("bulkload", new Boolean(true));
       
        ps.init(new HashMap(), args2);
        CacheController.cacheObject("propertySetCache", key, ps);
          //logger.info("Caching propertySet for entry: " + entryId + ":" + ps);
       
            ps = PropertySetManager.getInstance("hibernate", args);
        }
        catch(Exception e)
        {
          e.printStackTrace();
         
          try
          {
          logger.error("\n\nRestoring the session factory....");
            //sessionFactory.close();
          sessionFactory = new Configuration().configure().buildSessionFactory();
         
          InfoglueDefaultHibernateConfigurationProvider configurationProvider = new InfoglueDefaultHibernateConfigurationProvider();
              configurationProvider.setSessionFactory(sessionFactory);
     
              Map args = new HashMap();
              args.put("configurationProvider", configurationProvider);
             
          ps = new CachingPropertySet();
         
          Map args2 = new HashMap();
          args2.put("PropertySet", PropertySetManager.getInstance("hibernate", args));
          args2.put("bulkload", new Boolean(true));
         
          ps.init(new HashMap(), args2);
          }
        catch (HibernateException he)
        {
          he.printStackTrace();
        }
View Full Code Here

      //List<AccessRight> allAccessRights = AccessRightController.getController().getAllAccessRightListForExportReadOnly(db);
     
      //TEST
      Map args = new HashMap();
        args.put("globalKey", "infoglue");
        PropertySet ps = PropertySetManager.getInstance("jdbc", args);
        //END TEST
     
      String names = "";
      Repository repository   = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
      SiteNode siteNode     = SiteNodeController.getController().getRootSiteNode(repositoryId, db);
View Full Code Here

        this.contentTypeDefinitionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList(ContentTypeDefinitionVO.CONTENT);
        this.languageVOList = LanguageController.getController().getLanguageVOList(this.contentVO.getRepositoryId());
       
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

        if ( ps.exists("content_" + this.getContentId() + "_allowedContentTypeNames" ) )
      {
            this.allowedContentTypeNames    = ps.getString("content_" + this.getContentId() + "_allowedContentTypeNames");
        }
      this.defaultContentTypeName    = ps.getString("content_" + this.getContentId() + "_defaultContentTypeName");
      this.initialLanguageId      = ps.getString("content_" + this.getContentId() + "_initialLanguageId");
      logger.info("allowedContentTypeNames:" + allowedContentTypeNames);
      logger.info("defaultContentTypeName:" + defaultContentTypeName);
      logger.info("initialLanguageId:" + initialLanguageId);
    }
View Full Code Here

          }
        }
       
      Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      if(allowedContentTypeNames != null )
          ps.setString("content_" + this.getContentId() + "_allowedContentTypeNames", allowedContentTypeNames);
      if(defaultContentTypeName != null)
          ps.setString("content_" + this.getContentId() + "_defaultContentTypeName", defaultContentTypeName);
      if(initialLanguageId != null)
          ps.setString("content_" + this.getContentId() + "_initialLanguageId", initialLanguageId);
     
      return "save";
    }
View Full Code Here

   
    public String doExecute() throws Exception
    {
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      this.languageCode       = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_languageCode");
      this.defaultToolName     = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_defaultToolName");
      this.defaultRepositoryId   = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_defaultRepositoryId");
      this.defaultGUI       = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_defaultGUI");
      //this.theme           = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_theme");
      this.theme           = CmsPropertyHandler.getTheme(this.getInfoGluePrincipal().getName());
      this.toolbarVariant      = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_toolbarVariant");

      /* Provide the list of repositories but do not include the system tool repositories */
      List<RepositoryVO> acceptedHomeRepositoryVOList = new ArrayList<RepositoryVO>();
      List<RepositoryVO> authorizedRepositoryVOList = RepositoryController.getController().getAuthorizedRepositoryVOList(this.getInfoGluePrincipal(), false);

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.