Source Code Cross Referenced for DocumentStrategy.java in  » Content-Management-System » daisy » org » outerj » daisy » repository » commonimpl » 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.commonimpl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 Outerthought bvba and Schaubroeck nv
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.outerj.daisy.repository.commonimpl;
017:
018:        import org.outerj.daisy.repository.ChangeType;
019:        import org.outerj.daisy.repository.RepositoryException;
020:        import org.outerj.daisy.repository.LockType;
021:        import org.outerj.daisy.repository.VersionKey;
022:        import org.outerj.daisy.repository.VersionState;
023:        import org.outerj.daisy.repository.Document;
024:
025:        import java.io.InputStream;
026:
027:        /**
028:         * Allows to customise some of the behaviour of the {@link CommonRepository}, and especially
029:         * {@link DocumentImpl}.
030:         *
031:         * <p>The typical use of this is to provide two implementations of the repository API's:
032:         * one for local (in-server) use, and one for remote (= client) use, by only having to
033:         * implement twice those aspects which differ in each implementation.
034:         *
035:         * <p>The most important difference between the client and server API implementations
036:         * will be how they load and store entities (such as Document objects): the client API
037:         * implementation will do this by contacting the server, the server implementation will
038:         * do this by using its persistence mechanisms (such as an RDBMS).
039:         *
040:         * <p>Note that this API is not really meant for public consumption, and the correct
041:         * workings of its implementations (especially the server-side one) are crucial for
042:         * the correct operation of the repository. It is important that the strategy implementation
043:         * correctly initialiases, updates and interprets the internal state of the objects it handles.
044:         *
045:         * <p>Certain methonds, like {@link #load(DocId, long, long, AuthenticatedUser)}
046:         * and {@link #store(org.outerj.daisy.repository.commonimpl.DocumentImpl)} need to check
047:         * if the user has the rights to perform this operation. This is especially true for the serverside
048:         * implementation, the client side implementation doesn't need to do this as it will contact the
049:         * server which will automatically do this checks.
050:         *
051:         * <p>Certain methods, like {@link #store(org.outerj.daisy.repository.commonimpl.DocumentImpl)} might
052:         * also need to send out events to eventlisteners.
053:         */
054:        public interface DocumentStrategy {
055:            public Document load(DocId docId, long branchId, long languageId,
056:                    AuthenticatedUser user) throws RepositoryException;
057:
058:            /**
059:             * Stores a document. After successful storage, the document object status should be
060:             * updates, i.e. the lastModified and lastModifier parts should be updated, and some
061:             * dirty-indication flags should be reset.
062:             */
063:            public void store(DocumentImpl document) throws RepositoryException;
064:
065:            /**
066:             *
067:             * @param startVersionId -1 for last version, -2 for live version
068:             */
069:            public Document createVariant(DocId docId, long startBranchId,
070:                    long startLanguageId, long startVersionId,
071:                    long newBranchId, long newLanguageId, AuthenticatedUser user)
072:                    throws RepositoryException;
073:
074:            public AvailableVariantImpl[] getAvailableVariants(DocId docId,
075:                    AuthenticatedUser user) throws RepositoryException;
076:
077:            public void deleteDocument(DocId docId, AuthenticatedUser user)
078:                    throws RepositoryException;
079:
080:            public void deleteVariant(DocId docId, long branchId,
081:                    long languageId, AuthenticatedUser user)
082:                    throws RepositoryException;
083:
084:            public VersionImpl loadVersion(DocumentVariantImpl documentVariant,
085:                    long versionId) throws RepositoryException;
086:
087:            /**
088:             * Loads the additional information skipped when the version was loaded via
089:             * {@link #loadShallowVersions(org.outerj.daisy.repository.commonimpl.DocumentVariantImpl)}.
090:             */
091:            public void completeVersion(DocumentVariantImpl variant,
092:                    VersionImpl version) throws RepositoryException;
093:
094:            /**
095:             * Loads all Version objects for this document as shallow Version objects (i.e. without
096:             * their full content, but only the data necessary to show a version overview table).
097:             */
098:            public VersionImpl[] loadShallowVersions(DocumentVariantImpl variant)
099:                    throws RepositoryException;
100:
101:            public void storeVersion(DocumentImpl document,
102:                    VersionImpl version, VersionState versionState,
103:                    VersionKey syncedWith, ChangeType changeType,
104:                    String changeComment) throws RepositoryException;
105:
106:            public InputStream getBlob(DocId docId, long branchId,
107:                    long languageId, long versionId, long partTypeId,
108:                    AuthenticatedUser user) throws RepositoryException;
109:
110:            /**
111:             * This method does not check access rights (unlike {@link #getBlob(DocId, long, long, long, long, AuthenticatedUser)},
112:             * because this one is only intended for use by Part objects.
113:             */
114:            public InputStream getBlob(String blobKey)
115:                    throws RepositoryException;
116:
117:            /**
118:             * Tries to create a lock on the document. If there was alread a pessimitic lock on
119:             * the document, this method will return a LockInfo object containing information about
120:             * that lock, so it is important to check the info in the LockInfo object to know if
121:             * the lock was successful.
122:             */
123:            public LockInfoImpl lock(DocumentVariantImpl documentVariant,
124:                    long duration, LockType lockType)
125:                    throws RepositoryException;
126:
127:            public LockInfoImpl getLockInfo(DocumentVariantImpl documentVariant)
128:                    throws RepositoryException;
129:
130:            public LockInfoImpl releaseLock(DocumentVariantImpl documentVariant)
131:                    throws RepositoryException;
132:
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.