1 package com.dotmarketing.portlets.structure.model; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 import com.dotmarketing.beans.Inode; 7 import com.dotmarketing.portlets.structure.factories.FieldFactory; 8 9 10 11 public class Field extends Inode 12 { 13 14 private static final long serialVersionUID = 1L; 15 16 private long structureInode; 17 private String fieldName; 18 private String fieldType; 19 private String fieldRelationType; 20 private String fieldContentlet; 21 private boolean required; 22 private String velocityVarName; 23 private int sortOrder; 24 private String values; 25 private String regexCheck; 26 private String hint; 27 private String defaultValue; 28 private boolean indexed; 29 private boolean listed; 30 31 32 public Field(){ 33 super.setType("field"); 34 } 35 36 37 public String getFieldContentlet() { 38 return fieldContentlet; 39 } 40 public void setFieldContentlet(String fieldContentlet) { 41 this.fieldContentlet = fieldContentlet; 42 } 43 public String getFieldName() { 44 return fieldName; 45 } 46 public void setFieldName(String fieldName) { 47 this.fieldName = fieldName; 48 } 49 public String getFieldRelationType() { 50 return fieldRelationType; 51 } 52 public void setFieldRelationType(String fieldRelationType) { 53 this.fieldRelationType = fieldRelationType; 54 } 55 public String getFieldType() { 56 return fieldType; 57 } 58 public void setFieldType(String fieldType) { 59 this.fieldType = fieldType; 60 } 61 public boolean isRequired() { 62 return required; 63 } 64 public void setRequired(boolean required) { 65 this.required = required; 66 } 67 public int getSortOrder() { 68 return sortOrder; 69 } 70 public void setSortOrder(int sortOrder) { 71 this.sortOrder = sortOrder; 72 } 73 public long getStructureInode() { 74 return structureInode; 75 } 76 public void setStructureInode(long structureInode) { 77 this.structureInode = structureInode; 78 } 79 public String getValues() { 80 return values; 81 } 82 public void setValues(String values) { 83 this.values = values; 84 } 85 public String getVelocityVarName() { 86 return velocityVarName; 87 } 88 public void setVelocityVarName(String velocityVarName) { 89 this.velocityVarName = velocityVarName; 90 } 91 public String getRegexCheck() { 92 return regexCheck; 93 } 94 public void setRegexCheck(String regexCheck) { 95 this.regexCheck = regexCheck; 96 } 97 98 101 public String getDefaultValue() { 102 return defaultValue; 103 } 104 107 public void setDefaultValue(String defaultValue) { 108 this.defaultValue = defaultValue; 109 } 110 113 public String getHint() { 114 return hint; 115 } 116 119 public void setHint(String hint) { 120 this.hint = hint; 121 } 122 public void delete() 123 { 124 FieldFactory.deleteField(this); 125 } 126 public boolean isIndexed() { 127 return indexed; 128 } 129 public void setIndexed(boolean indexed) { 130 this.indexed = indexed; 131 } 132 133 public boolean isListed() { 134 return listed; 135 } 136 public void setListed(boolean listed) { 137 this.listed = listed; 138 } 139 140 public Map getMap () { 141 Map oMap = new HashMap (); 142 oMap.put("defaultValue", this.getDefaultValue()); 143 oMap.put("fieldContentlet", this.getFieldContentlet()); 144 oMap.put("fieldName", this.getFieldName()); 145 oMap.put("fieldRelationType", this.getFieldRelationType()); 146 oMap.put("fieldFieldType", this.getFieldType()); 147 oMap.put("fieldHint", this.getHint()); 148 oMap.put("fieldRegexCheck", this.getRegexCheck()); 149 oMap.put("fieldValues", this.getValues()); 150 oMap.put("fieldVelocityVarName", this.getVelocityVarName()); 151 oMap.put("fieldSortOrder", this.getSortOrder()); 152 oMap.put("fieldStructureInode", this.getStructureInode()); 153 oMap.put("inode", this.getInode()); 154 return oMap; 155 } 156 } 157 | Popular Tags |