Examples of UserProperties


Examples of org.freehep.util.UserProperties

     * @param bkg Background color for the image
     * @return Properties used to create a RAW image
     * @param code Color encoding, e.g. {@link ImageConstants#COLOR_MODEL_RGB}
     */
    public static UserProperties getRAWProperties(Color bkg, String code) {
        UserProperties result = new UserProperties();
        result.setProperty(RawImageWriteParam.BACKGROUND, bkg);
        result.setProperty(RawImageWriteParam.CODE, code);
        result.setProperty(RawImageWriteParam.PAD, 1);
        return result;
    }
View Full Code Here

Examples of org.freehep.util.UserProperties

        code = "ARGB";
        pad = 1;
    }

    public ImageWriteParam getWriteParam(Properties properties) {
        UserProperties p = new UserProperties(properties);
        setBackground(p.getPropertyColor(BACKGROUND, bkg));
        setCode(p.getProperty(CODE, code));
        setPad(p.getPropertyInt(PAD, pad));
        return this;
    }
View Full Code Here

Examples of org.freehep.util.UserProperties

        emf.writeDWORD(BitmapInfoHeader.size);
        emf.writeDWORD(size + BitmapInfoHeader.size); // bitmap follows bmi

        emf.pushBuffer();

        UserProperties properties = new UserProperties();
        properties.setProperty(RawImageWriteParam.BACKGROUND, bkg);
        properties.setProperty(RawImageWriteParam.CODE, "BGR");
        properties.setProperty(RawImageWriteParam.PAD, 4);
        ImageGraphics2D.writeImage((RenderedImage)image, "raw", properties,
                new NoCloseOutputStream(emf));

        // emf.writeImage(image, bkg, "BGR", 4);
        int length = emf.popBuffer();
View Full Code Here

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

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

    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

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))
      {
          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

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

  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

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

  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

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

  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

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

  /**
   * 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
TOP
Copyright © 2018 www.massapi.com. 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.