Package org.infoglue.cms.entities.content

Examples of org.infoglue.cms.entities.content.ContentVersionVO


                  {
                    //logger.info("Was a contentversion access... let's clear caches for that content.");
                    String idAsString = acVO.getParameters();
                    if(idAsString != null && !idAsString.equals(""))
                    {
                      ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(new Integer(idAsString));
                      ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(contentVersionVO.getContentId()));
                        publicationVO.setRepositoryId(new Integer(contentVO.getRepositoryId()));

                      PublicationDetailVO publicationDetailVO = new PublicationDetailVO();
                      publicationDetailVO.setCreationDateTime(DateHelper.getSecondPreciseDate());
                      publicationDetailVO.setDescription("Access rights change publication");
                      publicationDetailVO.setEntityClass("org.infoglue.cms.entities.content.ContentVersion");
                      publicationDetailVO.setEntityId(contentVersionVO.getId());
                      publicationDetailVO.setName("" + contentVO.getName() + "/" + contentVersionVO.getId());
                      publicationDetailVO.setTypeId(PublicationDetailVO.PUBLISH);
                      publicationDetailVO.setCreator(this.getInfoGluePrincipal().getName());

                      publicationDetailVOList.add(publicationDetailVO);
View Full Code Here


        ContentVO createdContentVO = ContentControllerProxy.getController().acCreate(this.principal, parentContentId, contentTypeDefinitionId, repositoryId, contentVO);
 
      //Create initial content version also... in masterlanguage
      String versionValue = "<?xml version='1.0' encoding='UTF-8'?><article xmlns=\"x-schema:ArticleSchema.xml\"><attributes><Name><![CDATA[" + fileName + "]]></Name></attributes></article>";
 
        ContentVersionVO cvVO = new ContentVersionVO();
        cvVO.setVersionComment("Initial version");
        cvVO.setVersionModifier(this.principal.getName());
        cvVO.setVersionValue(versionValue);
 
        ContentVersionVO newContentVersion = ContentVersionController.getContentVersionController().create(contentVO.getId(), masterLanguageVO.getId(), cvVO, null);
 
      if(newContentVersion != null)
      {
        AssetKeyDefinition assetKeyDefinition = ContentTypeDefinitionController.getController().getDefinedAssetKey(this.contentTypeDefinitionVO, true, digitalAssetKey);
       
        keepOriginal = handleTransformations(newAsset, file, contentType, assetKeyDefinition, newContentVersion.getId());
          if(keepOriginal)
          {
            List<Integer> newContentVersionIdList = new ArrayList<Integer>();
            digitalAssetVO = DigitalAssetController.create(newAsset, is, newContentVersion.getId(), this.getInfoGluePrincipal(), newContentVersionIdList);
          }
      }
 
      if(CmsPropertyHandler.getEnableDiskAssets().equals("true"))
      {
View Full Code Here

    {
      Boolean hasContentVersionInState = null;

    try
    {
      ContentVersionVO cvo = ContentDeliveryController.getContentDeliveryController().getContentVersionVOInState(contentId, languageId, stateId, getDatabase(), deliveryContext, infoGluePrincipal);
      hasContentVersionInState = (cvo == null ? false : true);
    }
    catch(Exception e)
    {
      logger.warn("An error occurred trying to execute getHasContentVersionInState with " + contentId + ":" + languageId + ":" + stateId + ":" + e.getMessage());
View Full Code Here

   * Getter for the most recent contentVersion based on a contentVersionId
   */
 
  public ContentVersionVO getContentVersionById(Integer contentVersionId)
  {
    ContentVersionVO contentVersionVO = null;

    try
    {
        contentVersionVO = ContentVersionController.getContentVersionController().getSmallContentVersionVOWithId(contentVersionId, getDatabase());
    }
View Full Code Here

   * Getter for the most recent contentVersion on a content
   */
 
  public ContentVersionVO getContentVersion(Integer contentId)
  {
    ContentVersionVO contentVersionVO = null;

    try
    {
        contentVersionVO = ContentDeliveryController.getContentDeliveryController().getContentVersionVO(getDatabase(), this.siteNodeId, contentId, this.languageId, true, this.deliveryContext, this.infoGluePrincipal);
    }
View Full Code Here

   * Getter for the most recent contentVersion on a content
   */
 
  public ContentVersionVO getContentVersion(Integer contentId, Integer languageId, boolean useLanguageFallback)
  {
    ContentVersionVO contentVersionVO = null;

    try
    {
        contentVersionVO = ContentDeliveryController.getContentDeliveryController().getContentVersionVO(getDatabase(), this.siteNodeId, contentId, languageId, useLanguageFallback, this.deliveryContext, this.infoGluePrincipal);
    }
View Full Code Here

        try
        {
            ContentDeliveryController cdc = ContentDeliveryController.getContentDeliveryController();
            ContentTypeDefinitionController ctdc = ContentTypeDefinitionController.getController();

            ContentVersionVO contentVersionVO = cdc.getContentVersionVO(getDatabase(), this.siteNodeId, contentId,this.languageId, USE_LANGUAGE_FALLBACK, this.deliveryContext, this.infoGluePrincipal );
           
            Integer contentTypeDefinitionId = cdc.getContentVO(getDatabase(), contentId, deliveryContext ).getContentTypeDefinitionId();
         
            ContentTypeDefinitionVO contentTypeDefinitionVO = ctdc.getContentTypeDefinitionVOWithId( contentTypeDefinitionId, getDatabase());
            Iterator attrIterator = ctdc.getContentTypeAttributes(contentTypeDefinitionVO, true).iterator();
           
            String aText = text.replaceAll( "[^\\w]", "" );
            aText = aText.substring( 0, ( aText.length() < 8 ? aText.length() : 8 ) ).toLowerCase();
            StringBuffer uniqueId = new StringBuffer( aText );
            uniqueId.append( "_" + contentVersionVO.getId() );
            uniqueId.append( "_" + Math.abs( text.hashCode() ));
            uniqueId.append( "_" + Math.abs(contentVersionVO.getVersionValue().hashCode() ) );
            uniqueId.append( "_" + Math.abs(contentTypeDefinitionVO.getSchemaValue().hashCode() ) );
            uniqueId.append( "_" + ( renderAttributes != null ? Math.abs( renderAttributes.hashCode() ) : 4711 ) );

            AdvancedImageRenderer imageRenderer = new AdvancedImageRenderer();
            // set up the renderer
View Full Code Here

    // This one actually does something.
    String assetUrl = "";

    try
    {
      ContentVersionVO contentVersionVO = ContentDeliveryController.getContentDeliveryController().getContentVersionVO(getDatabase(), this.siteNodeId, contentId, this.languageId, USE_LANGUAGE_FALLBACK, this.deliveryContext, this.infoGluePrincipal);   
     
      String attribute = ContentDeliveryController.getContentDeliveryController().getContentAttribute(getDatabase(), contentVersionVO, attributeName, false);
     
      String uniqueId = contentVersionVO.getId() + "_" + attributeName + canvasWidth + canvasHeight + textStartPosX + textStartPosY + textWidth + textHeight + fontName.replaceAll(" ", "") + fontStyle + fontSize + foregroundColor.getRed() + foregroundColor.getGreen() + foregroundColor.getBlue() + backgroundColor.getRed() + backgroundColor.getGreen() + backgroundColor.getBlue();
     
      String fileName = uniqueId + ".png";
     
      int i = 0;
      String filePath = CmsPropertyHandler.getDigitalAssetPath0();
View Full Code Here

          Set contentVersions = SearchController.getContentVersions(contentTypeDefinitionId, principalName, publishStartDate, publishEndDate, unpublishStartDate, unpublishEndDate);
     
      List result = new ArrayList();
      for(Iterator i = contentVersions.iterator(); i.hasNext(); )
      {
        ContentVersionVO contentVersionVO = (ContentVersionVO)i.next();
        if(ContentDeliveryController.getContentDeliveryController().isValidContent(this.getDatabase(), contentVersionVO.getContentId(), this.languageId, USE_LANGUAGE_FALLBACK, true, getPrincipal(), this.deliveryContext))
          result.add(contentVersionVO);
      }

      return result;
    }
View Full Code Here

      Iterator languageIterator = availableLanguages.iterator();
      while(languageIterator.hasNext())
      {
        LanguageVO languageVO = (LanguageVO)languageIterator.next();
        ContentVO contentVO = this.nodeDeliveryController.getBoundContent(getDatabase(), this.getPrincipal(), siteNodeId, this.languageId, USE_LANGUAGE_FALLBACK, META_INFO_BINDING_NAME, this.deliveryContext);   
        ContentVersionVO contentVersionVO = null;
        if(contentVO != null)
        {
          contentVersionVO = ContentDeliveryController.getContentDeliveryController().getContentVersionVO(getDatabase(), siteNodeId, contentVO.getId(), languageVO.getId(), false, this.deliveryContext, this.infoGluePrincipal);
        }
       
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.content.ContentVersionVO

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.