Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.GroupPropertiesVO


                  RolePropertiesVO rolePropertiesVO = RolePropertiesController.getController().getRolePropertiesVOWithId(this.entityId);
                  this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(rolePropertiesVO.getContentTypeDefinitionId());           
              }
              else if(this.entity.equalsIgnoreCase(GroupProperties.class.getName()))
              {
                  GroupPropertiesVO groupPropertiesVO = GroupPropertiesController.getController().getGroupPropertiesVOWithId(this.entityId);
                  this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(groupPropertiesVO.getContentTypeDefinitionId());           
              }
          }
         
 
        InputStream is = null;
View Full Code Here


                  RolePropertiesVO rolePropertiesVO = RolePropertiesController.getController().getRolePropertiesVOWithId(this.entityId);
                  this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(rolePropertiesVO.getContentTypeDefinitionId());           
              }
              else if(this.entity.equalsIgnoreCase(GroupProperties.class.getName()))
              {
                  GroupPropertiesVO groupPropertiesVO = GroupPropertiesController.getController().getGroupPropertiesVOWithId(this.entityId);
                  this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(groupPropertiesVO.getContentTypeDefinitionId());           
              }
          }
    }
    catch (Exception e)
    {
View Full Code Here

   * is handling.
   */

  public BaseEntityVO getNewVO()
  {
    return new GroupPropertiesVO();
  }
View Full Code Here

   * This method updates an extranet group properties.
   */

  public GroupPropertiesVO update(Integer languageId, Integer contentTypeDefinitionId, GroupPropertiesVO groupPropertiesVO) throws ConstraintException, SystemException
  {
    GroupPropertiesVO realGroupPropertiesVO = groupPropertiesVO;
     
    if(groupPropertiesVO.getId() == null)
    {
      logger.info("Creating the entity because there was no version at all for: " + contentTypeDefinitionId + " " + languageId);
      realGroupPropertiesVO = create(languageId, contentTypeDefinitionId, groupPropertiesVO);
View Full Code Here

    {
      List<GroupPropertiesVO> groupProperties = GroupPropertiesController.getController().getGroupPropertiesVOList(propertyName, value, db);
      Iterator<GroupPropertiesVO> groupPropertiesIterator = groupProperties.iterator();
      while(groupPropertiesIterator.hasNext())
      {
        GroupPropertiesVO groupPropertiesVO = groupPropertiesIterator.next();
        if(useLanguageFallback || (!useLanguageFallback && languageId != null && groupPropertiesVO.getLanguageId().equals(languageId)))
        {
          if(groupPropertiesVO.getGroupName() != null)
          {
            try
            {
              InfoGlueGroup group = GroupControllerProxy.getController(db).getGroup(groupPropertiesVO.getGroupName());
              if(group != null)
                groups.add(group);
            }
            catch (Exception e)
            {
              logger.warn("No such group or problem getting group " + groupPropertiesVO.getGroupName() + ":" + e.getMessage());
            }
          }
        }
      }
    }
View Full Code Here

   * single value and saves it back to the db.
   */
  
  public void updateAttributeValue(Integer groupPropertiesId, String attributeName, String attributeValue) throws SystemException, Bug
  {
    GroupPropertiesVO groupPropertiesVO = getGroupPropertiesVOWithId(groupPropertiesId);
   
    if(groupPropertiesVO != null)
    {
      try
      {
        logger.info("attributeName:"  + attributeName);
        logger.info("versionValue:"   + groupPropertiesVO.getValue());
        logger.info("attributeValue:" + attributeValue);
        InputSource inputSource = new InputSource(new StringReader(groupPropertiesVO.getValue()));
       
        DOMParser parser = new DOMParser();
        parser.parse(inputSource);
        Document document = parser.getDocument();
       
        NodeList nl = document.getDocumentElement().getChildNodes();
        Node attributesNode = nl.item(0);
       
        boolean existed = false;
        nl = attributesNode.getChildNodes();
        for(int i=0; i<nl.getLength(); i++)
        {
          Node n = nl.item(i);
          if(n.getNodeName().equalsIgnoreCase(attributeName))
          {
            if(n.getFirstChild() != null && n.getFirstChild().getNodeValue() != null)
            {
              n.getFirstChild().setNodeValue(attributeValue);
              existed = true;
              break;
            }
            else
            {
              CDATASection cdata = document.createCDATASection(attributeValue);
              n.appendChild(cdata);
              existed = true;
              break;
            }
          }
        }
       
        if(existed == false)
        {
          org.w3c.dom.Element attributeElement = document.createElement(attributeName);
          attributesNode.appendChild(attributeElement);
          CDATASection cdata = document.createCDATASection(attributeValue);
          attributeElement.appendChild(cdata);
        }
       
        StringBuffer sb = new StringBuffer();
        org.infoglue.cms.util.XMLHelper.serializeDom(document.getDocumentElement(), sb);
        logger.info("sb:" + sb);
        groupPropertiesVO.setValue(sb.toString());
        update(groupPropertiesVO.getLanguageId(), groupPropertiesVO.getContentTypeDefinitionId(), groupPropertiesVO);
      }
      catch(Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

    logger.info("languageId: " + languageId);
    logger.info("attributeName: " + attributeName);
      List groupPropertiesVO = this.getGroupPropertiesVOList(groupName, languageId, db);
    logger.info("groupPropertiesVO: " + groupPropertiesVO);
      Iterator iterator = groupPropertiesVO.iterator();
    GroupPropertiesVO groupPropertyVO = null;
    while(iterator.hasNext())
    {
          groupPropertyVO = (GroupPropertiesVO)iterator.next();
      logger.info("groupPropertyVO: " + groupPropertyVO.getId() + ":" + groupPropertyVO.getValue());
          break;
      }

    logger.info("groupPropertyVO: " + groupPropertyVO);
    if(groupPropertyVO != null)
    { 
      value = this.getAttributeValue(groupPropertyVO.getValue(), attributeName, false);
      logger.info("value: " + value);
    }
   
    return value;
  }
View Full Code Here

  
  public String getAttributeValue(Integer groupPropertiesId, String attributeName, boolean escapeHTML) throws SystemException, Bug
  {
    String value = "";
   
    GroupPropertiesVO groupPropertiesVO = getGroupPropertiesVOWithId(groupPropertiesId);
   
    if(groupPropertiesVO != null)
    { 
      value = getAttributeValue(groupPropertiesVO.getValue(), attributeName, escapeHTML);
    }

    return value;
  }
View Full Code Here

  {
    List relatedContentList = new ArrayList();

    List groupPropertiesVO = this.getGroupPropertiesVOList(groupName, languageId, db);
      Iterator iterator = groupPropertiesVO.iterator();
      GroupPropertiesVO groupPropertyVO = null;
      while(iterator.hasNext())
      {
          groupPropertyVO = (GroupPropertiesVO)iterator.next();
          break;
      }

    if(groupPropertyVO != null)
    {
      String xml = this.getAttributeValue(groupPropertyVO.getValue(), attributeName, false);
      relatedContentList = this.getReadOnlyRelatedContentsFromXML(db, xml);
    }
   
    return relatedContentList;
  }
View Full Code Here

  {
    List<ContentVO> relatedContentList = new ArrayList<ContentVO>();

    List groupPropertiesVO = this.getGroupPropertiesVOList(groupName, languageId, db);
      Iterator iterator = groupPropertiesVO.iterator();
      GroupPropertiesVO groupPropertyVO = null;
      while(iterator.hasNext())
      {
          groupPropertyVO = (GroupPropertiesVO)iterator.next();
          break;
      }

    if(groupPropertyVO != null)
    {
      String xml = this.getAttributeValue(groupPropertyVO.getValue(), attributeName, false);
      relatedContentList = this.getRelatedContentVOListFromXML(db, xml);
    }
   
    return relatedContentList;
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.GroupPropertiesVO

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.