1 package org.infoglue.deliver.taglib.content; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 import javax.servlet.jsp.JspException ; 7 import javax.servlet.jsp.JspTagException ; 8 9 import org.infoglue.cms.security.InfoGluePrincipal; 10 11 14 15 public class DeleteContentTag extends InfoGlueWebServiceTag 16 { 17 20 private static final long serialVersionUID = -1904980538720103871L; 21 22 25 private String operationName = "deleteContent"; 26 27 30 31 private Map content = new HashMap (); 32 33 private Integer contentId; 34 35 38 private InfoGluePrincipal principal; 39 40 43 public DeleteContentTag() 44 { 45 super(); 46 } 47 48 56 public int doStartTag() throws JspException 57 { 58 return EVAL_BODY_INCLUDE; 59 } 60 61 64 public int doEndTag() throws JspException 65 { 66 try 67 { 68 if(this.contentId != null) 69 content.put("contentId", this.contentId); 70 71 this.invokeOperation("content", content); 72 } 73 catch (Exception e) 74 { 75 e.printStackTrace(); 76 throw new JspTagException (e.getMessage()); 77 } 78 79 content.clear(); 80 this.contentId = null; 81 82 return EVAL_PAGE; 83 } 84 85 88 public void setOperationName(final String operationName) 89 { 90 this.operationName = operationName; 91 } 92 93 96 public void setPrincipal(final String principalString) throws JspException 97 { 98 this.principal = (InfoGluePrincipal) this.evaluate("remoteContentService", "principal", principalString, InfoGluePrincipal.class); 99 } 100 101 public void setContentId(String contentId) throws JspException 102 { 103 this.contentId = evaluateInteger("deleteContent", "contentId", contentId); 104 } 105 106 public String getOperationName() 107 { 108 return this.operationName; 109 } 110 } | Popular Tags |