|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.sconman.Category
net.sourceforge.sconman.Project
public class Project
The Projectis the main point for content management, as it's the
root of the Categorytree of contents, and the place where
ContentTypes are defined, and IAgents work on.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.sourceforge.sconman.Category |
|---|
Category.RepositoryIndexSynchronizer |
| Field Summary |
|---|
| Fields inherited from class net.sourceforge.sconman.Category |
|---|
allowedContentTypes, allowedContentTypesCSV, categories, defaultLanguage, descriptor, id, MODIFY_PERMISSION, parent, project, properties, repository, VIEW_PERMISSION |
| Constructor Summary | |
|---|---|
Project(java.io.InputStream is,
java.lang.String projectPath,
java.lang.String projectName)
Loads a project. |
|
Project(java.lang.String projectPath)
Loads a previously stored project in the specified project path |
|
Project(java.lang.String projectPath,
java.lang.String id)
Creates a new project at the specified projectPath |
|
Project(java.lang.String projectPath,
java.lang.String id,
IRepository repo)
Creates a new project at the specified projectPath and repository |
|
| Method Summary | |
|---|---|
IAgent |
addAgent(java.lang.String name,
java.lang.String classname,
long period)
Adds an IAgentimplementation that will work within the project's
context. |
void |
addContent(User actor,
java.io.File file,
IProgressObserver po)
Adds a file or directory (all the files in the directory tree) to the project. |
(package private) void |
addContentType(ContentType ctype)
Adds a new content type for this project |
(package private) ContentType |
addContentType(java.lang.String id,
java.lang.String fileExtensions,
java.lang.String defaultCategory,
IContentTypeHandler hanlder)
Adds a new content type for this project |
ContentType |
addContentType(User actor,
java.lang.String id,
java.lang.String fileExtensions,
java.lang.String defaultCategory,
IContentTypeHandler hanlder)
|
void |
addLanguage(Language language)
Adds a new language to the project |
void |
addSCMEventListener(ISCMEventListener listener)
Adds a new observer of project events |
void |
close()
Free resources and notify listeners |
void |
deserializeXML(org.kxml2.io.KXmlParser in)
Deserialize from XML |
IAgent |
getAgent(java.lang.String id)
Returns an agent |
java.util.Collection |
getAgents()
Returns all the agents working on this project |
ISearchResults |
getAllContents()
Returns all the Contentstored in the project |
java.util.logging.Logger |
getChangeLogger()
Returns the change logger |
(package private) Content |
getContent(java.lang.String uri)
Returns the specified content, given its URI |
Content |
getContent(User actor,
java.lang.String uri)
Returns the specified content, given its URI, checking user permissions |
ContentType |
getContentType(java.lang.String id)
Returns a content type |
(package private) java.util.Collection |
getContentTypes()
Returns all the ContentTypes |
java.util.Collection |
getContentTypes(User actor)
Returns the ContentTypes visible to the user |
(package private) ISCMEventListener |
getEventMulticaster()
Returns the event multicaster |
(package private) java.util.Map |
getExtensionToContentTypeMap()
Returns the extension to content type map |
ContentType |
getFileContentType(java.lang.String fext)
Returns a file's associated ContentType. |
(package private) IndexManager |
getIndexManager()
Returns the index manager |
Language |
getLanguage(java.lang.String locale)
|
java.util.Collection |
getLanguageLocales()
Return all the languages added to the project |
java.lang.String |
getLanguageName(java.lang.String userLocale,
java.lang.String locale)
Returns the language id in the user locale |
java.util.Collection |
getLanguages()
Return all the languages added to the project |
(package private) static java.io.File |
getProjectConfigurationFile(java.lang.String projectPath)
Returns the project's configuration file, known the project's id |
java.lang.String |
getProjectPath()
Returns the project's absolute path in the file system |
java.util.Map |
getProjectRoles(User actor)
|
IProjectSynchronizer |
getProjectSynchronizer()
Returns the project synchronizer manager (@link IProjectSynchronizer) |
(package private) Content |
getRepositoryContent(java.lang.String uri)
Reads a content from the repository, known its URI |
Content |
getRepositoryContent(User actor,
java.lang.String uri)
Reads a content from the repository, known its URI |
SecurityContext |
getSecurityContext()
Returns the SecurityContextthat handles Users,
Roles, and permissions |
ISubscriptionHandler |
getSubscriptionHandler()
Returns the subscriptions handler |
boolean |
isRunningAgentManager()
Check if the agent execution shedule of the Project is running. |
(package private) void |
regenerateIndex()
|
void |
regenerateIndex(User user)
Regenerates index |
(package private) void |
remove()
Removes the project |
void |
remove(User user)
Removes the project |
void |
removeAgent(java.lang.String id)
Removes an agent from this project |
void |
removeContentType(User actor,
java.lang.String id)
Removes a content type, known its id |
void |
removeLanguage(java.lang.String locale)
Removes a language from the project |
void |
removeSCMEventListener(ISCMEventListener listener)
Removes an observer of project events |
(package private) void |
save()
Saves the project state |
void |
save(User user)
Saves the project state |
(package private) ISearchResults |
search(Query query,
boolean visible)
Return all the contents that match the query |
(package private) ISearchResults |
search(Query query,
boolean visible,
boolean reverseOrder)
Return all the contents that match the query |
(package private) ISearchResults |
searchFuture(Query query)
Searches old contents (those whose toDate property is
before today) |
(package private) ISearchResults |
searchOld(Query query)
Searches old contents (those whose toDate property is
before today) |
void |
serializeXML(org.kxml2.io.KXmlSerializer out)
Serialize to XML |
void |
setSubscriptionHandler(ISubscriptionHandler handler)
Sets the subscription handler for this project |
void |
startAgents(User actor)
Starts the agent execution shedule. |
void |
stopAgents(User actor)
Stops the agent execution shedule |
java.lang.String |
toString()
A String representation for this object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Project(java.lang.String projectPath,
java.lang.String id)
throws java.io.IOException
projectPath - The project directory path where configuration file, the
index, and defalut repository will be storedid - The project id
java.io.IOException
public Project(java.lang.String projectPath,
java.lang.String id,
IRepository repo)
throws java.io.IOException
projectPath - The project directory path where configuration file, the
index, and defalut repository will be storedid - The project idrepo - The project default repository
java.io.IOException
public Project(java.lang.String projectPath)
throws java.io.IOException
projectPath - The filesystem path where the project was loaded
java.io.IOException - Thrown if the project cannot be loaded
public Project(java.io.InputStream is,
java.lang.String projectPath,
java.lang.String projectName)
throws java.io.IOException
is - InputStream with the project configuration
java.io.IOException| Method Detail |
|---|
public void close()
public java.util.logging.Logger getChangeLogger()
public java.lang.String toString()
Category
toString in class CategoryIndexManager getIndexManager()
public void setSubscriptionHandler(ISubscriptionHandler handler)
handler - public ISubscriptionHandler getSubscriptionHandler()
public IProjectSynchronizer getProjectSynchronizer()
public void addLanguage(Language language)
locale - The Locale String representationpublic void removeLanguage(java.lang.String locale)
locale - The String representation of the Locale to removepublic java.util.Collection getLanguages()
public java.util.Collection getLanguageLocales()
Localeobjects
public java.lang.String getLanguageName(java.lang.String userLocale,
java.lang.String locale)
userLocale - The user localelocale - The language whose id is requested
public Language getLanguage(java.lang.String locale)
locale -
ISCMEventListener getEventMulticaster()
public void addSCMEventListener(ISCMEventListener listener)
listener - The listener/observer to addpublic void removeSCMEventListener(ISCMEventListener listener)
listener - The listener/observer to remove
public void save(User user)
throws SCMException
java.io.IOException
SCMException
void save()
throws java.io.IOException
java.io.IOException
void remove()
throws SCMException
SCMException - Thrown if the project doesn't exist
public void remove(User user)
throws SCMException
SCMException - Thrown if the project doesn't existstatic java.io.File getProjectConfigurationFile(java.lang.String projectPath)
id - The project's id
public java.lang.String getProjectPath()
java.util.Collection getContentTypes()
ContentTypes
public java.util.Collection getContentTypes(User actor)
ContentTypes visible to the user
actor - The user that performs the action
ContentTypes that the user can seepublic ContentType getContentType(java.lang.String id)
id - The content type id
java.util.Map getExtensionToContentTypeMap()
void addContentType(ContentType ctype)
ctype - The new content type to add
public ContentType addContentType(User actor,
java.lang.String id,
java.lang.String fileExtensions,
java.lang.String defaultCategory,
IContentTypeHandler hanlder)
throws SCMSecurityException
SCMSecurityException
ContentType addContentType(java.lang.String id,
java.lang.String fileExtensions,
java.lang.String defaultCategory,
IContentTypeHandler hanlder)
id - The content type idfileExtensions - A CSV string with the file extensions, or null if the content
type doesn't have an associated filedefaultCategory - The default category to usehanler - The IContentTypeHandlerto use when adding contents of
this type.
public void removeContentType(User actor,
java.lang.String id)
throws SCMSecurityException
id - The content type id
SCMSecurityExceptionpublic ContentType getFileContentType(java.lang.String fext)
ContentType. If the file extension
is unknown, the default content type will be returned and the extension
added to it.
fext - The file extension. Is case insensitive, as it will be lower
cased.
public IAgent addAgent(java.lang.String name,
java.lang.String classname,
long period)
IAgentimplementation that will work within the project's
context. Remember to start agents calling startAgents(net.sourceforge.sconman.User)
id - The agent id. Must be unique among agents defined in the
projectclassname - The agent classname. Must implement IAgentperiod - The periodicity, in miliseconds, for the agent execution
public void removeAgent(java.lang.String id)
id - The id of the agent to removepublic IAgent getAgent(java.lang.String id)
id - The agent id
public java.util.Collection getAgents()
IAgentobjects
public void startAgents(User actor)
throws SCMSecurityException
SCMSecurityException
public void stopAgents(User actor)
throws SCMSecurityException
SCMSecurityExceptionpublic boolean isRunningAgentManager()
public SecurityContext getSecurityContext()
SecurityContextthat handles Users,
Roles, and permissions
SecurityContext
public void addContent(User actor,
java.io.File file,
IProgressObserver po)
throws SCMStorageException,
SCMSecurityException
ContentTypeis extracted from the filename. This
method is useful for non supervised content addition, as massive content
addition from a filesystem.
actor - The user that performs the actionfile - The file or directory to add. If it's a directory, every file
in the directory and subdirectories will be addedpo - The IProgressObserverthat is observing the operation
progress, or null if no one observes it
SCMStorageException
SCMSecurityException
public ISearchResults getAllContents()
throws SCMStorageException
Contentstored in the project
SCMStorageException - If there's a problem with the index
Content getContent(java.lang.String uri)
throws SCMStorageException
uri - The contents URI
SCMStorageException - Thrown if there's an error retrieving the contentpublic java.util.Map getProjectRoles(User actor)
public Content getContent(User actor,
java.lang.String uri)
throws SCMStorageException,
SCMSecurityException
actor - The user that request the contenturi - The contents URI
SCMStorageException - Thrown if there's a problem retrieving the content
SCMSecurityException - Thrown if the user cannot get the content
Content getRepositoryContent(java.lang.String uri)
throws SCMStorageException
uri -
SCMStorageException
public Content getRepositoryContent(User actor,
java.lang.String uri)
throws SCMStorageException,
SCMSecurityException
actor - The user that looks up the contenturi - The content's URI
SCMStorageException
SCMSecurityException
ISearchResults search(Query query,
boolean visible)
throws SCMStorageException
query - visible -
SCMStorageException
ISearchResults search(Query query,
boolean visible,
boolean reverseOrder)
throws SCMStorageException
query - visible -
SCMStorageException
ISearchResults searchOld(Query query)
throws SCMStorageException
toDate property is
before today)
query -
SCMStorageException
ISearchResults searchFuture(Query query)
throws SCMStorageException
toDate property is
before today)
query -
SCMStorageException
public void regenerateIndex(User user)
throws SCMSecurityException,
SCMStorageException
user -
SCMSecurityException
SCMStorageException
void regenerateIndex()
throws SCMStorageException
SCMStorageException
public void serializeXML(org.kxml2.io.KXmlSerializer out)
throws java.io.IOException
IXMLSerializable
serializeXML in interface IXMLSerializableserializeXML in class Categoryout - The KXmlSerializer to do the output
java.io.IOException - Thrown if there's an IO problem
public void deserializeXML(org.kxml2.io.KXmlParser in)
throws org.xmlpull.v1.XmlPullParserException,
java.io.IOException
IXMLSerializable
deserializeXML in interface IXMLSerializabledeserializeXML in class Categoryin - The KXml pull parser
org.xmlpull.v1.XmlPullParserException - Thrown if there's an XML problem
java.io.IOException - Thrown if there's an IO problem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||