Package org.infoglue.cms.entities.management

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


 
    Collection userPropertiesList = UserPropertiesController.getController().getUserPropertiesList(infoGluePrincipal.getName(), languageId, db, true);
    Iterator userPropertiesListIterator = userPropertiesList.iterator();
    while(userPropertiesListIterator.hasNext())
    {
      UserProperties userProperties = (UserProperties)userPropertiesListIterator.next();

      if(userProperties != null && userProperties.getLanguage().getLanguageId().equals(languageId) && userProperties.getValue() != null && propertyName != null)
      {
        String propertyXML = userProperties.getValue();
        DOMBuilder domBuilder = new DOMBuilder();
        Document document = domBuilder.getDocument(propertyXML);
 
        Node node = document.getRootElement().selectSingleNode("attributes/" + propertyName);
        if(node != null)
View Full Code Here


    Collection userPropertiesList = UserPropertiesController.getController().getUserPropertiesList(infoGluePrincipal.getName(), languageId, db, true);
    logger.info("userProperties:" + userPropertiesList.size());
    Iterator userPropertiesListIterator = userPropertiesList.iterator();
    while(userPropertiesListIterator.hasNext())
    {
      UserProperties userProperties = (UserProperties)userPropertiesListIterator.next();
      //logger.info("userProperties:" + userProperties.getValue());
      //logger.info("propertyName:" + propertyName);
      logger.info("userProperties:" + userProperties.getValue());
      logger.info("assetKey:" + assetKey);

      if(userProperties != null && userProperties.getLanguage().getLanguageId().equals(languageId))
      {
          Collection assets = userProperties.getDigitalAssets();
          logger.info("assets:" + assets.size());
          Iterator assetsIterator = assets.iterator();
          while(assetsIterator.hasNext())
          {
              DigitalAsset digitalAsset = (DigitalAsset)assetsIterator.next();
View Full Code Here

   
    Collection userPropertiesList = UserPropertiesController.getController().getUserPropertiesList(infoGluePrincipal.getName(), languageId, db, true);
    Iterator userPropertiesListIterator = userPropertiesList.iterator();
    while(userPropertiesListIterator.hasNext())
    {
      UserProperties userProperties = (UserProperties)userPropertiesListIterator.next();
 
      if(userProperties != null && userProperties.getLanguage().getLanguageId().equals(languageId))
      {
          Collection assets = userProperties.getDigitalAssets();
          Iterator assetsIterator = assets.iterator();
          while(assetsIterator.hasNext())
          {
              DigitalAsset digitalAsset = (DigitalAsset)assetsIterator.next();
              if(digitalAsset.getAssetKey().equalsIgnoreCase(assetKey))
View Full Code Here

  public UserPropertiesVO create(Integer languageId, Integer contentTypeDefinitionId, UserPropertiesVO userPropertiesVO) throws ConstraintException, SystemException
    {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    UserProperties userProperties = null;

    beginTransaction(db);
    try
    {
      userProperties = create(languageId, contentTypeDefinitionId, userPropertiesVO, db);
      commitTransaction(db);
    }
    catch(Exception e)
    {
      logger.error("An error occurred so we should not completes the transaction:" + e, e);
      rollbackTransaction(db);
      throw new SystemException(e.getMessage());
    }
   
    return userProperties.getValueObject();
  }    
View Full Code Here

  public UserProperties create(Integer languageId, Integer contentTypeDefinitionId, UserPropertiesVO userPropertiesVO, Database db) throws ConstraintException, SystemException, Exception
    {
    Language language = LanguageController.getController().getLanguageWithId(languageId, db);
    ContentTypeDefinition contentTypeDefinition = ContentTypeDefinitionController.getController().getContentTypeDefinitionWithId(contentTypeDefinitionId, db);

    UserProperties userProperties = new UserPropertiesImpl();
    userProperties.setLanguage((LanguageImpl)language);
    userProperties.setContentTypeDefinition((ContentTypeDefinition)contentTypeDefinition);
 
    userProperties.setValueObject(userPropertiesVO);

    db.create(userProperties);
   
    return userProperties;
  }    
View Full Code Here

  public UserPropertiesVO update(UserPropertiesVO userPropertiesVO, String[] users) throws ConstraintException, SystemException
  {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    UserProperties userProperties = null;

    beginTransaction(db);

    try
    {
      //add validation here if needed
      userProperties = getUserPropertiesWithId(userPropertiesVO.getUserPropertiesId(), db);        
      userProperties.setValueObject(userPropertiesVO);

      //If any of the validations or setMethods reported an error, we throw them up now before create.
      ceb.throwIfNotEmpty();
           
      commitTransaction(db);
    }
    catch(ConstraintException ce)
    {
      logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
      rollbackTransaction(db);
      throw ce;
    }
    catch(Exception e)
    {
      logger.error("An error occurred so we should not complete the transaction:" + e, e);
      rollbackTransaction(db);
      throw new SystemException(e.getMessage());
    }

    return userProperties.getValueObject();
  }    
View Full Code Here

  /**
   * This method deletes the relation to a digital asset - not the asset itself.
   */
  public void deleteDigitalAssetRelation(Integer userPropertiesId, DigitalAsset digitalAsset, Database db) throws SystemException, Bug
    {
      UserProperties userProperties = getUserPropertiesWithId(userPropertiesId, db);
     
    userProperties.getDigitalAssets().remove(digitalAsset);
        digitalAsset.getUserProperties().remove(userProperties);
    }
View Full Code Here

        results = oql.execute();
    }
   
    while (results.hasMore())
    {
      UserProperties userProperties = (UserProperties)results.next();
      userPropertiesList.add(userProperties);
    }

    results.close();
    oql.close();
View Full Code Here

        beginTransaction(db);

        try
        {
      UserProperties userProperties = UserPropertiesController.getController().getUserPropertiesWithId(userPropertiesId, db);
      if(userProperties != null)
      {
        Collection digitalAssets = userProperties.getDigitalAssets();
        digitalAssetVOList = toVOList(digitalAssets);
      }
                 
            commitTransaction(db);
        }
View Full Code Here

         
        contentVersion.getDigitalAssets().add(digitalAsset);           
        }
        else if(entity.equalsIgnoreCase(UserProperties.class.getName()))
        {
        UserProperties userProperties = UserPropertiesController.getController().getUserPropertiesWithId(entityId, db);
        Collection userPropertiesList = new ArrayList();
        userPropertiesList.add(userProperties);
        logger.info("Added userProperties:" + userProperties.getId());
        
        digitalAsset = new DigitalAssetImpl();
        digitalAsset.setValueObject(digitalAssetVO);
        if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
          digitalAsset.setAssetBlob(is);
        digitalAsset.setUserProperties(userPropertiesList);
       
        db.create(digitalAsset);
         
        userProperties.getDigitalAssets().add(digitalAsset);           
        }
        else if(entity.equalsIgnoreCase(RoleProperties.class.getName()))
        {
            RoleProperties roleProperties = RolePropertiesController.getController().getRolePropertiesWithId(entityId, db);
        Collection rolePropertiesList = new ArrayList();
View Full Code Here

TOP

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

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.