]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
7617e7c68d60ff2150b7f7fed4b8b47f747bc30a
[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 package org.collectionspace.services.common.document;
19
20 import org.collectionspace.services.common.document.DocumentHandler.Action;
21
22 /**
23  * MultipartDocumentHandler is a DocumentHandler provides document processing
24  * methods for entities using schema extension that are mapped to multipart
25  * request and response.
26  * @author
27  * @param <T>
28  * @param <TL>
29  * @param <WT>
30  * @param <WTL>
31  */
32 public interface MultipartDocumentHandler<T, TL, WT, WTL>
33         extends DocumentHandler<T, TL, WT, WTL> {
34
35     /**
36      * extractAllParts extracts all parts of a CS object from given document.
37      * this is usually called AFTER the get operation is invoked on the repository
38      * Called in handle GET/GET_ALL actions.
39      * @param docWrap document
40      * @throws Exception
41      */
42     public void extractAllParts(DocumentWrapper<WT> docWrap) throws Exception;
43
44     /**
45      * fillAllParts sets parts of CS object into given document
46      * this is usually called BEFORE create/update operations are invoked on the
47      * repository. Called in handle CREATE/UPDATE actions.
48      * @param obj input object
49      * @param docWrap target document
50      * @param action one of Action.CREATE or Action.UPDATE
51      * @throws Exception
52      */
53     public void fillAllParts(DocumentWrapper<WT> docWrap, Action action) throws Exception;
54 }