1 package org.infoglue.deliver.taglib.content; 2 3 import java.util.Date ; 4 import java.util.HashMap ; 5 import java.util.Map ; 6 7 import javax.servlet.jsp.JspException ; 8 import javax.servlet.jsp.JspTagException ; 9 10 import org.infoglue.cms.security.InfoGluePrincipal; 11 12 15 16 public class UpdateContentTag extends InfoGlueWebServiceTag 17 { 18 21 private static final long serialVersionUID = -1904980538720103871L; 22 23 26 private String operationName = "updateContent"; 27 28 31 32 private Map content = new HashMap (); 33 34 private Integer contentId; 35 private String name; 36 private Date publishDateTime; 37 private Date expireDateTime; 38 39 42 private InfoGluePrincipal principal; 43 44 47 public UpdateContentTag() 48 { 49 super(); 50 } 51 52 60 public int doStartTag() throws JspException 61 { 62 return EVAL_BODY_INCLUDE; 63 } 64 65 68 public int doEndTag() throws JspException 69 { 70 try 71 { 72 content.put("contentId", this.contentId); 73 if(this.name != null) 74 content.put("name", this.name); 75 if(this.publishDateTime != null) 76 content.put("publishDateTime", this.publishDateTime); 77 if(this.expireDateTime != null) 78 content.put("expireDateTime", this.expireDateTime); 79 80 this.invokeOperation("content", content); 81 } 82 catch (Exception e) 83 { 84 e.printStackTrace(); 85 throw new JspTagException (e.getMessage()); 86 } 87 88 content.clear(); 89 this.name = null; 90 this.contentId = null; 91 this.expireDateTime = null; 92 this.publishDateTime = null; 93 94 return EVAL_PAGE; 95 } 96 97 100 public void setOperationName(final String operationName) 101 { 102 this.operationName = operationName; 103 } 104 105 108 public void setPrincipal(final String principalString) throws JspException 109 { 110 this.principal = (InfoGluePrincipal) this.evaluate("remoteContentService", "principal", principalString, InfoGluePrincipal.class); 111 } 112 113 public void setContentId(String contentId) throws JspException 114 { 115 this.contentId = evaluateInteger("updateContent", "contentId", contentId); 116 } 117 118 public void setName(String name) throws JspException 119 { 120 this.name = evaluateString("updateContent", "name", name); 121 } 122 123 public void setExpireDateTime(String expireDateTime) throws JspException 124 { 125 this.expireDateTime = (Date ) this.evaluate("updateContent", "expireDateTime", expireDateTime, Date .class); 126 } 127 128 public void setPublishDateTime(String publishDateTime) throws JspException 129 { 130 this.publishDateTime = (Date ) this.evaluate("updateContent", "publishDateTime", publishDateTime, Date .class); 131 } 132 133 public String getOperationName() 134 { 135 return this.operationName; 136 } 137 } | Popular Tags |