View Javadoc

1   /**
2    * This file Copyright (c) 2003-2011 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.module.admininterface;
35  
36  import info.magnolia.cms.beans.runtime.MultipartForm;
37  import info.magnolia.cms.core.ItemType;
38  
39  
40  /**
41   * This class handles the saving in the dialogs.
42   * @author Philipp Bracher
43   * @version $Revision: 41137 $ ($Author: gjoseph $)
44   */
45  public interface SaveHandler {
46  
47      /**
48       * Initialize this SaveHandler
49       */
50      public void init(MultipartForm form);
51  
52      /**
53       * Save the data passed by init. Returns true if the save method succeeded
54       */
55      public abstract boolean save();
56  
57      /**
58       * True if a not existing path should get created during the save process
59       * @return boolean
60       */
61      public abstract boolean isCreate();
62  
63      /**
64       * Set true if a not existing node should get created during the save process
65       * @param create
66       */
67      public abstract void setCreate(boolean create);
68  
69      /**
70       * Defines the node type to create if isCreate is true
71       * @return the ItemType
72       */
73      public abstract ItemType getCreationItemType();
74  
75      /**
76       * Defines the node type to create if isCreate is true
77       * @param creationItemType
78       */
79      public abstract void setCreationItemType(ItemType creationItemType);
80  
81      /**
82       * @return Returns the nodeCollectionName.
83       */
84      public abstract String getNodeCollectionName();
85  
86      /**
87       * @param nodeCollectionName The nodeCollectionName to set.
88       */
89      public abstract void setNodeCollectionName(String nodeCollectionName);
90  
91      /**
92       * @return Returns the nodeName.
93       */
94      public abstract String getNodeName();
95  
96      /**
97       * @param nodeName The nodeName to set.
98       */
99      public abstract void setNodeName(String nodeName);
100 
101     /**
102      * @return Returns the paragraph.
103      */
104     public abstract String getParagraph();
105 
106     /**
107      * @param paragraph The paragraph to set.
108      */
109     public abstract void setParagraph(String paragraph);
110 
111     /**
112      * @return Returns the path.
113      */
114     public abstract String getPath();
115 
116     /**
117      * @param path The path to set.
118      */
119     public abstract void setPath(String path);
120 
121     /**
122      * set the name of the repository saving to
123      * @param repository the name of the repository
124      */
125     public void setRepository(String repository);
126 
127     /**
128      * get the name of thre repository saving to
129      * @return name
130      */
131     public String getRepository();
132 
133 }