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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 package org.collectionspace.services.common.document;
20 import org.collectionspace.services.common.document.DocumentHandler.Action;
23 * MultipartDocumentHandler is a DocumentHandler provides document processing
24 * methods for entities using schema extension that are mapped to multipart
25 * request and response.
32 public interface MultipartDocumentHandler<T, TL, WT, WTL>
33 extends DocumentHandler<T, TL, WT, WTL> {
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
42 public void extractAllParts(DocumentWrapper<WT> docWrap) throws Exception;
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
53 public void fillAllParts(DocumentWrapper<WT> docWrap, Action action) throws Exception;