Java Doc for Repository.java in  » Content-Management-System » daisy » org » outerj » daisy » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » daisy » org.outerj.daisy.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.outerj.daisy.repository.Repository

All known Subclasses:   org.outerj.daisy.repository.commonimpl.RepositoryImpl,
Repository
public interface Repository (Code)
Start point for a user to access the repository.

An instance of this object is obtained from the RepositoryManager and is contextualized for a certain user. Thus instead of having to supply credentials to each method, you authenticate once via the RepositoryManager and can then do all further operations on this Repository object.

A Repository object should not be assumed to be thread safe.





Method Summary
 voidaddListener(RepositoryListener listener)
     Add an event listener.

See also the comments in RepositoryListener .

Not all events are per-se also implemented in the repository client, and for so far as they are, they only provide events for operations done through that client, and not other ones happening on the server or through other clients.

This listener functionality is mostly meant for internal use, usually to clear caches.

 DocumentcreateDocument(String name, long documentTypeId, long branchId, long languageId)
     Creates a new document.
 DocumentcreateDocument(String name, String documentTypeName, String branchName, String languageName)
     Same as Repository.createDocument(String,long,long,long) but takes names instead of ids.
 DocumentcreateDocument(String name, long documentTypeId)
     Same as Repository.createDocument(String,long,long,long) but assumes branch id 1 and language id 1.
 DocumentcreateDocument(String name, String documentTypeName)
     Same as Repository.createDocument(String,long) but takes a document type name instead of an id.
 DocumentcreateVariant(String documentId, long startBranchId, long startLanguageId, long startVersionId, long newBranchId, long newLanguageId, boolean copyContent)
     Creates a new variant on a document.
 DocumentcreateVariant(String documentId, String startBranchName, String startLanguageName, long startVersionId, String newBranchName, String newLanguageName, boolean copyContent)
    
 voiddeleteDocument(String documentId)
     Deletes a document permanently (unrecoverable) from the repository (including all its variants).
 voiddeleteVariant(String documentId, long branchId, long languageId)
    
 voiddeleteVariant(VariantKey variantKey)
     Deletes a document variant permanently (unrecoverable) from the repository.
 AccessManagergetAccessManager()
    
 long[]getActiveRoleIds()
     The roles of the user that are currently active.
 String[]getActiveRolesDisplayNames()
     Returns the names of the active roles.
 long[]getAvailableRoles()
     The id's of the available roles of the user.
 AvailableVariantsgetAvailableVariants(String documentId)
     Gets the available variants of a document.
 StringgetClientVersion()
     Gets the version of the Daisy client API.
 CollectionManagergetCollectionManager()
     Returns the Collection Manager for this Repository.
 CommentManagergetCommentManager()
    
 DocumentgetDocument(String documentId, long branchId, long languageId, boolean updateable)
     Gets a document from the repository.
Parameters:
  updateable - if false, you won't be able to make modificationsto the document (and thus to save it).
 DocumentgetDocument(String documentId, String branchName, String languageName, boolean updateable)
     Gets a document from the repository.
 DocumentgetDocument(VariantKey key, boolean updateable)
     Gets a document from the repository.
 DocumentgetDocument(String documentId, boolean updateable)
    
 DocumentgetDocument(long documentId, boolean updateable)
    
 ObjectgetExtension(String name)
     Retrieves an extension of the standard repository functionality.
 StringgetNamespace()
     Returns the namespace for the current repository.
 NamespaceManagergetNamespaceManager()
    
 InputStreamgetPartData(String documentId, long branchId, long languageId, long versionId, long partTypeId)
     Retrieves the specified blob without the need to go through the Document object.
 InputStreamgetPartData(String documentId, long versionId, long partTypeId)
     Retrieves part data for the branch "main", language "default".
 QueryManagergetQueryManager()
    
 RepositorySchemagetRepositorySchema()
    
 StringgetServerVersion()
     Returns the version number of the Daisy repository server.
 StringgetUserDisplayName()
     The name of the user with who this Repository instance is associated, the same as returned from org.outerj.daisy.repository.user.User.getDisplayName .
 longgetUserId()
     Id of the user with who this Repository instance is associated.
 UserInfoDocumentgetUserInfoAsXml()
     Returns an XML document containing some information about the user with which this Repository instance is associated.
 StringgetUserLogin()
     The login of the user with who this Repository instance is associated.
 UserManagergetUserManager()
    
 VariantManagergetVariantManager()
    
 booleanhasExtension(String name)
    
 booleanisInRole(long roleId)
    
 booleanisInRole(String roleName)
    
 StringnormalizeDocumentId(String documentId)
     Makes sure the document ID is of the form "docSeqId-namespace", if the namespace is missing the default repository namespace is added.
 voidremoveListener(RepositoryListener listener)
     Removes an event listener.
 voidsetActiveRoleIds(long[] roleIds)
     Sets the active roles of the user.
 voidswitchRole(long roleId)
     Changes the user's role for this Repository instance.



Method Detail
addListener
void addListener(RepositoryListener listener)(Code)
Add an event listener.

See also the comments in RepositoryListener .

Not all events are per-se also implemented in the repository client, and for so far as they are, they only provide events for operations done through that client, and not other ones happening on the server or through other clients.

This listener functionality is mostly meant for internal use, usually to clear caches. For most usecases you should use the JMS-based (assynchronous) event notification system.

A listener stays in effect until it is removed using Repository.removeListener(org.outerj.daisy.repository.RepositoryListener) .




createDocument
Document createDocument(String name, long documentTypeId, long branchId, long languageId)(Code)
Creates a new document. You need to supply:
  • a name for the document (which is not required to be unique)
  • a document type id. This is the id of one of the document types defined in the RepositorySchema .
  • a branch id
  • a language id

The document will not be stored physically in the repository until Document.save is called. Thus calling this method has no permanent side effects.




createDocument
Document createDocument(String name, String documentTypeName, String branchName, String languageName)(Code)
Same as Repository.createDocument(String,long,long,long) but takes names instead of ids.



createDocument
Document createDocument(String name, long documentTypeId)(Code)
Same as Repository.createDocument(String,long,long,long) but assumes branch id 1 and language id 1.



createDocument
Document createDocument(String name, String documentTypeName)(Code)
Same as Repository.createDocument(String,long) but takes a document type name instead of an id.



createVariant
Document createVariant(String documentId, long startBranchId, long startLanguageId, long startVersionId, long newBranchId, long newLanguageId, boolean copyContent) throws RepositoryException(Code)
Creates a new variant on a document. If the copyContent argument is true, the new variant will be immediately persisted and its first version will be initialiased with the data from the start variant. The start variant and version will also be stored in the variant (retrievable via Document.getVariantCreatedFromBranchId etc. methods). If copyContent is false, a document object for the new variant will be returned, with no data copied from the start variant (except for the document name), and the new variant will not yet be persisted (i.o.w. you need to call save on the returned Document object to do this). Thus using copyContent = false allows to create a variant from scratch, while copyContent = true branches of from an existing variant.
Parameters:
  startVersionId - -1 for last version, -2 for live version



createVariant
Document createVariant(String documentId, String startBranchName, String startLanguageName, long startVersionId, String newBranchName, String newLanguageName, boolean copyContent) throws RepositoryException(Code)



deleteDocument
void deleteDocument(String documentId) throws RepositoryException(Code)
Deletes a document permanently (unrecoverable) from the repository (including all its variants).



deleteVariant
void deleteVariant(String documentId, long branchId, long languageId) throws RepositoryException(Code)

See Also:   Repository.deleteVariant(VariantKey)



deleteVariant
void deleteVariant(VariantKey variantKey) throws RepositoryException(Code)
Deletes a document variant permanently (unrecoverable) from the repository.

To delete a document variant virtually, but not permanently, you can set it retired (see Document.setRetired(boolean) ).




getAccessManager
AccessManager getAccessManager()(Code)



getActiveRoleIds
long[] getActiveRoleIds()(Code)
The roles of the user that are currently active. These can be changed through Repository.setActiveRoleIds .



getActiveRolesDisplayNames
String[] getActiveRolesDisplayNames()(Code)
Returns the names of the active roles.



getAvailableRoles
long[] getAvailableRoles()(Code)
The id's of the available roles of the user.



getAvailableVariants
AvailableVariants getAvailableVariants(String documentId) throws RepositoryException(Code)
Gets the available variants of a document. This returns all variants, also the variants the user may not have access too, and retired variants. Everyone can retrieve the list of available variants of each document, there is no security constraint to this. This information is not really sensitive, and access control works on document variants and not on documents, so it would be a bit difficult to do this.



getClientVersion
String getClientVersion()(Code)
Gets the version of the Daisy client API. Inside the repository server, this will be the same as Repository.getServerVersion() .

At the time of this writing, in the remote API implementation this will usually also be the same, as the client and server API implementations evolve together and get the same version numbers assigned.




getCollectionManager
CollectionManager getCollectionManager()(Code)
Returns the Collection Manager for this Repository.



getCommentManager
CommentManager getCommentManager()(Code)



getDocument
Document getDocument(String documentId, long branchId, long languageId, boolean updateable) throws RepositoryException(Code)
Gets a document from the repository.
Parameters:
  updateable - if false, you won't be able to make modificationsto the document (and thus to save it). The repositorycan return a cached copy in this case.
throws:
  DocumentNotFoundException - in case the document does not exist
throws:
  DocumentVariantNotFoundException - in case the document exists, but the variant not
throws:
  org.outerj.daisy.repository.namespace.NamespaceNotFoundException - in case the document ID contains an invalid namespace
throws:
  DocumentReadDeniedException - if read access to the document is denied.



getDocument
Document getDocument(String documentId, String branchName, String languageName, boolean updateable) throws RepositoryException(Code)
Gets a document from the repository.

In case the branch or language does not exist, this will throw a Branch/LanugageNotFoundexception.
Parameters:
  branchName - a branch name, or a branch id as string
Parameters:
  languageName - a language name, or a language id as string




getDocument
Document getDocument(VariantKey key, boolean updateable) throws RepositoryException(Code)
Gets a document from the repository.

In case the branch or language ID specified in the VariantKey do not exist, this will not throw a Branch/LanguageNotFoundException, rather a Document(Variant)NotFoundException.




getDocument
Document getDocument(String documentId, boolean updateable) throws RepositoryException(Code)



getDocument
Document getDocument(long documentId, boolean updateable) throws RepositoryException(Code)
Repository.getDocument(String,boolean)



getExtension
Object getExtension(String name)(Code)
Retrieves an extension of the standard repository functionality. Extensions are additional available repository services. What these services are is not defined by this API.

The reason for making this extension functionality part of the Repository API, instead of using completely separate and standalone components, is that in this way the extensions can operate in the authenticated context of the current user (ie Repository instance).

So, for as far as the extension performs any operations that depend on the current user and its role, the extension will operate using the same credentials as associated with the Repository object from which the extension instance has been retrieved.




getNamespace
String getNamespace()(Code)
Returns the namespace for the current repository. All entities (documents) created in this repository are by default created in this namespace.
since:
   Daisy 2.0



getNamespaceManager
NamespaceManager getNamespaceManager()(Code)

since:
   Daisy 2.0



getPartData
InputStream getPartData(String documentId, long branchId, long languageId, long versionId, long partTypeId) throws RepositoryException(Code)
Retrieves the specified blob without the need to go through the Document object. Of course, all access control checks still apply.
throws:
  DocumentReadDeniedException - if read access to the document is denied.



getPartData
InputStream getPartData(String documentId, long versionId, long partTypeId) throws RepositoryException(Code)
Retrieves part data for the branch "main", language "default".



getQueryManager
QueryManager getQueryManager()(Code)



getRepositorySchema
RepositorySchema getRepositorySchema()(Code)



getServerVersion
String getServerVersion()(Code)
Returns the version number of the Daisy repository server. Usually follows the format "major.minor.patch", in which the ".patch" is optional, and the version string can be followed with a suffix like "-dev".



getUserDisplayName
String getUserDisplayName()(Code)
The name of the user with who this Repository instance is associated, the same as returned from org.outerj.daisy.repository.user.User.getDisplayName .



getUserId
long getUserId()(Code)
Id of the user with who this Repository instance is associated.



getUserInfoAsXml
UserInfoDocument getUserInfoAsXml()(Code)
Returns an XML document containing some information about the user with which this Repository instance is associated.



getUserLogin
String getUserLogin()(Code)
The login of the user with who this Repository instance is associated.



getUserManager
UserManager getUserManager()(Code)
Returns the User Manager for this Repository



getVariantManager
VariantManager getVariantManager()(Code)



hasExtension
boolean hasExtension(String name)(Code)



isInRole
boolean isInRole(long roleId)(Code)



isInRole
boolean isInRole(String roleName)(Code)



normalizeDocumentId
String normalizeDocumentId(String documentId)(Code)
Makes sure the document ID is of the form "docSeqId-namespace", if the namespace is missing the default repository namespace is added. It is not checked whether the namespace in the document ID actually exists. Whitespace around the input string is not trimmed, the presence of such whitespace will cause the documentID to be considered invalid.

This is an utility method.
throws:
  IllegalArgumentException - if a null documentId is supplied
throws:
  InvalidDocumentIdException - if the document ID is not validly structured.




removeListener
void removeListener(RepositoryListener listener)(Code)
Removes an event listener.



setActiveRoleIds
void setActiveRoleIds(long[] roleIds)(Code)
Sets the active roles of the user.
Parameters:
  roleIds - a subset of, or equal to, the roles returned by Repository.getAvailableRoles().



switchRole
void switchRole(long roleId)(Code)
Changes the user's role for this Repository instance. This is the same as calling Repository.setActiveRoleIds(long[]) with a one-length array.
Parameters:
  roleId - a valid roleId, thus one of those returned by Repository.getAvailableRoles().



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.