本文整理汇总了Java中org.alfresco.model.BlogIntegrationModel类的典型用法代码示例。如果您正苦于以下问题:Java BlogIntegrationModel类的具体用法?Java BlogIntegrationModel怎么用?Java BlogIntegrationModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlogIntegrationModel类属于org.alfresco.model包,在下文中一共展示了BlogIntegrationModel类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProperty
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected Comparable getProperty(BlogEntity entity) {
if (comparableProperty.equals(ContentModel.PROP_PUBLISHED))
{
return entity.getPublishedDate();
}
else if (comparableProperty.equals(ContentModel.PROP_CREATED))
{
return entity.getCreatedDate();
}
else if (comparableProperty.equals(BlogIntegrationModel.PROP_POSTED))
{
return entity.getPostedDate();
}
else
{
throw new IllegalArgumentException("Unsupported blog sort property: "+comparableProperty);
}
}
示例2: hasExternalBlogConfiguration
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
/**
* Checks whether a blog configuration is available
* This should at some point also check whether the configuration is enabled.
*
* @param node the node that should be checked. Will check all parents if
* the node itself doesn't contain a configuration.
* @return {boolean} whether a configuration could be found.
*/
public static boolean hasExternalBlogConfiguration(NodeRef node, ServiceRegistry services)
{
if (node == null)
{
return false;
}
else if (services.getNodeService().hasAspect(node, BlogIntegrationModel.ASPECT_BLOG_DETAILS))
{
return true;
}
else
{
return hasExternalBlogConfiguration(services.getNodeService().getPrimaryParent(node).getParentRef(), services);
}
}
示例3: updateBlog
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
/**
* Creates a post inside the passed forum node.
*/
@SuppressWarnings("deprecation")
private void updateBlog(NodeRef node, JSONObject json)
{
Map<QName, Serializable> arr = BlogLibJs.getBlogPropertiesArray(json);
if (nodeService.hasAspect(node, BlogIntegrationModel.ASPECT_BLOG_DETAILS))
{
Map<QName, Serializable> properties = nodeService.getProperties(node);
properties.putAll(arr);
nodeService.setProperties(node, properties);
}
else
{
nodeService.addAspect(node, BlogIntegrationModel.ASPECT_BLOG_DETAILS, arr);
}
}
示例4: getGetPublishedExternallyCannedQuery
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
public CannedQuery<BlogEntity> getGetPublishedExternallyCannedQuery(NodeRef blogContainerNode, PagingRequest pagingReq)
{
ParameterCheck.mandatory("blogContainerNode", blogContainerNode);
ParameterCheck.mandatory("pagingReq", pagingReq);
int requestTotalCountMax = pagingReq.getRequestTotalCountMax();
boolean isPublished = true;
Long blogIntAspectQNameId = getQNameId(BlogIntegrationModel.ASPECT_BLOG_POST);
if (blogIntAspectQNameId == null)
{
// possible if no blogs have ever been published externally
blogIntAspectQNameId = -1L; // run the query but should return empty results
}
// published externally if it has the BLOG_POST aspect
GetBlogPostsCannedQueryParams paramBean = new GetBlogPostsCannedQueryParams(getNodeId(blogContainerNode),
getQNameId(ContentModel.PROP_NAME),
getQNameId(ContentModel.PROP_PUBLISHED),
getQNameId(ContentModel.TYPE_CONTENT),
null,
isPublished,
null, null,
blogIntAspectQNameId,
getQNameId(BlogIntegrationModel.PROP_POSTED));
CannedQueryPageDetails cqpd = createCQPageDetails(pagingReq);
CannedQuerySortDetails cqsd = createCQSortDetails(BlogIntegrationModel.PROP_POSTED, SortOrder.DESCENDING);
// create query params holder
CannedQueryParameters params = new CannedQueryParameters(paramBean, cqpd, cqsd, requestTotalCountMax, pagingReq.getQueryExecutionId());
// return canned query instance
return getCannedQuery(params);
}
示例5: getBlogPropertiesArray
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
/**
* Fetches the blog properties from the json object and adds them to an array
* using the correct property names as indexes.
*/
public static Map<QName, Serializable> getBlogPropertiesArray(JSONObject json)
{
Map<QName, Serializable> arr = new HashMap<QName, Serializable>();
putJSONEntryInMap(json, arr, "blogType", BlogIntegrationModel.PROP_BLOG_IMPLEMENTATION);
putJSONEntryInMap(json, arr, "blogId", BlogIntegrationModel.PROP_ID);
putJSONEntryInMap(json, arr, "blogName", BlogIntegrationModel.PROP_NAME);
putJSONEntryInMap(json, arr, "blogDescription", BlogIntegrationModel.PROP_DESCRIPTION);
putJSONEntryInMap(json, arr, "blogUrl", BlogIntegrationModel.PROP_URL);
putJSONEntryInMap(json, arr, "username", BlogIntegrationModel.PROP_USER_NAME);
putJSONEntryInMap(json, arr, "password", BlogIntegrationModel.PROP_PASSWORD);
return arr;
}
示例6: getBlogPostData
import org.alfresco.model.BlogIntegrationModel; //导入依赖的package包/类
public static Map<String, Object> getBlogPostData(NodeRef node, ServiceRegistry services)
{
Map<String, Object> data = new HashMap<String, Object>();
data.put("node", node);
String creator = (String)services.getNodeService().getProperty(node, ContentModel.PROP_CREATOR);
//ALF-18527
NodeRef person = services.getPersonService().getPersonOrNull(creator);
if (person != null)
{
data.put("author", person);
}
data.put("commentCount", CommentsLibJs.getCommentsCount(node, services));
// is the post published
Serializable published = services.getNodeService().getProperty(node, ContentModel.PROP_PUBLISHED);
boolean isPublished = published != null;
if (isPublished)
{
data.put("releasedDate", published);
}
// draft
data.put("isDraft", !isPublished);
// set the isUpdated flag
Date updatedDate = (Date) services.getNodeService().getProperty(node, ContentModel.PROP_UPDATED);
boolean isUpdated = updatedDate != null;
data.put("isUpdated", isUpdated);
if (isUpdated)
{
data.put("updatedDate", updatedDate);
}
// fetch standard created/modified dates
data.put("createdDate", services.getNodeService().getProperty(node, ContentModel.PROP_CREATED));
data.put("modifiedDate", services.getNodeService().getProperty(node, ContentModel.PROP_MODIFIED));
// does the external post require an update?
Date lastUpdate = (Date) services.getNodeService().getProperty(node, BlogIntegrationModel.PROP_LAST_UPDATE);
if (isPublished && lastUpdate != null)
{
// we either use the release or updated date
Date modifiedDate = (Date) data.get("releasedDate");
if (isUpdated)
{
modifiedDate = (Date) data.get("updatedDate");
}
data.put("outOfDate", modifiedDate.getTime() - lastUpdate.getTime() > 5000L);
}
else
{
data.put("outOfDate", false);
}
data.put("tags", services.getTaggingService().getTags(node));
return data;
}