1 /** 2 * Copyright (C) 2005-2009 Alfresco Software Limited. 3 * 4 * This file is part of the Spring Surf Extension project. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.springframework.extensions.surf.taglib; 20 21 import javax.servlet.jsp.JspException; 22 23 import org.springframework.extensions.surf.taglib.AbstractObjectTag; 24 25 /** 26 * @author muzquiano 27 */ 28 public class ObjectEditTag extends AbstractObjectTag 29 { 30 private String endpointId = null; 31 private String target = null; 32 private String iconUri = null; 33 34 public String getIconUri() 35 { 36 return iconUri; 37 } 38 39 public void setIconUri(String iconUri) 40 { 41 this.iconUri = iconUri; 42 } 43 44 public String getTarget() 45 { 46 return target; 47 } 48 49 public void setTarget(String target) 50 { 51 this.target = target; 52 } 53 54 public String getEndpoint() 55 { 56 return this.endpointId; 57 } 58 59 public void setEndpoint(String endpointId) 60 { 61 this.endpointId = endpointId; 62 } 63 64 public int doStartTag() throws JspException 65 { 66 // TODO: this is to be refactored 67 68 /* 69 * if (WebStudio.getConfig().isInContextEnabled()) { 70 * RequestContext context = getRequestContext(); 71 * // get the url String url = 72 * WebStudioUtil.getContentEditURL(context, getEndpoint(), 73 * getId()); 74 * // icon uri String newIconUri = 75 * "/themes/builder/images/default/icons/incontext/edit_content.gif"; 76 * if (iconUri != null) newIconUri = iconUri; newIconUri = 77 * URLUtil.browser(context, newIconUri); 78 * // target String newTargetString = " target='_blank' "; if 79 * (target != null) { if ("".equals(target)) newTargetString = " "; 80 * else newTargetString = " target='" + target + "' "; } 81 * // render StringBuffer buffer = new StringBuffer(); String 82 * newGuid = ModelHelper.newGUID(); buffer.append("<div 83 * id='ipe-" + newGuid + "'>"); buffer.append("<a href='" + 84 * url + "' " + newTargetString + ">"); buffer.append("<img 85 * border='0' src='" + newIconUri + "'/>"); buffer.append("</a>"); 86 * buffer.append("</div>"); print(buffer.toString()); } 87 */ 88 return EVAL_BODY_INCLUDE; 89 } 90 }