Neil McErlean ce540080f7 Merged BRANCHES/DEV/SWIFT to HEAD:
28466: Fix for ALF-6541. maintainAspectRatio does not default to true as documented.
        Fixed the javadoc to reflect reality.

Merged BRANCHES/DEV/SWIFT to HEAD:
   28482 Implementation of ALF-8969 Lucene removal: Blog webscripts.
        ** Checking this in on Swift branch, as I have the work there. Will merge to HEAD.

        The blog webscript controllers have been ported from JavaScript to Java.
        A new foundation service, the BlogService has been added and the impls of the webscript controllers delegate into that service, thus encapsulating business logic within the service.
        The API for this service is based on the requirements of the existing webscripts, but is for the most part a 'sensible' API. One controller (blogposts.get.js) had very domain-specific requirements (get all of my drafts and all published posts) and it is implemented as a deprecated public method on the service.
        The API is not complete, but represents a good starting point for any future feature development.
        The various Lucene queries have been replaced with calls to the nodeservice (as an impl detail within the BlogService) which get all blog post nodes and then post-filter them based on property values, aspect/property presence etc. This will       be refactored into a CannedQuery in a subsequent check-in.
 
        I've written new test cases aimed at this API & have extended the REST API tests.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28483 Prevent NPEs in some circumstances. Related to ALF-8969.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28484 Fixing activity reports for Blog posting. Following on from previous chagnes related to ALF-8969.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28597 ALF-8969. Introduction of brute force Canned Queries for BlogService query methods.
        This will be merged to HEAD after a chat with Jan/Derek.

        Introduced 'brute force' Canned Queries for the various BlogService query methods.
          These use the underlying nodeService to retrieve result sets.
          They must use the small-n nodeService in order to get full result sets.
          Therefore I have had to add some AFTER_ACL_ENTRY checks to the BlogService_security bean for the query methods.
        Added various CannedQuery classes for the BlogService queries. They currently split into two:
          1. a GetBlogPostsCannedQuery which goes some way towards providing configurable query support, albeit driven by the needs of the Blog Service REST API.
          2. a DraftsAndPublishedBlogPostsCannedQuery, which is a very specific CQ aimed at a very specific scenario in the REST API.
        Changed the BlogService API to return a BlogPostInfo (simple POJO) rather than the less extensible NodeRef.
          This affected the webscript implementations.
        Added BlogPostInfo as an acceptable return type for security-based filtering in ACLEntryAfterInvocationProvider.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28598 Repackaged the CannedQuery-related classes to a dedicated subpackage. ALF-8969.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28602 Replacement of some JS controllers with Java-based ports. Part of ALF-8969.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28603 Disabling two test cases pending a refactoring. Related to ALF-8969.

Merged BRANCHES/DEV/SWIFT to HEAD:
   r28604 Fixing a compilation error.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28606 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2011-06-27 10:10:07 +00:00

123 lines
5.9 KiB
Java

/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.blog;
import java.util.Date;
import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.site.SiteService;
/**
* The Blog Service handles the management (CRUD) of Alfresco blog data, namely the blog posts which are
* exposed in the Share UI under the "Blog" heading. The {@link BlogIntegrationService}, a separate service, is
* concerned with the integration of Alfresco blog content with external Blog-hosting sites.
* <p/>
* Please note that this service is a work in progress and currently exists primarily to support the blogs REST API.
*
* @author Neil Mc Erlean (based on existing webscript controllers in the REST API)
* @since 4.0
*/
public interface BlogService
{
/**
* Creates a new blog post within the specified container node.
*
* @param blogContainerNode the container node for blog posts (under the site).
* @param blogTitle the title of the blog post.
* @param blogContent text/html content of the blog post.
* @param isDraft <tt>true</tt> if the blog post is a draft post, else <tt>false</tt>.
*
* @return The {@link ChildAssociationRef} of the newly created blog post.
*
* @see SiteService#getContainer(String, String) to retrieve the blogContainerNode
*/
ChildAssociationRef createBlogPost(NodeRef blogContainerNode, String blogTitle,
String blogContent, boolean isDraft);
/**
* Gets the draft blog posts created by the specified user.
*
* @param blogContainerNode the container node for blog posts (under the site).
* @param username to limit results to blogs with this cm:creator. <tt>null</tt> means all users.
* @param pagingReq an object defining the paging parameters for the result set.
*
* @return a {@link PagingResults} object containing some or all of the results (subject to paging).
*
* @see SiteService#getContainer(String, String) to retrieve the blogContainerNode
*/
PagingResults<BlogPostInfo> getDrafts(NodeRef blogContainerNode, String username, PagingRequest pagingReq);
/**
* Gets the (internally, Alfresco-) published blog posts.
*
* @param blogContainerNode the container node for blog posts (under the site).
* @param fromDate an inclusive date limit for the results (more recent than).
* @param toDate an inclusive date limit for the results (before).
* @param byUser if not <tt>null</tt> limits results to posts by the specified user.
* if <tt>null</tt> results will be by all users.
* @param pagingReq an object defining the paging parameters for the result set.
*
* @return a {@link PagingResults} object containing some or all of the results (subject to paging).
*
* @see SiteService#getContainer(String, String) to retrieve the blogContainerNode
*/
PagingResults<BlogPostInfo> getPublished(NodeRef blogContainerNode, Date fromDate, Date toDate, String byUser, PagingRequest pagingReq);
/**
* Gets blog posts published externally (i.e. to an external blog hosting site).
*
* @param blogContainerNode the container node for blog posts (under the site).
* @param pagingReq an object defining the paging parameters for the result set.
*
* @return a {@link PagingResults} object containing some or all of the results (subject to paging).
*
* @see SiteService#getContainer(String, String) to retrieve the blogContainerNode
*/
PagingResults<BlogPostInfo> getPublishedExternally(NodeRef blogContainerNode, PagingRequest pagingReq);
/**
* Gets draft blog posts by the currently authenticated user along with all published posts.
*
* @param blogContainerNode the container node for blog posts (under the site).
* @param fromDate an inclusive date limit for the results (more recent than).
* @param toDate an inclusive date limit for the results (before).
* @param tag if specified, only returns posts tagged with this tag.
* @param pagingReq an object defining the paging parameters for the result set.
*
* @return a {@link PagingResults} object containing some or all of the results (subject to paging).
*
* @see SiteService#getContainer(String, String) to retrieve the blogContainerNode
*
* @deprecated This method is a domain-specific query used by the Blog REST API and is not considered suitable for general use.
*/
PagingResults<BlogPostInfo> getMyDraftsAndAllPublished(NodeRef blogContainerNode, Date fromDate, Date toDate,
String tag, PagingRequest pagingReq);
/**
* Returns true if the specified blog-post node is a 'draft' blog post.
*
* @param blogPostNode a NodeRef representing a blog-post.
* @return <tt>true</tt> if it is a draft post, else <tt>false</tt>.
*/
boolean isDraftBlogPost(NodeRef blogPostNode);
}