net.sourceforge.sconman
Class Category

java.lang.Object
  extended by net.sourceforge.sconman.Category
All Implemented Interfaces:
IXMLSerializable
Direct Known Subclasses:
Project

public class Category
extends java.lang.Object
implements IXMLSerializable

A Categoryrepresents a logical group for s within Projectcontext.

A Projectgroups its contents into a Categorytree. Every Contenthas an associated Category, that can be its default category (as defined by its content type ContentType) or a user selected category.

Author:
mikeshadow

Nested Class Summary
(package private)  class Category.RepositoryIndexSynchronizer
           
 
Field Summary
(package private)  java.util.Set allowedContentTypes
          Allowed content types for this category
(package private)  java.lang.String allowedContentTypesCSV
           
(package private)  java.util.Map categories
          Keyed subcategory map
(package private)  java.lang.String defaultLanguage
          Default language
(package private)  Descriptor descriptor
          Category descriptor
(package private)  java.lang.String id
          Category id
static int MODIFY_PERMISSION
          Permission to modify contents below this category
(package private)  Category parent
          Parent category
(package private)  Project project
          Category project
(package private)  java.util.Map properties
          Category properties
(package private)  IRepository repository
          Repository to store the content below this category
static int VIEW_PERMISSION
          Permission to view contents below this category
 
Constructor Summary
Category(Project project)
          Creates a new Category object.
 
Method Summary
(package private)  void addAllowedContentType(ContentType ctype)
          Adds a new allowed content type to this category
 void addAllowedContentType(User actor, ContentType ctype)
          Adds a new allowed content type to this category
(package private)  void addCategory(Category category)
          Adds a child category
(package private)  Category addCategory(java.lang.String path)
          Adds a child category, specified by its path relative to this category
 Category addCategory(User actor, java.lang.String path)
          Adds a child category, specified by its path relative to this category
(package private)  Query addCategoryClause(Query query, boolean deep)
          Searches in the specified category, or below (depending on "deep").
(package private)  void addContent(Content content, java.io.InputStream is, java.lang.String filePath)
          Adds a content to the category, or to the content's category if it already has one.
 void addContent(User actor, Content content)
          Convenience method to add a content without data stream
 void addContent(User actor, Content content, java.io.InputStream is)
          Convenience method to add a content with data from an InputStream
 void addContent(User actor, Content content, java.io.InputStream is, java.lang.String fileName)
          Adds a content to the category, or to the content's category if it already has one.
 Content addContent(User actor, java.io.InputStream is, java.lang.String fileName)
          Convenience method to add a content from an InputStream and with the given file id.
 boolean canModify(User user)
          Check modify permissions for this Category
 boolean canRemove(User user)
          Check remove permissions for this Category
 boolean canView(User user)
          Check view permissions for this Category
 void cloneContents(User actor)
          Clones all the contents in this category, duplicating them by two
 void cloneContents(User actor, boolean deep)
          Does a (possibly deep) clone of contents, duplicating contents
 void cloneContents(User actor, boolean deep, int times)
          Does a (possibly deep) clone of contents, duplicating contents, for N times
(package private)  void deserializeSharedFieldsXML(org.kxml2.io.KXmlParser in)
           
 void deserializeXML(org.kxml2.io.KXmlParser in)
          Deserialize from XML
(package private)  java.util.Collection getAllCategories(java.util.Collection cats)
          Returns all (recursively) the subcategories of this Category
 java.util.List getAllContents(User actor, boolean deep)
          Returns all the contents (old, active, and future) in this category
 java.util.List getAllContents(User actor, boolean deep, boolean reverseOrder)
          Returns all the contents (old, active, and future) in this category
 ISearchResults getAllContents(User actor, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Returns a page of all the contents (old, active, and future) in this category
(package private)  java.util.Collection getAllowedContentTypes()
          Returns the list of allowed contents
 java.util.Collection getAllowedContentTypes(User actor)
          Returns the list of allowed content types
(package private)  void getAllRepositories(java.util.Set set)
          Visitor method for retrieving all the repositories below this category
 java.util.List getAsList(User user, ISearchResults ires)
          Returns an ISearchResults as a List, the ISearchResults is closed after method invocation.
 java.util.List getAsList(User user, ISearchResults ires, int beginIndex, int pageSize)
          Returns a "page" from and ISearchResults as a List.
(package private)  java.util.Collection getCategories()
          Returns the subcategories of this category.
 java.util.Collection getCategories(User user)
          Returns the subcategories of this category that the user can view.
(package private)  Category getCategory(java.lang.String path)
          Returns a subcategory, known its relative path.
 Category getCategory(User actor, java.lang.String path)
          Returns a subcategory, known its path.
 Category getCategoryToHistorifyOldContents()
          Returns the category where contents will be moved for historic purpouse
 Content getContent(User actor, Query query, boolean visible, boolean searchSubcategories)
          Returns the first content that matches the query
(package private)  ISearchResults getContents(boolean deep)
          Returns all the visible contents in this category
(package private)  ISearchResults getContents(boolean deep, boolean reverseOrder)
          Returns all the visible contents in this category
 java.util.List getContents(User actor, boolean deep)
          Returns all the visible contents in this category
 java.util.List getContents(User actor, boolean deep, boolean reverseOrder)
          Returns all the visible contents in this category
 ISearchResults getContents(User actor, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Returns a page of all the visible contents in this category
(package private)  java.lang.String getContentURIFromFilePathInRepository(java.lang.String filePath)
          Returns the URI of a content, known its file path in the repository
 java.lang.String getDefaultlanguage()
          Returns the (possible inherited) default language
 java.lang.String getDefaultLocale()
           
 java.util.Collection getDefinedAllowedContentTypes()
          Returns a Collection of allowed Content Types defined in structure file.
 java.lang.String getDescription()
          Returns the category description in the specified locale
 java.lang.String getDescription(java.lang.String locale)
          Returns the category description in the specified locale
 java.util.List getFutureContents(User actor, boolean deep)
          Return future contents stored in this category
 int getHistoryDays()
          Returns the number of days that a content that has been moved to getCategoryToHistorifyOldContents().
 java.lang.String getId()
          Returns the category id
 java.lang.String getName()
          Returns the category id in the specified locale
 java.lang.String getName(java.lang.String locale)
          Returns the category id in the specified locale
 java.util.List getOldContents(User actor, boolean deep)
          Return old contents stored in this category
 ISearchResults getOldContents(User actor, boolean deep, int beginIndex, int pageSize)
          Return a page of old contents stored in this category
 Category getParent()
          Returns the category's parent category, or null if there's no parent.
 Category getParent(User user)
          Returns the first parent category that the parent can view
 java.lang.String getPath()
          Returns the category path, relative to its Project.
 Project getProject()
          Returns the project this category is defined on.
 java.util.Map getProperties()
          Gets the category properties
 java.lang.Object getProperty(java.lang.String property)
          Retrieves the value of the property in this category.
 IRepository getRepository()
          Get the category repository.
 java.util.Collection getValidCategoriesFor(User actor, ContentType ctype)
          Returns the collection of categories where the user could add a given content type
(package private)  void getValidCategoriesFor(User actor, ContentType ctype, java.util.Collection cats)
          Recursively adds to the category bag all the categories that could accept the specified content type
(package private)  void index(Content content)
          Just index the given content
 boolean isSubscribed(User user)
          Returns true if the user is subscribed to this category
(package private)  boolean isSystem()
          Return true if it is a system category (starts with a '.')
(package private)  void reindex(Content content)
          Just reindex the given content
 void removeAllContents(User actor, boolean deep)
          Removes all the contents in the current category
(package private)  void removeAllowedContentType(ContentType ctype)
          Removes an allowed content type from this category
 void removeAllowedContentType(User actor, ContentType ctype)
          Removes an allowed content type from this category
(package private)  void removeCategory(Category cat, Category target)
          Removes a subcategory, relocating contents to another category or removing them all
(package private)  void removeCategory(java.lang.String path, Category target)
          Removes a subcategory, relocating contents to another category or removing them all
 void removeCategory(User actor, java.lang.String path, Category target)
          Removes a subcategory
 void removeContents(User actor, boolean deep)
          Removes all the contents in the current category
 ISearchResults safeSearch(User actor, Query query, boolean visible, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Safe page search.
 ISearchResults safeSearch(User actor, Query query, boolean visible, boolean deep, int beginIndex, int pageSize)
          Safe page search.
 ISearchResults safeSearch(User actor, Query query, ContentType ctype, boolean visible, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Safe page search.
 ISearchResults safeSearch(User actor, java.lang.String query, boolean visible, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Safe page search.
 ISearchResults safeSearch(User actor, java.lang.String query, ContentType ctype, boolean visible, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Safe page search.
 ISearchResults safeUserContentsSearch(User actor, Query query, boolean visible, boolean deep, boolean reverseOrder, int beginIndex, int pageSize)
          Safe search among user's contents.
(package private)  ISearchResults search(Query query, boolean visible, boolean deep, boolean reverseOrder)
          Searches the category
 ISearchResults search(User actor, Query query, boolean visible, boolean deep, boolean reverseOrder)
          Searches the category.
(package private)  void serializeSharedFieldsXML(org.kxml2.io.KXmlSerializer out)
           
 void serializeXML(org.kxml2.io.KXmlSerializer out)
          Serialize to XML
 void setCategoryToHistorifyOldContents(Category cat)
          Sets the category where contents will be moved for historic purpouse, if null, removes the category to historify contents
 void setDefaultLanguage(java.lang.String defaultLanguage)
          Sets the default language for this category, or null to inherit from parent
 void setDefaultLocale(java.lang.String defaultLocale)
           
 void setDescription(java.lang.String locale, java.lang.String description)
          Sets the category description in the specified locale
 void setHistoryDays(int historyDays)
          Sets the number of days that a content that has been moved to getCategoryToHistorifyOldContents()
(package private)  void setId(java.lang.String id)
          Sets a new id for this category
 void setName(java.lang.String locale, java.lang.String name)
          Sets the category id in the specified locale
 void setProperty(java.lang.String property, java.lang.Object value)
          Sets a property value to this Category.
 void setRepository(IRepository repository)
          Sets the repository for this category
 void subscribe(User user, java.lang.String box, java.lang.String period, java.lang.String language, java.lang.String sendTo)
          Subscribes the user to this category
(package private)  void synchronize(IRepository rep, IProgressObserver po)
          Synchronizes index and repository, checking that every file in the repository is in the index also
 void synchronize(User user, IProgressObserver po)
          Synchronizes index and repository, checking that every file in the repository is in the index also
 void synchronizeAll(IProgressObserver po)
          Synchronizes all the repositories below this category
 void synchronizeAll(User user, IProgressObserver po)
          Synchronizes all the repositories below this category
 java.lang.String toString()
          A String representation for this object
(package private)  void unindex(Content content)
          Remove content from the index
 void unsubscribe(User user)
          Unsubscribes the user from this category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VIEW_PERMISSION

public static final int VIEW_PERMISSION
Permission to view contents below this category

See Also:
Constant Field Values

MODIFY_PERMISSION

public static final int MODIFY_PERMISSION
Permission to modify contents below this category

See Also:
Constant Field Values

project

Project project
Category project


parent

Category parent
Parent category


id

java.lang.String id
Category id


defaultLanguage

java.lang.String defaultLanguage
Default language


descriptor

Descriptor descriptor
Category descriptor


properties

java.util.Map properties
Category properties


categories

java.util.Map categories
Keyed subcategory map


repository

IRepository repository
Repository to store the content below this category


allowedContentTypes

java.util.Set allowedContentTypes
Allowed content types for this category


allowedContentTypesCSV

java.lang.String allowedContentTypesCSV
Constructor Detail

Category

Category(Project project)
Creates a new Category object.

Parameters:
project -
Method Detail

getDefaultlanguage

public java.lang.String getDefaultlanguage()
Returns the (possible inherited) default language

Returns:

setDefaultLanguage

public void setDefaultLanguage(java.lang.String defaultLanguage)
Sets the default language for this category, or null to inherit from parent

Parameters:
defaultLanguage -

canModify

public boolean canModify(User user)
Check modify permissions for this Category

Parameters:
user -
Returns:

canRemove

public boolean canRemove(User user)
Check remove permissions for this Category

Parameters:
user -
Returns:

canView

public boolean canView(User user)
Check view permissions for this Category

Parameters:
user -
Returns:

isSystem

boolean isSystem()
Return true if it is a system category (starts with a '.')

Returns:

getPath

public java.lang.String getPath()
Returns the category path, relative to its Project. It will be something like "/docs/html/articles"

Returns:
The category path, relative to its project.

toString

public java.lang.String toString()
A String representation for this object

Overrides:
toString in class java.lang.Object
Returns:
String representation

getCategories

java.util.Collection getCategories()
Returns the subcategories of this category. If this category doesn't have any subcategories, the collection will be empty but not null.

Returns:
A collection of Categoryimplementations.

getAllCategories

java.util.Collection getAllCategories(java.util.Collection cats)
Returns all (recursively) the subcategories of this Category

Parameters:
cats -
Returns:

getCategories

public java.util.Collection getCategories(User user)
Returns the subcategories of this category that the user can view. If this category doesn't have any subcategories, the collection will be empty but not null.

Returns:
A collection of Categoryimplementations.

getValidCategoriesFor

public java.util.Collection getValidCategoriesFor(User actor,
                                                  ContentType ctype)
Returns the collection of categories where the user could add a given content type

Parameters:
actor -
ctype -
Returns:

getValidCategoriesFor

void getValidCategoriesFor(User actor,
                           ContentType ctype,
                           java.util.Collection cats)
Recursively adds to the category bag all the categories that could accept the specified content type

Parameters:
actor -
ctype -
cats -

getCategory

Category getCategory(java.lang.String path)
Returns a subcategory, known its relative path. A null will be returned if there's no subcategory for that id. If the id includes the '/' caracter, recursive category search will be performed.

Parameters:
path - Subcategory path
Returns:
The requested subcategory

getCategory

public Category getCategory(User actor,
                            java.lang.String path)
                     throws SCMSecurityException
Returns a subcategory, known its path. A null will be returned if there's no subcategory for that id. If the id includes the '/' caracter, recursive category search will be performed.

Parameters:
path - Subcategory path
Returns:
The requested subcategory
Throws:
SCMSecurityException

addCategory

void addCategory(Category category)
Adds a child category

Parameters:
category - The category to add

addCategory

Category addCategory(java.lang.String path)
Adds a child category, specified by its path relative to this category

Parameters:
path - The subcategory path to add, relative to this category
Returns:
The added category

addCategory

public Category addCategory(User actor,
                            java.lang.String path)
                     throws SCMSecurityException
Adds a child category, specified by its path relative to this category

Parameters:
actor - The user that performs the action
path - The subcategory path to add, relative to this category
Returns:
The added category
Throws:
SCMSecurityException

removeCategory

void removeCategory(Category cat,
                    Category target)
              throws SCMStorageException
Removes a subcategory, relocating contents to another category or removing them all

Parameters:
cat - The subcategory to remove
target - The category where all the contents under the category to be removed should be relocated at, or null to remove those contents.
Throws:
SCMStorageException

removeCategory

void removeCategory(java.lang.String path,
                    Category target)
              throws SCMStorageException
Removes a subcategory, relocating contents to another category or removing them all

Parameters:
path - The subcategory path to remove
target - The category where all the contents under the category to be removed should be relocated at, or null to remove those contents.
Throws:
SCMStorageException

removeCategory

public void removeCategory(User actor,
                           java.lang.String path,
                           Category target)
                    throws SCMSecurityException,
                           SCMStorageException
Removes a subcategory

Parameters:
actor - The user that removes the category
path - The subcategory path to remove
Throws:
SCMSecurityException
SCMStorageException

getId

public java.lang.String getId()
Returns the category id

Returns:
The category id

setId

void setId(java.lang.String id)
Sets a new id for this category

Parameters:
id - The new id

getName

public java.lang.String getName()
Returns the category id in the specified locale

Parameters:
locale -
Returns:

getName

public java.lang.String getName(java.lang.String locale)
Returns the category id in the specified locale

Parameters:
locale -
Returns:

setName

public void setName(java.lang.String locale,
                    java.lang.String name)
Sets the category id in the specified locale

Parameters:
locale -
id -

getDescription

public java.lang.String getDescription()
Returns the category description in the specified locale

Parameters:
locale -
Returns:

getDescription

public java.lang.String getDescription(java.lang.String locale)
Returns the category description in the specified locale

Parameters:
locale -
Returns:

setDescription

public void setDescription(java.lang.String locale,
                           java.lang.String description)
Sets the category description in the specified locale

Parameters:
locale -
description -

getDefaultLocale

public java.lang.String getDefaultLocale()
Returns:

setDefaultLocale

public void setDefaultLocale(java.lang.String defaultLocale)
Parameters:
defaultLocale -

getParent

public Category getParent()
Returns the category's parent category, or null if there's no parent.

Returns:
Parent category

getParent

public Category getParent(User user)
Returns the first parent category that the parent can view

Parameters:
user -
Returns:

getProject

public Project getProject()
Returns the project this category is defined on.

Returns:
Associated project

getAllowedContentTypes

java.util.Collection getAllowedContentTypes()
Returns the list of allowed contents

Returns:

getAllowedContentTypes

public java.util.Collection getAllowedContentTypes(User actor)
Returns the list of allowed content types

Parameters:
actor -
Returns:

getDefinedAllowedContentTypes

public java.util.Collection getDefinedAllowedContentTypes()
Returns a Collection of allowed Content Types defined in structure file.

Returns:

addAllowedContentType

void addAllowedContentType(ContentType ctype)
Adds a new allowed content type to this category

Parameters:
ctype - The content type to add

addAllowedContentType

public void addAllowedContentType(User actor,
                                  ContentType ctype)
Adds a new allowed content type to this category

Parameters:
actor -
ctype -

removeAllowedContentType

void removeAllowedContentType(ContentType ctype)
Removes an allowed content type from this category

Parameters:
ctype - The content type to remove

removeAllowedContentType

public void removeAllowedContentType(User actor,
                                     ContentType ctype)
Removes an allowed content type from this category

Parameters:
actor -
ctype -

getCategoryToHistorifyOldContents

public Category getCategoryToHistorifyOldContents()
Returns the category where contents will be moved for historic purpouse

Returns:

setCategoryToHistorifyOldContents

public void setCategoryToHistorifyOldContents(Category cat)
Sets the category where contents will be moved for historic purpouse, if null, removes the category to historify contents

Parameters:
cat -

getHistoryDays

public int getHistoryDays()
Returns the number of days that a content that has been moved to getCategoryToHistorifyOldContents(). Zero means no history days.

Returns:

setHistoryDays

public void setHistoryDays(int historyDays)
Sets the number of days that a content that has been moved to getCategoryToHistorifyOldContents()

Parameters:
historyDays -

getAllRepositories

void getAllRepositories(java.util.Set set)
Visitor method for retrieving all the repositories below this category

Parameters:
set - The set where the IRepositorywill be added

synchronize

void synchronize(IRepository rep,
                 IProgressObserver po)
Synchronizes index and repository, checking that every file in the repository is in the index also

Parameters:
repId - The repository to synchronize
po - The progress observer

synchronize

public void synchronize(User user,
                        IProgressObserver po)
                 throws SCMSecurityException
Synchronizes index and repository, checking that every file in the repository is in the index also

Parameters:
user - The user that performs the action
po - The progress observer, or null if no one is interested
Throws:
SCMSecurityException - If the user hasn't permission to administrate the project

synchronizeAll

public void synchronizeAll(IProgressObserver po)
Synchronizes all the repositories below this category

Parameters:
user - The user that performs the action
po -
Throws:
SCMSecurityException

synchronizeAll

public void synchronizeAll(User user,
                           IProgressObserver po)
                    throws SCMSecurityException
Synchronizes all the repositories below this category

Parameters:
user - The user that performs the action
po -
Throws:
SCMSecurityException

getRepository

public IRepository getRepository()
Get the category repository. If this category hasnīt a repository it will return the parent repository

Returns:
The repository to store the contents

setRepository

public void setRepository(IRepository repository)
Sets the repository for this category

Parameters:
repository -

getProperties

public java.util.Map getProperties()
Gets the category properties

Returns:

getProperty

public java.lang.Object getProperty(java.lang.String property)
Retrieves the value of the property in this category.

Parameters:
property -
Returns:

setProperty

public void setProperty(java.lang.String property,
                        java.lang.Object value)
Sets a property value to this Category. If value is null the property will be deleted

Parameters:
property -
value -

addContent

void addContent(Content content,
                java.io.InputStream is,
                java.lang.String filePath)
          throws SCMStorageException
Adds a content to the category, or to the content's category if it already has one.

Parameters:
content - The content to store and index
is - The input stream where the content's data can be extracted.
filePath -
Throws:
SCMStorageException - Thrown if there's an error while storing/indexing the content

getContentURIFromFilePathInRepository

java.lang.String getContentURIFromFilePathInRepository(java.lang.String filePath)
Returns the URI of a content, known its file path in the repository

Returns:

addContent

public void addContent(User actor,
                       Content content,
                       java.io.InputStream is,
                       java.lang.String fileName)
                throws SCMStorageException,
                       SCMSecurityException
Adds a content to the category, or to the content's category if it already has one.

Parameters:
actor - The user that performs the action
content - The content to store and index
is - The input stream where the content's data can be extracted.
fileName - The content's file id
Throws:
SCMStorageException - Thrown if there's an error while storing/indexing the content
SCMSecurityException - Thrown if the user doesn't have enough permissions

addContent

public Content addContent(User actor,
                          java.io.InputStream is,
                          java.lang.String fileName)
                   throws SCMStorageException,
                          SCMSecurityException
Convenience method to add a content from an InputStream and with the given file id.

Parameters:
actor - The user that performs the action
is - The input stream for the content.
fileName - The content filename
Returns:
Throws:
SCMStorageException - Thrown if there's an error storing content
SCMSecurityException - Thrown if the user doesn't have the necessary permissions

addContent

public void addContent(User actor,
                       Content content,
                       java.io.InputStream is)
                throws SCMException
Convenience method to add a content with data from an InputStream

Parameters:
actor - The user that performs the action
content - The content to add
is - The input stream for the content
Throws:
SCMException

addContent

public void addContent(User actor,
                       Content content)
                throws SCMSecurityException,
                       SCMStorageException
Convenience method to add a content without data stream

Parameters:
actor - The user that performs the action
content - The content to store and index
Throws:
SCMSecurityException - Thrown if the user doesn't have the necessary permissions
SCMStorageException - Thrown if there's an error storing content

addCategoryClause

Query addCategoryClause(Query query,
                        boolean deep)
                  throws SCMStorageException
Searches in the specified category, or below (depending on "deep").

Parameters:
cat -
query -
visible -
deep -
Returns:
Throws:
SCMStorageException

search

ISearchResults search(Query query,
                      boolean visible,
                      boolean deep,
                      boolean reverseOrder)
                throws SCMStorageException
Searches the category

Parameters:
query - The query that contents must match
visible - True to look only for contents whose visibility date range includes the time when the seach is done
deep - True to search in subcategories too
reverseOrder - True to return results in reverse order
Returns:
The search results
Throws:
SCMStorageException - Thrown if there's an error accessing the storage

search

public ISearchResults search(User actor,
                             Query query,
                             boolean visible,
                             boolean deep,
                             boolean reverseOrder)
                      throws SCMSecurityException,
                             SCMStorageException
Searches the category. This is the fastest search method, but doesn't close resources, so don't forget to call ISearchResults.close() after reading results.

Parameters:
actor - The actor that performs the search
query - The query that contents must match
visible - True to look only for contents whose visibility date range includes the time when the seach is done
deep - True to search in subcategories too
Returns:
Throws:
SCMSecurityException
SCMStorageException

getContent

public Content getContent(User actor,
                          Query query,
                          boolean visible,
                          boolean searchSubcategories)
                   throws SCMStorageException,
                          SCMSecurityException
Returns the first content that matches the query

Parameters:
actor - The user that performs the query
query - The query to match
visible - True to return only visible contents
searchSubcategories - True to search on subcategories
Returns:
The first content that matches the query
Throws:
SCMStorageException - Thrown if there's a problem retrieving the content
SCMSecurityException - Thrown if the user cannot get the content

safeSearch

public ISearchResults safeSearch(User actor,
                                 Query query,
                                 boolean visible,
                                 boolean deep,
                                 boolean reverseOrder,
                                 int beginIndex,
                                 int pageSize)
Safe page search. Returns the requested page of contents and closes internal resources.

Parameters:
actor -
query -
visible -
deep -
Returns:

safeUserContentsSearch

public ISearchResults safeUserContentsSearch(User actor,
                                             Query query,
                                             boolean visible,
                                             boolean deep,
                                             boolean reverseOrder,
                                             int beginIndex,
                                             int pageSize)
Safe search among user's contents.

Parameters:
actor -
query -
visible -
deep -
reverseOrder -
beginIndex -
pageSize -
Returns:

safeSearch

public ISearchResults safeSearch(User actor,
                                 Query query,
                                 ContentType ctype,
                                 boolean visible,
                                 boolean deep,
                                 boolean reverseOrder,
                                 int beginIndex,
                                 int pageSize)
Safe page search. Returns the requested page of contents and closes internal resources.

Parameters:
actor -
query -
ctype -
visible -
deep -
reverseOrder -
beginIndex -
pageSize -
Returns:

safeSearch

public ISearchResults safeSearch(User actor,
                                 java.lang.String query,
                                 ContentType ctype,
                                 boolean visible,
                                 boolean deep,
                                 boolean reverseOrder,
                                 int beginIndex,
                                 int pageSize)
Safe page search. Returns the requested page of contents and closes internal resources.

Parameters:
actor -
query -
ctype -
visible -
deep -
reverseOrder -
beginIndex -
pageSize -
Returns:

safeSearch

public ISearchResults safeSearch(User actor,
                                 java.lang.String query,
                                 boolean visible,
                                 boolean deep,
                                 boolean reverseOrder,
                                 int beginIndex,
                                 int pageSize)
Safe page search. Returns the requested page of contents and closes internal resources.

Parameters:
actor -
query -
visible -
deep -
Returns:

safeSearch

public ISearchResults safeSearch(User actor,
                                 Query query,
                                 boolean visible,
                                 boolean deep,
                                 int beginIndex,
                                 int pageSize)
Safe page search. Returns the requested page of contents and closes internal resources.

Parameters:
actor -
query -
visible -
deep -
Returns:

getContents

ISearchResults getContents(boolean deep)
                     throws SCMStorageException,
                            SCMSecurityException
Returns all the visible contents in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getContents

ISearchResults getContents(boolean deep,
                           boolean reverseOrder)
                     throws SCMStorageException,
                            SCMSecurityException
Returns all the visible contents in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getContents

public java.util.List getContents(User actor,
                                  boolean deep)
                           throws SCMStorageException,
                                  SCMSecurityException
Returns all the visible contents in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getContents

public java.util.List getContents(User actor,
                                  boolean deep,
                                  boolean reverseOrder)
                           throws SCMStorageException,
                                  SCMSecurityException
Returns all the visible contents in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getContents

public ISearchResults getContents(User actor,
                                  boolean deep,
                                  boolean reverseOrder,
                                  int beginIndex,
                                  int pageSize)
                           throws SCMStorageException,
                                  SCMSecurityException
Returns a page of all the visible contents in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getAllContents

public java.util.List getAllContents(User actor,
                                     boolean deep,
                                     boolean reverseOrder)
                              throws SCMStorageException,
                                     SCMSecurityException
Returns all the contents (old, active, and future) in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getAllContents

public java.util.List getAllContents(User actor,
                                     boolean deep)
                              throws SCMStorageException,
                                     SCMSecurityException
Returns all the contents (old, active, and future) in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getAllContents

public ISearchResults getAllContents(User actor,
                                     boolean deep,
                                     boolean reverseOrder,
                                     int beginIndex,
                                     int pageSize)
                              throws SCMStorageException,
                                     SCMSecurityException
Returns a page of all the contents (old, active, and future) in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getOldContents

public java.util.List getOldContents(User actor,
                                     boolean deep)
                              throws SCMStorageException,
                                     SCMSecurityException
Return old contents stored in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getOldContents

public ISearchResults getOldContents(User actor,
                                     boolean deep,
                                     int beginIndex,
                                     int pageSize)
                              throws SCMStorageException,
                                     SCMSecurityException
Return a page of old contents stored in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

getFutureContents

public java.util.List getFutureContents(User actor,
                                        boolean deep)
                                 throws SCMStorageException,
                                        SCMSecurityException
Return future contents stored in this category

Parameters:
actor -
Returns:
Throws:
SCMStorageException
SCMSecurityException

removeAllContents

public void removeAllContents(User actor,
                              boolean deep)
                       throws SCMStorageException,
                              SCMSecurityException
Removes all the contents in the current category

Parameters:
actor -
Throws:
SCMStorageException
SCMSecurityException

removeContents

public void removeContents(User actor,
                           boolean deep)
                    throws SCMStorageException,
                           SCMSecurityException
Removes all the contents in the current category

Parameters:
actor -
Throws:
SCMStorageException
SCMSecurityException

getAsList

public java.util.List getAsList(User user,
                                ISearchResults ires)
                         throws SCMStorageException
Returns an ISearchResults as a List, the ISearchResults is closed after method invocation. If the search result is null, an empty array will be returned.

Parameters:
ires - The ISearchResults to transform
Returns:
The requested List
Throws:
SCMStorageException - If there's an IO problem

getAsList

public java.util.List getAsList(User user,
                                ISearchResults ires,
                                int beginIndex,
                                int pageSize)
                         throws SCMStorageException
Returns a "page" from and ISearchResults as a List. The ISearchResults is closed after method invocation. If the search result is null, an empty array will be returned.

Parameters:
ires - The ISearchResults to transform
Returns:
The requested List
Throws:
SCMStorageException - If there's an IO problem

index

void index(Content content)
     throws SCMStorageException
Just index the given content

Parameters:
content - The content to store
Throws:
SCMStorageException - Thrown if there's an error indexing the content

unindex

void unindex(Content content)
       throws SCMStorageException
Remove content from the index

Parameters:
content - The content to unindex
Throws:
SCMStorageException - Thrown if there's an error unindexing content

reindex

void reindex(Content content)
       throws SCMStorageException
Just reindex the given content

Parameters:
content - The content to reindex
Throws:
SCMStorageException - Thrown if there's an error reindexing content

serializeXML

public void serializeXML(org.kxml2.io.KXmlSerializer out)
                  throws java.io.IOException
Description copied from interface: IXMLSerializable
Serialize to XML

Specified by:
serializeXML in interface IXMLSerializable
Parameters:
out - The KXmlSerializer to do the output
Throws:
java.io.IOException - Thrown if there's an IO problem

serializeSharedFieldsXML

void serializeSharedFieldsXML(org.kxml2.io.KXmlSerializer out)
                        throws java.io.IOException
Throws:
java.io.IOException

deserializeXML

public void deserializeXML(org.kxml2.io.KXmlParser in)
                    throws org.xmlpull.v1.XmlPullParserException,
                           java.io.IOException
Description copied from interface: IXMLSerializable
Deserialize from XML

Specified by:
deserializeXML in interface IXMLSerializable
Parameters:
in - The KXml pull parser
Throws:
org.xmlpull.v1.XmlPullParserException - Thrown if there's an XML problem
java.io.IOException - Thrown if there's an IO problem

deserializeSharedFieldsXML

void deserializeSharedFieldsXML(org.kxml2.io.KXmlParser in)
                          throws org.xmlpull.v1.XmlPullParserException,
                                 java.io.IOException
Parameters:
in -
Throws:
org.xmlpull.v1.XmlPullParserException
java.io.IOException

subscribe

public void subscribe(User user,
                      java.lang.String box,
                      java.lang.String period,
                      java.lang.String language,
                      java.lang.String sendTo)
               throws SCMStorageException
Subscribes the user to this category

Parameters:
user -
box -
sendTo -
Throws:
SCMStorageException

isSubscribed

public boolean isSubscribed(User user)
                     throws SCMStorageException
Returns true if the user is subscribed to this category

Parameters:
user -
Returns:
Throws:
SCMStorageException

unsubscribe

public void unsubscribe(User user)
                 throws SCMStorageException
Unsubscribes the user from this category

Parameters:
user -
Throws:
SCMStorageException

cloneContents

public void cloneContents(User actor)
                   throws SCMStorageException,
                          SCMSecurityException
Clones all the contents in this category, duplicating them by two

Parameters:
actor - The user that performs the action
Throws:
SCMStorageException
SCMSecurityException

cloneContents

public void cloneContents(User actor,
                          boolean deep)
                   throws SCMStorageException,
                          SCMSecurityException
Does a (possibly deep) clone of contents, duplicating contents

Parameters:
actor -
deep -
Throws:
SCMStorageException
SCMSecurityException

cloneContents

public void cloneContents(User actor,
                          boolean deep,
                          int times)
                   throws SCMStorageException,
                          SCMSecurityException
Does a (possibly deep) clone of contents, duplicating contents, for N times

Parameters:
actor -
deep -
Throws:
SCMStorageException
SCMSecurityException


Copyright null null. All Rights Reserved.