1 /** 2 * This file Copyright (c) 2003-2014 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$ ($Author$) 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 public abstract ItemType getCollectionNodeCreationItemType(); 82 83 public abstract void setCollectionNodeCreationItemType(ItemType collectionNodeCreationItemType); 84 85 /** 86 * @return Returns the nodeCollectionName. 87 */ 88 public abstract String getNodeCollectionName(); 89 90 /** 91 * @param nodeCollectionName The nodeCollectionName to set. 92 */ 93 public abstract void setNodeCollectionName(String nodeCollectionName); 94 95 /** 96 * @return Returns the nodeName. 97 */ 98 public abstract String getNodeName(); 99 100 /** 101 * @param nodeName The nodeName to set. 102 */ 103 public abstract void setNodeName(String nodeName); 104 105 /** 106 * @return Returns the paragraph. 107 */ 108 public abstract String getParagraph(); 109 110 /** 111 * @param paragraph The paragraph to set. 112 */ 113 public abstract void setParagraph(String paragraph); 114 115 /** 116 * @return Returns the path. 117 */ 118 public abstract String getPath(); 119 120 /** 121 * @param path The path to set. 122 */ 123 public abstract void setPath(String path); 124 125 /** 126 * set the name of the repository saving to 127 * @param repository the name of the repository 128 */ 129 public void setRepository(String repository); 130 131 /** 132 * get the name of thre repository saving to 133 * @return name 134 */ 135 public String getRepository(); 136 137 }