1 package org.apache.archiva.web.tags;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import com.opensymphony.xwork2.util.ValueStack;
23 import org.apache.struts2.components.Component;
25 import javax.servlet.http.HttpServletRequest;
26 import javax.servlet.http.HttpServletResponse;
27 import javax.servlet.jsp.JspException;
29 import org.apache.struts2.views.annotations.StrutsTag;
30 import org.apache.struts2.views.annotations.StrutsTagAttribute;
31 import org.apache.struts2.views.jsp.ComponentTagSupport;
38 @StrutsTag(name = "groupIdLink", tldBodyContent = "empty", tldTagClass = "org.apache.archiva.web.tags.GroupIdLinkTag", description = "Render a groupId as a set of Links")
39 public class GroupIdLinkTag
40 extends ComponentTagSupport
42 private String var_; // stores EL-based property
44 private String var; // stores the evaluated object.
46 private boolean includeTop = false;
49 public Component getBean(ValueStack valueStack, HttpServletRequest request, HttpServletResponse response) {
50 return new GroupIdLink( valueStack, request, response );
67 evaluateExpressions();
69 GroupIdLink groupIdLink = (GroupIdLink)component;
71 groupIdLink.setGroupId( var );
72 groupIdLink.setIncludeTop( includeTop );
74 return super.doEndTag();
77 private void evaluateExpressions()
80 ExpressionTool exprTool = new ExpressionTool( pageContext, this, "groupIdLink" );
82 var = exprTool.optionalString( "var", var_, "" );
85 @StrutsTagAttribute(description = "The GroupID String", type = "String", defaultValue = "", required = true, rtexprvalue = true)
86 public void setVar( String value )
91 @StrutsTagAttribute(description = "Boolean indicating if 'top' link should be created or not.", type = "String", defaultValue = "", required = false, rtexprvalue = true)
92 public void setIncludeTop( boolean includeTop )
94 this.includeTop = includeTop;