]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
a3df7b584684e61ca4c64f528a1a487c02671bb6
[tmp/jakarta-migration.git] /
1 /**
2  *  This document is a part of the source code and related artifacts
3  *  for CollectionSpace, an open source collections management system
4  *  for museums and related institutions:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 package org.collectionspace.services.common.vocabulary.nuxeo;
25
26 import org.collectionspace.services.common.document.DocumentWrapper;
27
28 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
29 import org.nuxeo.ecm.core.api.DocumentModel;
30
31 /**
32  * AuthorityDocumentModelHandler
33  *
34  * $LastChangedRevision: $
35  * $LastChangedDate: $
36  */
37 public abstract class AuthorityDocumentModelHandler<AuthCommon, AuthCommonList>
38         extends RemoteDocumentModelHandlerImpl<AuthCommon, AuthCommonList> {
39
40     /**
41      * authority is used to stash JAXB object to use when handle is called
42      * for Action.CREATE, Action.UPDATE or Action.GET
43      */
44     private AuthCommon authority;
45     /**
46      * authorityList is stashed when handle is called
47      * for ACTION.GET_ALL
48      */
49     private AuthCommonList authorityList;
50
51
52     /**
53      * getCommonPart get associated authority
54      * @return
55      */
56     @Override
57     public AuthCommon getCommonPart() {
58         return authority;
59     }
60
61     /**
62      * setCommonPart set associated authority
63      * @param authority
64      */
65     @Override
66     public void setCommonPart(AuthCommon authority) {
67         this.authority = authority;
68     }
69
70     /**
71      * getCommonPartList get associated authority (for index/GET_ALL)
72      * @return
73      */
74     @Override
75     public AuthCommonList getCommonPartList() {
76         return authorityList;
77     }
78
79     /* (non-Javadoc)
80      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPartList(java.lang.Object)
81      */
82     @Override
83     public void setCommonPartList(AuthCommonList authorityList) {
84         this.authorityList = authorityList;
85     }
86
87     /* (non-Javadoc)
88      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPart(org.collectionspace.services.common.document.DocumentWrapper)
89      */
90     @Override
91     public AuthCommon extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc)
92             throws Exception {
93         throw new UnsupportedOperationException();
94     }
95
96     /* (non-Javadoc)
97      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#fillCommonPart(java.lang.Object, org.collectionspace.services.common.document.DocumentWrapper)
98      */
99     @Override
100     public void fillCommonPart(AuthCommon vocabularyObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
101         throw new UnsupportedOperationException();
102     }
103
104 }
105