/src/java/org/infoglue/deliver/controllers/kernel/impl/simple/ContentDeliveryController.java
Java | 3613 lines | 2299 code | 593 blank | 721 comment | 760 complexity | dc6f44cf19efa087332add80067292b0 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1, BSD-3-Clause, GPL-2.0
Large files files are truncated, but you can click here to view the full file
- /* ===============================================================================
- *
- * Part of the InfoGlue Content Management Platform (www.infoglue.org)
- *
- * ===============================================================================
- *
- * Copyright (C)
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License version 2, as published by the
- * Free Software Foundation. See the file LICENSE.html for more information.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
- * Place, Suite 330 / Boston, MA 02111-1307 / USA.
- *
- * ===============================================================================
- */
- package org.infoglue.deliver.controllers.kernel.impl.simple;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.ObjectOutputStream;
- import java.net.URLDecoder;
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.Date;
- import java.util.Enumeration;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Vector;
- import org.apache.log4j.Category;
- import org.apache.log4j.Level;
- import org.apache.log4j.Logger;
- import org.exolab.castor.jdo.Database;
- import org.exolab.castor.jdo.OQLQuery;
- import org.exolab.castor.jdo.QueryResults;
- import org.infoglue.cms.applications.common.VisualFormatter;
- import org.infoglue.cms.controllers.kernel.impl.simple.AccessRightController;
- import org.infoglue.cms.controllers.kernel.impl.simple.ContentCategoryController;
- import org.infoglue.cms.controllers.kernel.impl.simple.ContentController;
- import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController;
- import org.infoglue.cms.controllers.kernel.impl.simple.DigitalAssetController;
- import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryController;
- import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeController;
- import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy;
- import org.infoglue.cms.entities.content.Content;
- import org.infoglue.cms.entities.content.ContentCategory;
- import org.infoglue.cms.entities.content.ContentCategoryVO;
- import org.infoglue.cms.entities.content.ContentVO;
- import org.infoglue.cms.entities.content.ContentVersion;
- import org.infoglue.cms.entities.content.ContentVersionVO;
- import org.infoglue.cms.entities.content.DigitalAssetVO;
- import org.infoglue.cms.entities.content.SmallestContentVersion;
- import org.infoglue.cms.entities.content.SmallestContentVersionVO;
- import org.infoglue.cms.entities.content.impl.simple.ContentImpl;
- import org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl;
- import org.infoglue.cms.entities.content.impl.simple.MediumContentImpl;
- import org.infoglue.cms.entities.content.impl.simple.SmallContentImpl;
- import org.infoglue.cms.entities.content.impl.simple.SmallContentVersionImpl;
- import org.infoglue.cms.entities.content.impl.simple.SmallDigitalAssetImpl;
- import org.infoglue.cms.entities.management.ContentTypeDefinitionVO;
- import org.infoglue.cms.entities.management.LanguageVO;
- import org.infoglue.cms.entities.management.RepositoryVO;
- import org.infoglue.cms.entities.management.impl.simple.AccessRightGroupImpl;
- import org.infoglue.cms.entities.management.impl.simple.AccessRightImpl;
- import org.infoglue.cms.entities.management.impl.simple.AccessRightRoleImpl;
- import org.infoglue.cms.entities.management.impl.simple.AccessRightUserImpl;
- import org.infoglue.cms.entities.management.impl.simple.ContentTypeDefinitionImpl;
- import org.infoglue.cms.entities.structure.SiteNode;
- import org.infoglue.cms.entities.structure.SiteNodeVO;
- import org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeImpl;
- import org.infoglue.cms.exception.SystemException;
- import org.infoglue.cms.security.InfoGluePrincipal;
- import org.infoglue.cms.util.CmsPropertyHandler;
- import org.infoglue.deliver.applications.databeans.DeliveryContext;
- import org.infoglue.deliver.controllers.kernel.URLComposer;
- import org.infoglue.deliver.util.CacheController;
- import org.infoglue.deliver.util.NullObject;
- import org.infoglue.deliver.util.RequestAnalyser;
- import org.infoglue.deliver.util.Timer;
- public class ContentDeliveryController extends BaseDeliveryController
- {
- private final static Logger logger = Logger.getLogger(ContentDeliveryController.class.getName());
- private URLComposer urlComposer = null;
- private VisualFormatter formatter = new VisualFormatter();
-
- /**
- * Private constructor to enforce factory-use
- */
-
- private ContentDeliveryController()
- {
- urlComposer = URLComposer.getURLComposer();
- }
-
- /**
- * Factory method
- */
-
- public static ContentDeliveryController getContentDeliveryController()
- {
- return new ContentDeliveryController();
- }
-
- /**
- * This method returns which mode the delivery-engine is running in.
- * The mode is important to be able to show working, preview and published data separate.
- */
-
- private Integer getOperatingMode(DeliveryContext deliveryContext)
- {
- Integer operatingMode = new Integer(0); //Default is working
- try
- {
- operatingMode = new Integer(CmsPropertyHandler.getOperatingMode());
- if(!deliveryContext.getOperatingMode().equals(CmsPropertyHandler.getOperatingMode()))
- operatingMode = new Integer(deliveryContext.getOperatingMode());
- //logger.info("Operating mode is:" + operatingMode);
- }
- catch(Exception e)
- {
- logger.warn("We could not get the operating mode from the propertyFile:" + e.getMessage(), e);
- }
- return operatingMode;
- }
-
-
-
- /**
- * This method return a contentVO
- */
-
- public ContentVO getContentVO(Database db, Integer contentId, DeliveryContext deliveryContext) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
- if(deliveryContext != null)
- deliveryContext.addUsedContent(CacheController.getPooledString(1, contentId));
- String key = "" + contentId;
- ContentVO contentVO = (ContentVO)CacheController.getCachedObjectFromAdvancedCache("contentCache", key);
- if(contentVO != null)
- {
- //logger.info("There was an cached contentVO:" + contentVO);
- }
- else
- {
- contentVO = (ContentVO)getVOWithId(SmallContentImpl.class, contentId, db);
- if(contentVO != null)
- CacheController.cacheObjectInAdvancedCache("contentCache", key, contentVO, new String[]{CacheController.getPooledString(1, contentId)}, true);
- }
-
- return contentVO;
- }
-
- public ContentVO getContentWithPath(Integer repositoryId, String path, InfoGluePrincipal principal, Database db) throws SystemException, Exception
- {
- ContentVO content = getRootContentVO(repositoryId, db);
- logger.info("content:" + content);
- final String paths[] = path.split("/");
- if(path.equals(""))
- return content;
-
- for(int i=0; i<paths.length; ++i)
- {
- final String name = paths[i];
- final ContentVO childContent = getChildWithName(content.getId(), name, db);
- if(childContent != null)
- content = childContent;
- else if(childContent == null)
- throw new SystemException("There exists no content with the path [" + path + "].");
- }
- return content;
- }
-
- /**
- * This method returns the root contentVO for the specified repository.
- * If the repositoryName is null we fetch the name of the master repository.
- */
-
- public ContentVO getRootContentVO(Integer repositoryId, Database db) throws SystemException, Exception
- {
- ContentVO contentVO = null;
- String key = "" + repositoryId;
- logger.info("key in getRootContentVO:" + key);
- contentVO = (ContentVO)CacheController.getCachedObject("rootContentCache", key);
- if(contentVO != null)
- {
- logger.info("There was an cached master root contentVO:" + contentVO.getName());
- }
- else
- {
- logger.info("Fetching the root contentVO for the repository " + repositoryId);
- OQLQuery oql = db.getOQLQuery( "SELECT c FROM org.infoglue.cms.entities.content.impl.simple.ContentImpl c WHERE is_undefined(c.parentContent) AND c.repository = $1");
- oql.bind(repositoryId);
-
- QueryResults results = oql.execute(Database.ReadOnly);
-
- if (results.hasMore())
- {
- contentVO = ((Content)results.next()).getValueObject();
- logger.info("The root contentVO was found:" + contentVO.getName());
- }
- results.close();
- oql.close();
- logger.info("contentVO:" + contentVO);
- CacheController.cacheObject("rootContentCache", key, contentVO);
- }
- return contentVO;
- }
- /**
- *
- */
- private ContentVO getChildWithName(Integer parentContentId, String name, Database db) throws Exception
- {
- String key = "childContents" + parentContentId + "_" + name;
- ContentVO contentVO = (ContentVO)CacheController.getCachedObjectFromAdvancedCache("contentCache", key);
- if(contentVO != null)
- {
- //logger.info("There was an cached contentVO:" + contentVO);
- }
- else
- {
- OQLQuery oql = db.getOQLQuery("SELECT c FROM org.infoglue.cms.entities.content.impl.simple.SmallContentImpl c WHERE c.parentContentId = $1 AND c.name = $2");
- oql.bind(parentContentId);
- oql.bind(name);
-
- QueryResults results = oql.execute(Database.ReadOnly);
-
- if(results.hasMore())
- {
- contentVO = ((Content)results.next()).getValueObject();
- }
- results.close();
- oql.close();
- if(contentVO != null)
- CacheController.cacheObjectInAdvancedCache("contentCache", key, contentVO, new String[]{CacheController.getPooledString(1, contentVO.getId()),CacheController.getPooledString(1, parentContentId)}, true);
- }
- return contentVO;
- }
- /**
- * This method returns that contentVersionVO which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- public ContentVersionVO getContentVersionVO(Database db, Integer siteNodeId, Integer contentId, Integer languageId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- ContentVersionVO contentVersionVO = null;
- SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId, db);
- String contentVersionKey = "contentVersionVO_" + siteNodeVO.getRepositoryId() + "_" + contentId + "_" + languageId + "_" + useLanguageFallback;
- contentVersionVO = (ContentVersionVO)CacheController.getCachedObjectFromAdvancedCache("contentVersionCache", contentVersionKey);
-
- if(contentVersionVO != null)
- {
- //logger.info("There was an cached contentVersionVO:" + contentVersionVO.getContentVersionId());
- }
- else
- {
- contentVersionVO = this.getContentVersionVO(siteNodeId, contentId, languageId, db, useLanguageFallback, deliveryContext, infoGluePrincipal);
- if(contentVersionVO != null)
- {
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", contentVersionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
-
- }
-
- if(contentVersionVO != null && deliveryContext != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersionVO.getId()));
-
- return contentVersionVO;
- }
-
- /**
- * This method returns that contentVersionVO which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- public SmallestContentVersionVO getSmallestContentVersionVO(Database db, Integer siteNodeId, Integer contentId, Integer languageId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- SmallestContentVersionVO contentVersionVO = null;
-
- SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId, db);
- String contentVersionKey = "smallestContentVersionVO_" + siteNodeVO.getRepositoryId() + "_" + contentId + "_" + languageId + "_" + useLanguageFallback;
- if(logger.isInfoEnabled())
- logger.info("contentVersionKey:" + contentVersionKey);
-
- contentVersionVO = (SmallestContentVersionVO)CacheController.getCachedObjectFromAdvancedCache("contentVersionCache", contentVersionKey);
-
- if(contentVersionVO != null)
- {
- //logger.info("There was an cached contentVersionVO:" + contentVersionVO.getContentVersionId());
- }
- else
- {
- contentVersionVO = this.getSmallestContentVersionVO(siteNodeId, contentId, languageId, db, useLanguageFallback, deliveryContext, infoGluePrincipal);
- if(contentVersionVO != null)
- {
- //contentVersionVO = contentVersion.getValueObject();
-
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", contentVersionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
- }
-
- if(contentVersionVO != null && deliveryContext != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersionVO.getId()));
-
- return contentVersionVO;
- }
-
- /**
- * This method returns that contentVersion which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
- private ContentVersion getContentVersion(Integer siteNodeId, Integer contentId, Integer languageId, Database db, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
-
- ContentVersion contentVersion = null;
-
- //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
- ContentVO content = ContentController.getContentController().getSmallContentVOWithId(contentId, db, deliveryContext);
-
- boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, useLanguageFallback, false, db, deliveryContext);
- if(isValidContent)
- {
- contentVersion = getContentVersion(content, languageId, getOperatingMode(deliveryContext), deliveryContext, db);
- if(contentVersion == null && useLanguageFallback)
- {
- Integer masterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId).getLanguageId();
- if(languageId != null && !languageId.equals(masterLanguageId))
- {
- contentVersion = getContentVersion(content, masterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
-
- //Added fallback to the content repository master language... useful for mixing components between sites
- if(languageId != null && contentVersion == null && useLanguageFallback)
- {
- Integer contentMasterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForRepository(db, content.getRepositoryId()).getLanguageId();
- if(languageId != null && !languageId.equals(contentMasterLanguageId) && !masterLanguageId.equals(contentMasterLanguageId))
- {
- contentVersion = getContentVersion(content, contentMasterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
- }
- }
-
- }
-
- return contentVersion;
- }
-
-
- /**
- * This method returns that contentVersion which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- private SmallestContentVersionVO getSmallestContentVersionVO(Integer siteNodeId, Integer contentId, Integer languageId, Database db, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
-
- SmallestContentVersionVO contentVersion = null;
-
- //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
- ContentVO content = getContentVO(db, contentId, deliveryContext); //ContentController.getContentController().getSmallContentVOWithId(contentId, db);
-
- boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, useLanguageFallback, false, db, deliveryContext);
- if(isValidContent)
- {
- contentVersion = getSmallestContentVersionVO(contentId, languageId, getOperatingMode(deliveryContext), deliveryContext, db);
- if(contentVersion == null && useLanguageFallback)
- {
- Integer masterLanguageId = null;
- if(siteNodeId != null)
- masterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId).getLanguageId();
- else
- masterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForRepository(db, content.getRepositoryId()).getLanguageId();
-
- if(languageId == null || (languageId != null && !languageId.equals(masterLanguageId)))
- {
- contentVersion = getSmallestContentVersionVO(contentId, masterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
-
- //Added fallback to the content repository master language... useful for mixing components between sites
- if(languageId != null && contentVersion == null && useLanguageFallback)
- {
- Integer contentMasterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForRepository(db, content.getRepositoryId()).getLanguageId();
- if(languageId != null && !languageId.equals(contentMasterLanguageId) && !masterLanguageId.equals(contentMasterLanguageId))
- {
- contentVersion = getSmallestContentVersionVO(contentId, contentMasterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
- }
- }
-
- }
-
- return contentVersion;
- }
-
- /**
- * This method returns that contentVersion which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- private ContentVersionVO getContentVersionVO(Integer siteNodeId, Integer contentId, Integer languageId, Database db, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
-
- Timer t = new Timer();
-
- ContentVersionVO contentVersion = null;
-
- //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
- ContentVO content = getContentVO(db, contentId, deliveryContext);
- boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, useLanguageFallback, false, db, deliveryContext);
- //deliveryContext.addDebugInformation("isValidContent:" + isValidContent);
- if(isValidContent)
- {
- contentVersion = getContentVersionVO(contentId, languageId, getOperatingMode(deliveryContext), deliveryContext, db);
- //deliveryContext.addDebugInformation("contentVersion:" + contentVersion);
- if(contentVersion == null && useLanguageFallback)
- {
- Integer masterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId).getLanguageId();
- //deliveryContext.addDebugInformation("masterLanguageId:" + masterLanguageId);
- if(languageId != null && !languageId.equals(masterLanguageId))
- {
- contentVersion = getContentVersionVO(contentId, masterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
-
- //Added fallback to the content repository master language... useful for mixing components between sites
- if(languageId != null && contentVersion == null && useLanguageFallback)
- {
- Integer contentMasterLanguageId = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForRepository(db, content.getRepositoryId()).getLanguageId();
- //deliveryContext.addDebugInformation("contentMasterLanguageId:" + contentMasterLanguageId);
- if(languageId != null && !languageId.equals(contentMasterLanguageId) && !masterLanguageId.equals(contentMasterLanguageId))
- {
- contentVersion = getContentVersionVO(contentId, contentMasterLanguageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
- }
- }
- }
-
- RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getContentVersionVO in delivery took (micro)", t.getElapsedTimeNanos() / 1000);
- /*
- if(content.getContentTypeDefinitionId().intValue() == 2 || content.getContentTypeDefinitionId().intValue() == 100000)
- {
- logger.error("Investigate...");
- Thread.dumpStack();
- }
- */
-
- return contentVersion;
- }
- /**
- * This method returns that contentVersion which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- public ContentVersionVO getContentVersionVOInState(Integer contentId, Integer languageId, Integer stateId, Database db, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
-
- ContentVersionVO contentVersion = null;
-
- //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
- ContentVO content = ContentController.getContentController().getSmallContentVOWithId(contentId, db, deliveryContext);
- boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, false, false, db, deliveryContext);
- if(isValidContent)
- {
- contentVersion = getContentVersionVO(contentId, languageId, stateId, deliveryContext, db);
- }
-
- return contentVersion;
- }
- /**
- * This method returns that contentVersion which matches the parameters sent in and which
- * also has the correct state for this delivery-instance.
- */
-
- public List getContentVersionVOList(Database db, Integer siteNodeId, Integer contentId, Integer languageId, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return null;
-
- List contentVersionVOList = new ArrayList();
-
- boolean useLanguageFallback = false;
- if(languageId == null)
- useLanguageFallback = true;
-
- //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
- ContentVO content = ContentController.getContentController().getSmallContentVOWithId(contentId, db, deliveryContext);
-
- boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, useLanguageFallback, false, db, deliveryContext);
- if(isValidContent)
- {
- contentVersionVOList = getContentVersionVOList(content, languageId, getOperatingMode(deliveryContext), deliveryContext, db);
- }
-
- return contentVersionVOList;
- }
- /**
- * This method gets a contentVersion with a state and a language which is active.
- */
- private ContentVersion getContentVersion(ContentVO content, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
- {
- ContentVersion contentVersion = null;
-
- String versionKey = "" + content.getId() + "_" + languageId + "_" + operatingMode + "_contentVersionId";
- //logger.info("versionKey:" + versionKey);
-
- Object object = CacheController.getCachedObjectFromAdvancedCache("contentVersionIdCache", versionKey);
- if(object instanceof NullObject)
- {
- logger.info("There was an cached parentSiteNodeVO but it was null:" + object);
- }
- else if(object != null)
- {
- Integer contentVersionId = (Integer)object;
- contentVersion = (ContentVersion)getObjectWithId(ContentVersionImpl.class, contentVersionId, db);
- //logger.info("Loaded the version from cache instead of querying it:" + contentVersionId);
- }
- else
- {
- //logger.info("Querying for verson: " + versionKey);
-
- OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.language.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
- oql.bind(content.getId());
- oql.bind(languageId);
- oql.bind(operatingMode);
- oql.bind(true);
-
- QueryResults results = oql.execute(Database.ReadOnly);
- if (results.hasMore())
- {
- contentVersion = (ContentVersion)results.next();
- CacheController.cacheObjectInAdvancedCache("contentVersionIdCache", versionKey, contentVersion.getId(), new String[]{CacheController.getPooledString(2, contentVersion.getId()), CacheController.getPooledString(1, contentVersion.getValueObject().getContentId())}, true);
- }
- else
- {
- CacheController.cacheObjectInAdvancedCache("contentVersionIdCache", versionKey, new NullObject(), new String[]{CacheController.getPooledString(1, content.getId())}, true);
- }
- results.close();
- oql.close();
- }
-
- if(contentVersion != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));
- return contentVersion;
- }
- /**
- * This method gets a contentVersion with a state and a language which is active.
- */
- private ContentVersionVO getContentVersionVO(Integer contentId, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
- {
- ContentVersionVO contentVersionVO = null;
-
- String versionKey = "" + contentId + "_" + languageId + "_" + operatingMode + "_contentVersionVO";
-
- Object object = CacheController.getCachedObjectFromAdvancedCache("contentVersionCache", versionKey);
- if(object instanceof NullObject)
- {
- logger.info("There was an cached contentVersionVO but it was null:" + object);
- }
- else if(object != null)
- {
- if(object instanceof SmallestContentVersionVO)
- {
- logger.warn("Object was instanceof SmallestContentVersionVO for key:" + versionKey);
- contentVersionVO = (ContentVersionVO)getVOWithId(SmallContentVersionImpl.class, ((SmallestContentVersionVO)object).getId(), db);
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
- else
- {
- contentVersionVO = (ContentVersionVO)object;
- }
- }
- else
- {
- Timer t = new Timer();
- String smallVersionKey = "" + contentId + "_" + languageId + "_" + operatingMode + "_smallestContentVersionVO";
- Object smallestContentVersionVOCandidate = CacheController.getCachedObjectFromAdvancedCache("contentVersionCache", smallVersionKey);
- if(smallestContentVersionVOCandidate instanceof NullObject)
- {
- //logger.info("There was an cached content version but it was null:" + smallestContentVersionVOCandidate);
- }
- else if(smallestContentVersionVOCandidate != null)
- {
- if(smallestContentVersionVOCandidate instanceof SmallestContentVersionVO)
- {
- contentVersionVO = (ContentVersionVO)getVOWithId(SmallContentVersionImpl.class, ((SmallestContentVersionVO)smallestContentVersionVOCandidate).getId(), db);
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- RequestAnalyser.getRequestAnalyser().registerComponentStatistics("Getting SmallContentVersionImpl", t.getElapsedTime());
- }
- else
- {
- logger.warn("Object was instanceof ContentVersionVO for key:" + versionKey);
- contentVersionVO = (ContentVersionVO)smallestContentVersionVOCandidate;
- }
-
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
- else
- {
- //logger.info("Querying for verson: " + versionKey);
- OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.SmallContentVersionImpl cv WHERE cv.contentId = $1 AND cv.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
- oql.bind(contentId);
- oql.bind(languageId);
- oql.bind(operatingMode);
- oql.bind(true);
-
- QueryResults results = oql.execute(Database.ReadOnly);
-
- if (results.hasMore())
- {
- ContentVersion contentVersion = (ContentVersion)results.next();
- contentVersionVO = contentVersion.getValueObject();
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
- else
- {
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, new NullObject(), new String[]{CacheController.getPooledString(1, contentId)}, true);
- }
- results.close();
- oql.close();
- }
-
- if(logger.isInfoEnabled())
- RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getContentVersionVO(Integer contentId, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db)", t.getElapsedTimeNanos() / 1000);
- }
-
- if(contentVersionVO != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersionVO.getId()));
-
- return contentVersionVO;
- }
- /**
- * This method gets a contentVersion with a state and a language which is active.
- */
- private SmallestContentVersionVO getSmallestContentVersionVO(Integer contentId, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
- {
- //Timer t = new Timer();
- SmallestContentVersionVO contentVersionVO = null;
-
- String versionKey = "" + contentId + "_" + languageId + "_" + operatingMode + "_smallestContentVersionVO";
- //String versionVOKey = "" + contentId + "_" + languageId + "_" + operatingMode + "_contentVersionVO";
-
- Object object = CacheController.getCachedObjectFromAdvancedCache("contentVersionCache", versionKey);
- if(object instanceof NullObject)
- {
- logger.info("There was an cached SmallestContentVersionVO but it was null:" + object);
- }
- else if(object != null)
- {
- contentVersionVO = (SmallestContentVersionVO)object;
- }
- else
- {
- //logger.info("Querying for verson: " + versionKey);
- OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.SmallestContentVersionImpl cv WHERE cv.contentId = $1 AND cv.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
- oql.bind(contentId);
- oql.bind(languageId);
- oql.bind(operatingMode);
- oql.bind(true);
-
- QueryResults results = oql.execute(Database.ReadOnly);
- if (results.hasMore())
- {
- SmallestContentVersion contentVersion = (SmallestContentVersion)results.next();
- contentVersionVO = contentVersion.getValueObject();
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
- }
- else
- {
- CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, new NullObject(), new String[]{CacheController.getPooledString(1, contentId)}, true);
- }
- results.close();
- oql.close();
- }
- if(contentVersionVO != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersionVO.getId()));
- return contentVersionVO;
- }
- private List getContentVersionVOList(Content content, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
- {
- List contentVersionVOList = new ArrayList();
-
- OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.language.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
- if(languageId == null)
- oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.stateId >= $2 AND cv.isActive = $3 ORDER BY cv.contentVersionId desc");
-
- oql.bind(content.getId());
-
- if(languageId != null)
- oql.bind(languageId);
-
- oql.bind(operatingMode);
- oql.bind(true);
- QueryResults results = oql.execute(Database.ReadOnly);
-
- ContentVersion contentVersion;
-
- while(results.hasMore())
- {
- contentVersion = (ContentVersion)results.next();
- if(contentVersion != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));
- contentVersionVOList.add(contentVersion.getValueObject());
- }
- results.close();
- oql.close();
-
- return contentVersionVOList;
- }
-
- private List getContentVersionVOList(ContentVO content, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
- {
- List contentVersionVOList = new ArrayList();
-
- OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.language.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
- if(languageId == null)
- oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.stateId >= $2 AND cv.isActive = $3 ORDER BY cv.contentVersionId desc");
-
- oql.bind(content.getId());
-
- if(languageId != null)
- oql.bind(languageId);
-
- oql.bind(operatingMode);
- oql.bind(true);
- QueryResults results = oql.execute(Database.ReadOnly);
-
- ContentVersion contentVersion;
-
- while(results.hasMore())
- {
- contentVersion = (ContentVersion)results.next();
- if(contentVersion != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));
- contentVersionVOList.add(contentVersion.getValueObject());
- }
- results.close();
- oql.close();
-
- return contentVersionVOList;
- }
-
-
- /**
- * This is the most common way of getting attributes from a content.
- * It selects the correct contentVersion depending on the language and then gets the attribute in the xml associated.
- */
- public String getContentAttribute(Database db, Integer contentId, Integer languageId, String attributeName, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infogluePrincipal, boolean escapeHTML) throws SystemException, Exception
- {
- return getContentAttribute(db, contentId, languageId, attributeName, siteNodeId, useLanguageFallback, deliveryContext, infogluePrincipal, escapeHTML, false, null);
- }
- /**
- * This is the most common way of getting attributes from a content.
- * It selects the correct contentVersion depending on the language and then gets the attribute in the xml associated.
- */
- public String getContentAttribute(Database db, Integer contentId, Integer languageId, String attributeName, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infogluePrincipal, boolean escapeHTML, boolean isMetaInfoQuery) throws SystemException, Exception
- {
- return getContentAttribute(db, contentId, languageId, attributeName, siteNodeId, useLanguageFallback, deliveryContext, infogluePrincipal, escapeHTML, isMetaInfoQuery, null);
- }
- /**
- * This is the most common way of getting attributes from a content.
- * It selects the correct contentVersion depending on the language and then gets the attribute in the xml associated.
- */
- public String getContentAttribute(Database db, Integer contentId, Integer languageId, String attributeName, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infogluePrincipal, boolean escapeHTML, Set usedContentVersionId) throws SystemException, Exception
- {
- return getContentAttribute(db, contentId, languageId, attributeName, siteNodeId, useLanguageFallback, deliveryContext, infogluePrincipal, escapeHTML, false, usedContentVersionId);
- }
-
- /**
- * This method return true if the user logged in has access to the content sent in.
- */
- /*
- public boolean getHasUserContentAccess(Database db, InfoGluePrincipal infoGluePrincipal, Integer contentId)
- {
- boolean hasUserContentAccess = true;
-
- try
- {
- if(contentId != null)
- {
- logger.info("IsProtected:" + protectedContentId);
- if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Read", protectedContentId.toString()))
- {
- hasUserContentAccess = false;
- }
- }
- }
- catch(Exception e)
- {
- logger.warn("An error occurred trying to get determine if content:" + contentId + " has a localized version:" + e.getMessage());
- }
-
- return hasUserContentAccess;
- }
- */
- public boolean getHasUserContentAccess(Database db, InfoGluePrincipal infoGluePrincipal, Integer contentId)
- {
- String key = "" + infoGluePrincipal.getName() + "_" + contentId + "_HasUserContentAccess";
- logger.info("key:" + key);
- Boolean hasUserContentAccess = (Boolean)CacheController.getCachedObjectFromAdvancedCache("personalAuthorizationCache", key);
- if(hasUserContentAccess != null)
- {
- //logger.info("Cached");
- return hasUserContentAccess.booleanValue();
- }
- else
- {
- hasUserContentAccess = true;
- //logger.info("----- not Cached");
- try
- {
- if(contentId != null)
- {
-
- Integer protectedContentId = ContentDeliveryController.getContentDeliveryController().getProtectedContentId(db, getContentVO(db, contentId, null));
- //Integer protectedContentId = ContentDeliveryController.getContentDeliveryController().getProtectedContentId(db, contentId);
- logger.info("IsProtected:" + protectedContentId);
- if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Content.Read", protectedContentId.toString()))
- {
- hasUserContentAccess = false;
- }
- }
- }
- catch(Exception e)
- {
- logger.warn("An error occurred trying to get determine if user was allowed read access to:" + contentId + ":" + e.getMessage());
- }
- CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(hasUserContentAccess));
- }
-
- return hasUserContentAccess;
- }
- /**
- * This is the most common way of getting attributes from a content.
- * It selects the correct contentVersion depending on the language and then gets the attribute in the xml associated.
- */
- public String getContentAttribute(Database db, Integer contentId, Integer languageId, String attributeName, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infogluePrincipal, boolean escapeHTML, boolean isMetaInfoQuery, Set usedContentVersionId) throws SystemException, Exception
- {
- if(contentId == null || contentId.intValue() < 1)
- return "";
-
- boolean isTemplateQuery = false;
- if(attributeName.equalsIgnoreCase("Template") || attributeName.equalsIgnoreCase("PreTemplate") || attributeName.equalsIgnoreCase("ComponentLabels"))
- isTemplateQuery = true;
- if(attributeName.equalsIgnoreCase("ComponentStructure"))
- isMetaInfoQuery = true;
- deliveryContext.addDebugInformation("getContentAttribute with params:");
- deliveryContext.addDebugInformation(" contentId: " + contentId);
- deliveryContext.addDebugInformation(" languageId: " + languageId);
- deliveryContext.addDebugInformation(" attributeName: " + attributeName);
- deliveryContext.addDebugInformation(" siteNodeId: " + siteNodeId);
- deliveryContext.addDebugInformation(" useLanguageFallback: " + useLanguageFallback);
- deliveryContext.addDebugInformation(" infogluePrincipal: " + infogluePrincipal);
-
- //logger.info("usedContentVersionId:" + usedContentVersionId);
- //String enforceRigidContentAccess = CmsPropertyHandler.getEnforceRigidContentAccess();
- //if(enforceRigidContentAccess != null && enforceRigidContentAccess.equalsIgnoreCase("true") && !isMetaInfoQuery)
- //Added this check as mandatory - otherwise we could have situations where values got caches for users not authorized to see them or cached empty.
- if(!isMetaInfoQuery && !isTemplateQuery)
- {
- //logger.info("Enforcing getHasUserContentAccess for attributeName:" + contentId + ":" + languageId + ":" + attributeName);
- boolean hasUserContentAccess = getHasUserContentAccess(db, infogluePrincipal, contentId);
-
- deliveryContext.addDebugInformation("hasUserContentAccess: " + hasUserContentAccess);
- if(!hasUserContentAccess)
- {
- return "";
- }
- }
-
- StringBuilder attributeKeySB = new StringBuilder();
- StringBuilder versionKeySB = new StringBuilder();
-
- if(!isMetaInfoQuery && !isTemplateQuery)
- attributeKeySB.append("")
- .append(contentId).append("_")
- .append(languageId).append("_")
- .append(attributeName).append("_")
- .append(siteNodeId).append("_")
- .append(useLanguageFallback).append("_")
- .append(escapeHTML);
- else
- attributeKeySB.append("")
- .append(contentId).append("_")
- .append(languageId).append("_")
- .append(attributeName).append("_")
- .append(useLanguageFallback).append("_")
- .append(escapeHTML);
- if(!isMetaInfoQuery && !isTemplateQuery)
- versionKeySB.append("")
- .append(contentId).append("_")
- .append(languageId).append("_")
- .append(siteNodeId).append("_");
- else
- versionKeySB.append("")
- .append(contentId).append("_")
- .append(languageId).append("_");
- String attributeKey = attributeKeySB.toString();
- String versionKey = versionKeySB.append("_contentVersionId").toString();
- deliveryContext.addDebugInformation("attributeKey: " + attributeKey);
- String matcher = "";
- String cacheName = "contentAttributeCache" + matcher;
- String contentVersionIdCacheName = "contentVersionIdCache" + matcher;
-
- String attribute = (String)CacheController.getCachedObjectFromAdvancedCache(cacheName, attributeKey);
- if(attribute != null)
- deliveryContext.addDebugInformation("cachedAttribute: " + attribute.length());
- else
- deliveryContext.addDebugInformation("cachedAttribute: null");
-
- Integer contentVersionId = null;
-
- try
- {
- if(attribute != null)
- {
- contentVersionId = (Integer)CacheController.getCachedObjectFromAdvancedCache(contentVersionIdCacheName, versionKey);
- //logger.info("There was an cached content attribute:" + attribute);
- }
- else
- {
- ContentVersionVO contentVersionVO = getContentVersionVO(db, siteNodeId, contentId, languageId, useLanguageFallback, deliveryContext, infogluePrincipal);
- deliveryContext.addDebugInformation("contentVersionVO:" + contentVersionVO);
- if(contentVersionVO != null)
- {
- deliveryContext.addDebugInformation("contentVersionVO.versionValue:" + contentVersionVO.getVersionValue().length());
- attribute = getAttributeValue(db, contentVersionVO, attributeName, escapeHTML);
- contentVersionId = contentVersionVO.getId();
- }
- else
- {
- attribute = "";
- }
-
- String groupKey1 = CacheController.getPooledString(2, contentVersionId);
- String groupKey2 = CacheController.getPooledString(1, contentId);
-
- CacheController.cacheObjectInAdvancedCache(cacheName, attributeKey, attribute, new String[]{groupKey1, groupKey2}, true);
- if(contentVersionId != null)
- {
- CacheController.cacheObjectInAdvancedCache(contentVersionIdCacheName, versionKey, contentVersionId, new String[]{groupKey1, groupKey2}, true);
- }
- }
- if(deliveryContext != null)
- {
- if(contentVersionId != null)
- deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersionId));
- if(isMetaInfoQuery && contentVersionId != null)
- deliveryContext.getUsedPageMetaInfoContentVersionIdSet().add(contentVersionId);
- if(attributeName.equals("ComponentStructure") && contentVersionId != null)
- deliveryContext.getUsedPageComponentsMetaInfoContentVersionIdSet().add(contentVersionId);
-
- //We don't want to add meta info relations without more data
- if(!attributeName.equals("ComponentStructure"))
- {
- deliveryContext.addUsedContent(CacheController.getPooledString(1, contentId) + "_" + attributeName);
- }
- }
-
- if(usedContentVersionId != null && contentVersionId != null)
- usedContentVersionId.add(contentVersionId);
- }
- catch(Exception e)
- {
- throw e;
- }
-
- return (attribute == null) ? "" : attribute;
- }
- /**
- * This is the most common way of getting attributes from a content.
- * It selects the correct contentVersion depending on the language and then gets the attribute in the xml associated.
- */
- public String getContentAttribute(Database db, ContentVersionVO contentVersionVO, String attributeName, boolean escapeHTML) throws SystemException, Exception
- {
- String attribute = getAttributeValue(db, contentVersionVO, attributeName, escapeHTML);
-
- return attribute;
- }
- /**
- * Find all ContentVersionVOs that are related to the provided Category.
- *
- * TODO: Right now this method depends on the ContentVersion having an owningContent
- * TODO: This is potentially bad from a performance standpoint app-wide, so a workaround may
- * TODO: be to look up each Content for the ContentVersions after we have done everything we
- * TODO: can to wed down the list alot, so the overhead will not be too much.
- *
- * @param categoryId The Category to search on
- * @param attributeName The attribute of the Category relationship
- * @param infoGluePrincipal The user making the request
- * @param siteNodeId The SiteNode that the request is coming from
- * @param languageId The Language of the request
- * @param useLanguageFallback True is the search is to use the fallback (default) language for the Repository
- * @return A List of ContentVersionVOs matching the Category search, that are considered valid
- * @throws SystemException
- */
- public List findContentVersionVOsForCategory(Database db, Integer categoryId, String attributeName, InfoGluePrincipal infoGluePrincipal, Integer siteNodeId, Integer languageId, boolean useLanguageFallback, DeliveryContext deliveryContext) throws SystemException, Exception
- {
- deliveryContext.addUsedContent("selectiveCacheUpdateNonApplicable");
-
- List results = findContentCategories(db, categoryId, attributeName);
- List versions = findContentVersionsForCategories(results, db);
- // Weed out irrelevant versions
- for (Iterator iter = versions.iterator(); iter.hasNext();)
- {
- ContentVersion version = (ContentVersion) iter.next();
- if(!isValidContentVersion(version, infoGluePrincipal, siteNodeId, languageId, useLanguageFallback, db, deliveryContext))
- iter.remove();
- }
- return toVOList(versions);
- }
- public List getAssignedCategoryVOsForContentVersionId(Database db, Integer contentId, Integer languageId, String categoryKey, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws Exception
- {
- List assignedCategoryVOList = new ArrayList();
-
- ContentVersion contentVersion = getContentVersion(siteNodeId, contentId, languageId, db, useLanguageFallback, deliveryContext, infoGluePrincipal);
-
- List assignedContentCategories = ContentCategoryController.getController().findByContentVersionAttribute(categoryKey, contentVersion, db);
- //List assignedContentCategories = findContentCategoriesForContentVersionId(db, contentVersionVO.getId(), categoryKey, deliveryContext);
- if((assignedCategoryVOList == null || assignedCategoryVOList.size() == 0) && useLanguageFallback)
- {
- LanguageVO masterLanguageVO = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId);
- contentVersion = getContentVersion(siteNodeId, contentId, masterLanguageVO.getLanguageId(), db, useLanguageFallback, deliveryContext, infoGluePrincipal);
- //assignedContentCategories = findContentCategoriesForContentVersionId(db, contentVersionVO.getId(), categoryKey, deliveryContext);
- assignedContentCategories = ContentCategoryController.getController().findByContentVersionAttribute(categoryKey, contentVersion, db);
- }
-
- Iterator assignedContentCategoriesIterator = assignedContentCategories.iterator();
- while(assignedContentCategoriesIterator.hasNext())
- {
- ContentCategory contentCategory = (ContentCategory)assignedContentCategoriesIterator.next();
- assignedCategoryVOList.add(contentCategory.getCategory().getValueObject());
- }
-
- return assignedCategoryVOList;
- }
-
-
- /**
- * Find all CategoryVOs that are related to the provided content version on a specific category key.
- *
- * @param contentVersionId The content version id to search on
- * @param categoryKey The attribute of the Category relationship
- * @param infoGluePrincipal The user making the request
- * @param siteNodeId The SiteNode that the request is coming from
- * @param languageId The Language of the request
- * @param u…
Large files files are truncated, but you can click here to view the full file