Package org.apache.ofbiz.content.content
Class ContentWorker
java.lang.Object
org.apache.ofbiz.content.content.ContentWorker
- All Implemented Interfaces:
ContentWorkerInterface
ContentWorker Class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
booleanDataType
(Object boolObj) buildPickContext
(Delegator delegator, String contentAssocTypeId, String assocContentId, String direction, GenericValue thisContent) static String
callContentPermissionCheck
(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) callContentPermissionCheck Formats data for a call to the checkContentPermission service.callContentPermissionCheckResult
(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) static void
checkConditions
(Delegator delegator, Map<String, Object> trailNode, Map<String, Object> contentAssoc, Map<String, Object> whenMap) static boolean
Returns a boolean, result of whenStr evaluation with context.static List<GenericValue>
csvToContentList
(String csv, Delegator delegator) csvToTrail
(String csv, Delegator delegator) static String
determineMimeType
(Delegator delegator, GenericValue view, GenericValue parentContent, String contentId, String dataResourceId, String parentContentId) static GenericValue
findAlternateLocaleContent
(Delegator delegator, GenericValue view, Locale locale) static GenericValue
findContentForRendering
(Delegator delegator, String contentId, Locale locale, String partyId, String roleTypeId, boolean cache) static List<GenericValue>
getAssociatedContent
(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) static List<GenericValue>
getAssociatedContentView
(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) static List<GenericValue>
getAssociations
(GenericValue currentContent, String linkDir, List<String> assocTypes, String strFromDate, String strThruDate) static void
getContentAncestry
(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) static void
getContentAncestryAll
(Delegator delegator, String contentId, String passedContentTypeId, String direction, List<String> contentAncestorList) getContentAncestryNodeTrail
(Delegator delegator, String contentId, String contentAssocTypeId, String direction) static String
getContentAncestryNodeTrailCsv
(Delegator delegator, String contentId, String contentAssocTypeId, String direction) static void
getContentAncestryValues
(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) static List<GenericValue>
getContentAssocsWithId
(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) static GenericValue
getContentAssocViewFrom
(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) static List<GenericValue>
getContentAssocViewList
(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) static GenericValue
getContentCache
(Delegator delegator, String contentId) static GenericValue
static void
getContentTypeAncestry
(Delegator delegator, String contentTypeId, List<String> contentTypes) static GenericValue
getCurrentContent
(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, Object> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) getCurrentContentExt
(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, Object> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) static String
getMimeTypeId
(Delegator delegator, GenericValue view, Map<String, Object> ctx) getMimeTypeIdExt
(Delegator delegator, GenericValue view, Map<String, Object> ctx) getPurposes
(GenericValue content) getSections
(GenericValue content) static GenericValue
getSubContent
(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate) static GenericValue
getSubContentCache
(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) static GenericValue
getSubContentCache
(Delegator delegator, String contentId, String mapKey, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) getTopics
(GenericValue content) getWebSitePublishPointExt
(Delegator delegator, String contentId, boolean ignoreCache) static StringBuilder
logList
(StringBuilder s, String lbl, List<Object> lst, StringBuilder indent) static String
static StringBuilder
logMap
(StringBuilder s, String lbl, Map<String, Object> map, StringBuilder indent) static String
makeNode
(GenericValue thisContent) static String
nodeTrailToCsv
(List<Map<String, ? extends Object>> nodeTrail) prepContentPurposeList
(Map<String, Object> context) Checks to see if there is a purpose string (delimited by pipes) and turns it into a list and concants to any existing purpose list.static String
prepPermissionErrorMsg
(Map<String, Object> permResults) prepTargetOperationList
(Map<String, ? extends Object> context, String md) static GenericValue
static void
renderContentAsText
(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache) static String
renderContentAsText
(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache, List<GenericValue> webAnalytics) static String
renderContentAsText
(LocalDispatcher dispatcher, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) static void
renderContentAsText
(LocalDispatcher dispatcher, GenericValue content, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache, List<GenericValue> webAnalytics) void
renderContentAsTextExt
(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) renderContentAsTextExt
(LocalDispatcher dispatcher, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) static void
renderSubContentAsText
(LocalDispatcher dispatcher, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) static String
renderSubContentAsText
(LocalDispatcher dispatcher, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) void
renderSubContentAsTextExt
(LocalDispatcher dispatcher, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) renderSubContentAsTextExt
(LocalDispatcher dispatcher, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) static void
static void
static void
traverse
(Delegator delegator, GenericValue content, Timestamp fromDate, Timestamp thruDate, Map<String, Object> whenMap, int depthIdx, Map<String, Object> masterNode, String contentAssocTypeId, List<GenericValue> pickList, String direction) static boolean
traverseSubContent
(Map<String, Object> ctx)
-
Constructor Details
-
ContentWorker
public ContentWorker()
-
-
Method Details
-
getWebSitePublishPointExt
public GenericValue getWebSitePublishPointExt(Delegator delegator, String contentId, boolean ignoreCache) throws GenericEntityException - Specified by:
getWebSitePublishPointExt
in interfaceContentWorkerInterface
- Throws:
GenericEntityException
-
getCurrentContentExt
public GenericValue getCurrentContentExt(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, throws GeneralExceptionObject> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) - Specified by:
getCurrentContentExt
in interfaceContentWorkerInterface
- Throws:
GeneralException
-
getMimeTypeIdExt
- Specified by:
getMimeTypeIdExt
in interfaceContentWorkerInterface
-
renderContentAsTextExt
public void renderContentAsTextExt(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Specified by:
renderContentAsTextExt
in interfaceContentWorkerInterface
- Throws:
GeneralException
IOException
-
renderSubContentAsTextExt
public void renderSubContentAsTextExt(LocalDispatcher dispatcher, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Specified by:
renderSubContentAsTextExt
in interfaceContentWorkerInterface
- Throws:
GeneralException
IOException
-
renderSubContentAsTextExt
public String renderSubContentAsTextExt(LocalDispatcher dispatcher, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Specified by:
renderSubContentAsTextExt
in interfaceContentWorkerInterface
- Throws:
GeneralException
IOException
-
renderContentAsTextExt
public String renderContentAsTextExt(LocalDispatcher dispatcher, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Specified by:
renderContentAsTextExt
in interfaceContentWorkerInterface
- Throws:
GeneralException
IOException
-
findContentForRendering
public static GenericValue findContentForRendering(Delegator delegator, String contentId, Locale locale, String partyId, String roleTypeId, boolean cache) throws GeneralException, IOException - Throws:
GeneralException
IOException
-
renderContentAsText
public static void renderContentAsText(LocalDispatcher dispatcher, GenericValue content, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache, List<GenericValue> webAnalytics) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
renderContentAsText
public static String renderContentAsText(LocalDispatcher dispatcher, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
renderContentAsText
public static String renderContentAsText(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache, List<GenericValue> webAnalytics) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
renderContentAsText
public static void renderContentAsText(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, String partyId, String roleTypeId, boolean cache) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
renderSubContentAsText
public static String renderSubContentAsText(LocalDispatcher dispatcher, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
renderSubContentAsText
public static void renderSubContentAsText(LocalDispatcher dispatcher, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException- Throws:
GeneralException
IOException
-
findAlternateLocaleContent
public static GenericValue findAlternateLocaleContent(Delegator delegator, GenericValue view, Locale locale) -
traverse
-
traverseSubContent
-
getPurposes
-
getSections
-
getTopics
-
selectKids
-
checkWhen
Returns a boolean, result of whenStr evaluation with context. If whenStr is empty return defaultReturn.- Parameters:
context
- AMap
containing initial variableswhenStr
- AString
condition expressiondefaultReturn
- Aboolean
default return value- Returns:
- A
boolean
result of evaluation
-
getAssociatedContent
public static List<GenericValue> getAssociatedContent(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException - Throws:
GenericEntityException
-
getAssociatedContentView
public static List<GenericValue> getAssociatedContentView(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException - Throws:
GenericEntityException
-
getAssociations
public static List<GenericValue> getAssociations(GenericValue currentContent, String linkDir, List<String> assocTypes, String strFromDate, String strThruDate) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAssocsWithId
public static List<GenericValue> getContentAssocsWithId(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) throws GenericEntityException - Throws:
GenericEntityException
-
getContentTypeAncestry
public static void getContentTypeAncestry(Delegator delegator, String contentTypeId, List<String> contentTypes) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAncestry
public static void getContentAncestry(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAncestryAll
-
getContentAncestryNodeTrail
public static List<Map<String,Object>> getContentAncestryNodeTrail(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAncestryNodeTrailCsv
public static String getContentAncestryNodeTrailCsv(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAncestryValues
public static void getContentAncestryValues(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException - Throws:
GenericEntityException
-
pullEntityValues
-
callContentPermissionCheck
public static String callContentPermissionCheck(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) callContentPermissionCheck Formats data for a call to the checkContentPermission service. -
callContentPermissionCheckResult
-
getSubContent
public static GenericValue getSubContent(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate) throws IOException - Throws:
IOException
-
getSubContentCache
public static GenericValue getSubContentCache(Delegator delegator, String contentId, String mapKey, String subContentId, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GenericEntityException - Throws:
GenericEntityException
-
getSubContentCache
public static GenericValue getSubContentCache(Delegator delegator, String contentId, String mapKey, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GenericEntityException - Throws:
GenericEntityException
-
getContentCache
public static GenericValue getContentCache(Delegator delegator, String contentId) throws GenericEntityException - Throws:
GenericEntityException
-
getCurrentContent
public static GenericValue getCurrentContent(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, throws GeneralExceptionObject> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) - Throws:
GeneralException
-
getContentFromView
-
buildPickContext
public static Map<String,Object> buildPickContext(Delegator delegator, String contentAssocTypeId, String assocContentId, String direction, GenericValue thisContent) throws GenericEntityException - Throws:
GenericEntityException
-
checkConditions
-
booleanDataType
-
prepTargetOperationList
-
prepContentPurposeList
Checks to see if there is a purpose string (delimited by pipes) and turns it into a list and concants to any existing purpose list.- Parameters:
context
- the context- Returns:
- the list of content purpose
-
prepPermissionErrorMsg
-
getContentAssocViewList
public static List<GenericValue> getContentAssocViewList(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException - Throws:
GenericEntityException
-
getContentAssocViewFrom
public static GenericValue getContentAssocViewFrom(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException - Throws:
GenericEntityException
-
makeNode
-
nodeTrailToCsv
-
csvToList
-
csvToContentList
-
csvToTrail
-
getMimeTypeId
-
determineMimeType
public static String determineMimeType(Delegator delegator, GenericValue view, GenericValue parentContent, String contentId, String dataResourceId, String parentContentId) throws GenericEntityException - Throws:
GenericEntityException
-
logMap
-
logMap
public static StringBuilder logMap(StringBuilder s, String lbl, Map<String, Object> map, StringBuilder indent) -
logList
-
logList
public static StringBuilder logList(StringBuilder s, String lbl, List<Object> lst, StringBuilder indent) -
traceNodeTrail
-