当前位置: 首页>>代码示例>>Java>>正文


Java BlogIntegrationModel类代码示例

本文整理汇总了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);
   }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:AbstractBlogPostsCannedQueryFactory.java

示例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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:BlogPostLibJs.java

示例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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:BlogPut.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:37,代码来源:GetBlogPostsCannedQueryFactory.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:BlogLibJs.java

示例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;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:61,代码来源:BlogPostLibJs.java


注:本文中的org.alfresco.model.BlogIntegrationModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。