1 13 package org.jahia.engines.shared; 14 15 import java.util.Enumeration ; 16 import java.util.Hashtable ; 17 18 import org.jahia.services.pages.JahiaPage; 19 import java.io.Serializable ; 20 21 25 public class JahiaPageEngineTempBean implements Serializable { 26 27 private int id; 28 private int siteID; 29 private int parentID; 30 private int pageType; 31 private Hashtable titles = new Hashtable (); 32 private int pageTemplateID; 33 private String remoteURL; 34 private int pageLinkID; 35 private String creator; 36 private int linkFieldID; 37 private String operation = Page_Field.RESET_LINK; 38 private boolean sharedTitle; 39 private boolean deleteOldContainer = true; 40 41 public JahiaPageEngineTempBean( int id, 42 int siteID, 43 int parentID, 44 int pageType, 45 int pageTemplateID, 46 String remoteURL, 47 int pageLinkID, 48 String creator, 49 int linkFieldID ) { 50 this.id = id; 51 this.siteID = siteID; 52 this.parentID = parentID; 53 this.pageType = pageType; 54 this.pageTemplateID = pageTemplateID; 55 this.remoteURL = remoteURL; 56 this.pageLinkID = pageLinkID; 57 this.creator = creator; 58 this.linkFieldID = linkFieldID; 59 } 61 public int getID() { return this.id; } 63 64 68 public int getSiteID() { 69 return siteID; 70 } 71 72 public int getParentID() { return parentID; } 74 75 public int getPageType() { return pageType; } 77 78 public String getTitle(String languageCode) { return (String )titles.get(languageCode); } 80 81 public int getPageTemplateID() { return pageTemplateID; } 83 84 public String getRemoteURL() { return remoteURL; } 86 87 public int getPageLinkID() { return pageLinkID; } 89 90 public String getCreator() { return creator; } 92 93 public int getLinkFieldID() { return linkFieldID; } 95 96 public void setSiteID(int siteID) { this.siteID = siteID; } 98 99 public void setParentID(int parentID) { this.parentID = parentID; } 101 102 public void setPageType(int pageType) { 104 this.pageType = pageType; 105 } 106 107 public void setTitle(String languageCode,String title) { 109 if (languageCode == null || title == null) { 110 return; 111 } 112 this.titles.put(languageCode,title); 113 } 114 115 public void removeTitle(String languageCode) { 117 this.titles.remove(languageCode); 118 } 119 120 public void setPageTemplateID(int pageTemplateID) { 122 this.pageTemplateID = pageTemplateID; 123 } 124 125 public void setRemoteURL(String remoteURL) { 127 this.remoteURL = remoteURL; 128 } 129 130 public void setPageLinkID(int pageLinkID) { 132 this.pageLinkID = pageLinkID; 133 } 134 135 public void setCreator(String creator) { 137 this.creator = creator; 138 } 139 140 public Hashtable getTitles() { 141 return this.titles; 142 } 143 144 public void setTitles(Hashtable titles) { 145 this.titles = titles; 146 } 147 148 public void setOperation(String _operation) { 149 operation = _operation; 150 } 151 152 public String getOperation() { 153 return operation; 154 } 155 156 public void sharedTitle(boolean _sharedTitle) { 157 sharedTitle = _sharedTitle; 158 } 159 160 public boolean isSharedTitle() { 161 return sharedTitle; 162 } 163 164 public boolean deleteOldContainer(){ 165 return this.deleteOldContainer; 166 } 167 168 public void setDeleteOldContainer(boolean value){ 169 this.deleteOldContainer = value; 170 } 171 172 public String toString() { 173 174 StringBuffer pageAttribute = 175 new StringBuffer ("JahiaPageEngineTempBean detail :\n"); 176 pageAttribute.append("- siteID : [" + siteID + "]\n"); 177 pageAttribute.append("- parentID : [" + parentID + "]\n"); 178 String typeName = pageType == -1 ? "No type defined" : JahiaPage.PAGE_TYPE_NAMES[pageType]; 179 pageAttribute.append("- pageType : [" + typeName + "]\n"); 180 pageAttribute.append("- pageTemplateID : [" + pageTemplateID + "]\n"); 181 pageAttribute.append("- remoteURL : [" + remoteURL + "]\n"); 182 pageAttribute.append("- pageLinkID : [" + pageLinkID + "]\n"); 183 pageAttribute.append("- creator : [" + creator + "]\n"); 184 pageAttribute.append("- linkFieldID : [" + linkFieldID + "]\n"); 185 pageAttribute.append("- operation : [" + operation + "]\n"); 186 pageAttribute.append("- titles : ["); 187 Enumeration titlesEnum = titles.elements(); 188 while (titlesEnum.hasMoreElements()) { 189 pageAttribute.append((String )titlesEnum.nextElement()); 190 if (titlesEnum.hasMoreElements()) { 191 pageAttribute.append(", "); 192 } 193 } 194 pageAttribute.append("]\n"); 195 return pageAttribute.toString(); 196 } 197 198 } 199 | Popular Tags |