1 package org.jahia.deprecated.taglibs.field; 2 3 import javax.servlet.jsp.JspException ; 4 5 import org.jahia.data.JahiaData; 6 import org.jahia.data.fields.FieldTypes; 7 import org.jahia.gui.GuiBean; 8 9 10 16 public class SharedLangTextFieldTag extends AbstractFieldTag { 17 18 private int maxchar = 0; 19 20 public void setMaxchar(int maxchar) { 21 this.maxchar = maxchar; 22 } 23 24 public int getFieldType() { 25 return FieldTypes.SMALLTEXT_SHARED_LANG; 26 } 27 28 29 public String readValue(JahiaData jData, String value) { 30 if (this.maxchar == 0) { 31 return value; 32 } else { 33 return GuiBean.glueTitle(value, this.maxchar); 34 } 35 } 36 37 public int doEndTag() throws JspException { 38 super.doEndTag(); 41 maxchar = 0; 42 return EVAL_PAGE; 43 } 44 45 } | Popular Tags |