empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r683198 [7/8] - in /incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext: ./ .settings/ src/ src/META-INF/ src/org/ src/org/apache/ src/org/apache/empire/ src/org/apache/empire/struts2/ src/org/apache/empire/struts2/action/ src/org/apac...
Date Wed, 06 Aug 2008 09:34:45 GMT
Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageBarTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageBarTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageBarTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageBarTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,235 @@
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.StringUtils;
+import org.apache.empire.struts2.action.ListPagingInfo;
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.empire.struts2.jsp.components.AnchorComponent;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class ListPageBarTag extends EmpireTagSupport // AbstractRemoteCallUITag
+{
+    protected ListPagingInfo pagingInfo; 
+    protected Object size;
+    protected String action;
+    protected String setPageParam;
+    
+    protected String label;
+    protected String linkClass;
+    protected String textClass;
+    protected String padding;
+    protected String onclick;
+    
+    public ListPageBarTag()
+    {
+        autoResetParams = false;
+    }
+    
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {
+        // LinkTag
+        pagingInfo    = null; 
+        action  = null;
+        label   = null;
+        linkClass = null;
+        textClass = null;
+        padding = null; 
+        setPageParam = null;
+        onclick = null;
+        // reset base params
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return new AnchorComponent(stack, req, res);
+    }
+
+    @Override
+    protected void populateParams()
+    {
+        super.populateParams();
+        
+        AnchorComponent anchor = (AnchorComponent)component;
+        // get Href
+        anchor.setAction(action);
+    }
+
+    protected void populatePageParams(int pageIndex, boolean isCurrent, String text)
+    {
+        AnchorComponent anchor = (AnchorComponent)component;
+        // get Href
+        anchor.setAction(action);
+        anchor.setText(text);
+        anchor.setDisabled(isCurrent);
+        anchor.addParameter(setPageParam, String.valueOf( pageIndex ));
+        anchor.setOnclick(onclick);
+    }
+    
+    @Override
+    public int doStartTag() throws JspException
+    {
+        action = checkAction(action);
+        // Don't call base class
+        return EVAL_BODY_BUFFERED; // SKIP_BODY; // EVAL_BODY_INCLUDE;
+    }
+    
+    @Override
+    public int doEndTag()
+        throws JspException
+    {
+        int current = Math.max(pagingInfo.getPage(), 0);
+        int pageCnt = Math.max(pagingInfo.getPageCount(), 1);
+        if (pageCnt<=1)
+            return EVAL_PAGE;
+        
+        int ctlSize  = Math.max(getInt(size,  5), 1);
+        int begIndex =(current / ctlSize) * ctlSize; 
+        int endIndex = begIndex + ctlSize;
+        setPageParam = getSetPageParamName();
+        
+        // Get Body
+        String body = getBody();
+        setBodyContent(null);
+        
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        // Padding Text
+        if (padding==null)
+            padding = dic.PagerPaddingText();
+        String pbeg_e = dic.PagerFirstPageText();
+        String prwd_e = dic.PagerRewindText();
+        String pfwd_e = dic.PagerForwardText();
+        String pend_e = dic.PagerLastPageText();
+        String pbeg_d = dic.PagerFirstPageTextDisabled();
+        String prwd_d = dic.PagerRewindTextDisabled();
+        String pfwd_d = dic.PagerForwardTextDisabled();
+        String pend_d = dic.PagerLastPageTextDisabled();
+        // Class and Styles
+        HtmlTag div = w.startTag(dic.PagerTag());
+        addStandardAttributes(div, dic.PagerClass());
+        // Body
+        div.beginBody(body, true);
+        this.cssClass = str(linkClass, dic.PagerLinkClass());
+        this.cssStyle = null;
+        // onclick
+        if (onclick== null)
+            onclick = dic.PagerLinkDefaultOnClickScript();
+        // Label?
+        String pagerLabel = getString(str(label, dic.PagerLabelText()));
+        if (pagerLabel!=null)
+        {   // There is text
+            HtmlTag label = w.startTag( dic.PagerLabelTag());
+            label.addAttribute("class", dic.PagerLabelClass());
+            label.endTag(pagerLabel);
+        }
+        // Back and fast back
+        renderButton(w, pbeg_e, pbeg_d, true, pageCnt, current, 0);
+        renderButton(w, prwd_e, prwd_d, true, pageCnt, current, Math.max(current - 1, 0) );
+        // The Pages
+        for (int pageIndex=begIndex; pageIndex<endIndex; pageIndex++)
+        {
+            // Padding
+            if (pageIndex>0 && padding!=null)
+                w.println(padding);
+            // The Page selection
+            HtmlTag page = w.startTag(dic.PagerPageTag());
+            div.addAttribute("class", dic.PagerPageClass());
+            page.beginBody();
+            // The Anchors
+            String pageText = String.valueOf(pageIndex+1);
+            if (pageIndex>=pageCnt)
+            {   // Hide page number
+                pageText = "&nbsp;";
+            }    
+            renderButton(w, pageText, pageText, false, pageCnt, current, pageIndex);
+            // end
+            page.endTag(true);
+        }
+        // Forward and Fast Forward
+        renderButton(w, pfwd_e, pfwd_d, true, pageCnt, current, Math.min(current + 1, pageCnt));
+        renderButton(w, pend_e, pend_d, true, pageCnt, current, pageCnt-1);
+        // end
+        div.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+    
+    private void renderButton(HtmlWriter w, String text_enabled, String text_disabled, boolean image, int count, int current, int page)
+        throws JspException
+    {
+        boolean disabled = (page==current);
+        if (page<0 || page>=count)
+        {
+            disabled = true;
+        }    
+        // The Anchors
+        super.doStartTag();
+        populatePageParams(page, disabled, (disabled ? text_disabled : text_enabled));
+        super.doEndTag();
+        // New Line
+        w.println();
+    }
+    
+    // ------- helpers --------
+    
+    private String getSetPageParamName()
+    {
+        if (pagingInfo==null)
+            return "page";
+        // Get Property
+        String listProperty = pagingInfo.getListPropertyName();
+        if (StringUtils.isEmpty(listProperty))
+            return "page";
+        // Property
+        return listProperty + ".page";
+    }
+
+    // ------- Property Accessors -------
+
+    public void setPagingInfo(ListPagingInfo pagingInfo)
+    {
+        this.pagingInfo = pagingInfo;
+    }
+    
+    public void setAction(String action)
+    {
+        this.action = action;
+    }
+
+    public void setLinkClass(String linkClass)
+    {
+        this.linkClass = linkClass;
+    }
+
+    public void setSize(Object size)
+    {
+        this.size = size;
+    }
+
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+
+    public void setOnclick(String onclick)
+    {
+        this.onclick = onclick;
+    }
+
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageInfoTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageInfoTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageInfoTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ListPageInfoTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,100 @@
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.struts2.action.ListPagingInfo;
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class ListPageInfoTag extends EmpireTagSupport // AbstractRemoteCallUITag
+{
+    protected ListPagingInfo pagingInfo; 
+    protected String label;
+    protected String of;
+    
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {   // LinkTag
+        pagingInfo = null; 
+        label = null;
+        of = null;
+        // reset base params
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+    
+    @Override
+    public int doStartTag() throws JspException
+    {
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        
+        HtmlTag div = w.startTag(dic.PageInfoTag());
+        addStandardAttributes(div, dic.PageInfoClass());
+        div.beginBody();
+        // Add Label
+        w.print(getString(str(label, dic.PageInfoLabel())));
+        w.print(dic.PageInfoLabelPadding());
+        // Add first item
+        HtmlTag first = w.startTag(dic.PageInfoItemTag());
+        first.endTag(String.valueOf(pagingInfo.getFirstItemIndex()+1));
+        // Add Separator
+        w.print(dic.PageInfoLabelTo());
+        // Add last item
+        HtmlTag last = w.startTag(dic.PageInfoItemTag());
+        last.endTag(String.valueOf(pagingInfo.getLastItemIndex()+1));
+        // Add of label
+        w.print(dic.PageInfoLabelPadding());
+        w.print(getString(str(of, dic.PageInfoLabelOf())));
+        w.print(dic.PageInfoLabelPadding());
+        // Add item count
+        HtmlTag count = w.startTag(dic.PageInfoItemTag());
+        count.endTag(String.valueOf(pagingInfo.getItemCount()));
+        // end
+        div.endTag();
+        // Don't call base class
+        return SKIP_BODY; // EVAL_BODY_BUFFERED; // EVAL_BODY_INCLUDE;
+    }
+    
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+    
+    // ------- Property setters -------
+
+    public void setPagingInfo(ListPagingInfo pagingInfo)
+    {
+        this.pagingInfo = pagingInfo;
+    }
+
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+
+    public void setOf(String of)
+    {
+        this.of = of;
+    }
+
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuItemTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuItemTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuItemTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuItemTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,138 @@
+/*
+ * ESTEAM Software GmbH, 01.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import java.util.Stack;
+
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+
+
+@SuppressWarnings("serial")
+public class MenuItemTag extends LinkTag
+{
+    protected String menuId;
+    protected Object expanded;
+
+    @Override
+    protected void resetParams()
+    {
+        menuId = null;
+        expanded = null;
+        // done
+        super.resetParams();
+    }
+
+    @Override
+    public int doStartTag() throws JspException
+    {
+        // check visibility
+        if (getBoolean(visible, true)==false)
+        {   // not visible
+            return SKIP_BODY;
+        }
+        // MenuInfo
+        MenuTag.MenuInfo mi = getMenuInfo();
+        boolean current = isCurrent(mi);
+        // HtmlWriter
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.startTag("li");
+        addStandardAttributes(wrap, null);
+        this.cssClass = getCssClass(mi, current);
+        this.cssStyle = null;
+        wrap.beginBody();
+        // The Anchors
+        if (item== null && mi.actionItem!=null)
+            item = mi.actionItem;
+        // OnClick
+        if (onclick== null)
+            onclick = dic.MenuItemLinkDefaultOnClickScript();
+        // Call base class
+        int result = super.doStartTag();
+        // Check expanded
+        return (isExpanded(mi) ? result : SKIP_BODY);  
+    }
+    
+    @Override
+    public int doEndTag() throws JspException
+    {
+        // Check visibility
+        if (getBoolean(visible, true)==false)
+        {   // Not visible
+            if (autoResetParams)
+                resetParams();
+            return EVAL_PAGE;
+        }    
+        // Get body
+        String body = getBody();
+        setBodyContent(null);
+        // End tag
+        int result = super.doEndTag();
+        // HtmlWriter
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.continueTag("li", true);
+        wrap.endTag(body);
+        // Done
+        return result;
+    }
+
+    @SuppressWarnings("unchecked")
+    private MenuTag.MenuInfo getMenuInfo()
+    {
+        Stack<MenuTag.MenuInfo> stack = (Stack<MenuTag.MenuInfo>)pageContext.getAttribute(MenuTag.MENU_STACK_ATTRIBUTE);
+        return (stack!= null) ? stack.peek() : null;
+    }
+    
+    private boolean isCurrent(MenuTag.MenuInfo mi)
+    {
+        if (mi==null || mi.currentId==null)
+            return false;
+        String thisMenu = (menuId!=null) ? menuId : id;
+        return (thisMenu!=null) ? thisMenu.equals(mi.currentId) : false; 
+    }
+    
+    private boolean isExpanded(MenuTag.MenuInfo mi)
+    {
+        if (expanded==null)
+            return true;
+        // autoexpand if current 
+        if (expanded instanceof String && "auto".equalsIgnoreCase((String)expanded))
+            return isCurrent(mi);
+        // get boolean
+        return getBoolean(expanded, true);
+    }
+    
+    private String getCssClass(MenuTag.MenuInfo mi, boolean current)
+    {
+        if (mi==null)
+            return null;
+        // Check disabled
+        if (getBoolean(disabled, false))
+            return mi.disabledClass;
+        // Check Current
+        if (current)
+            return mi.currentClass;
+        // Check Expanded
+        if (expanded!=null && isExpanded(mi))
+            return mi.expandedClass;
+        // Default: Enabled Class
+        return mi.enabledClass;
+    }
+    
+    // -------------------------------- Property accessors -----------------------------
+
+    public void setMenuId(String menuId)
+    {
+        this.menuId = menuId;
+    }
+
+    public void setExpanded(Object expanded)
+    {
+        this.expanded = expanded;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/MenuTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,167 @@
+/*
+ * ESTEAM Software GmbH, 02.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import java.util.Stack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class MenuTag extends EmpireTagSupport
+{
+    public static final String MENU_STACK_ATTRIBUTE = "MenuTag.MenuInfo";
+    
+    public static class MenuInfo
+    {
+        public String currentId;
+        public String currentClass;
+        public String enabledClass;
+        public String disabledClass;
+        public String expandedClass;
+        public String actionItem;
+    }
+    
+    // Item Information 
+    protected String currentItem;
+    protected String currentClass;
+    protected String enabledClass;
+    protected String disabledClass;
+    protected String expandedClass;
+    protected String actionItem;
+
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {
+        // Item Information
+        currentItem = null;
+        currentClass = null;
+        enabledClass = null;
+        disabledClass = null;
+        expandedClass = null;
+        // reset
+        super.resetParams();
+    }
+    
+    @Override
+    public Component getBean(ValueStack arg0, HttpServletRequest arg1, HttpServletResponse arg2)
+    {
+        return null;
+    }
+    
+    @Override
+    protected void populateParams()
+    {
+        log.error("Illegal Method call");
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int doStartTag() throws JspException
+    {
+        // Tabel cell tag
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag menu = w.startTag(dic.MenuTag());
+        addStandardAttributes(menu, null);
+        menu.beginBody(true);
+        // Create Menu Item Info
+        MenuInfo mi = new MenuInfo();
+        // Get Stack 
+        Stack<MenuInfo> stack = (Stack<MenuInfo>)pageContext.getAttribute(MENU_STACK_ATTRIBUTE);
+        if (stack!=null)
+        {   // Nested Menu's
+            MenuInfo parent = stack.peek(); 
+            mi.currentId = getString( currentItem, parent.currentId );
+            mi.currentClass = getString (currentClass, parent.currentClass);
+            mi.enabledClass = getString (enabledClass, parent.enabledClass);
+            mi.disabledClass = getString (disabledClass, parent.disabledClass);
+            mi.expandedClass = getString (expandedClass, parent.expandedClass); 
+            mi.actionItem = getString (actionItem, parent.actionItem);
+        }
+        else
+        {   // A new Menu
+            stack = new Stack<MenuInfo>();
+            pageContext.setAttribute(MENU_STACK_ATTRIBUTE, stack);
+            // Init Menu Info
+            mi.currentId = getString( currentItem, null );
+            mi.currentClass = getString (currentClass, dic.MenuItemCurrentClass());
+            mi.enabledClass = getString (enabledClass, dic.MenuItemLinkClass());
+            mi.disabledClass = getString (disabledClass, dic.MenuItemDisabledClass());
+            mi.expandedClass = getString (expandedClass, dic.MenuItemExpandedClass()); 
+            mi.actionItem = getString (actionItem, null);
+        }
+        // Add to Stack
+        stack.push(mi);
+        // boolean usesBody = true;
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return EVAL_BODY_INCLUDE;
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public int doEndTag() throws JspException
+    {
+        // Pop Menu Info
+        Stack<MenuInfo> stack = (Stack<MenuInfo>)pageContext.getAttribute(MENU_STACK_ATTRIBUTE);
+        if (stack!= null)
+        {   // Pop Menu Info From Stack
+            stack.pop();
+            if (stack.isEmpty())
+                pageContext.removeAttribute(MENU_STACK_ATTRIBUTE);
+        }
+        // Write End Tag
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag menu = w.continueTag (dic.MenuTag(), true);
+        menu.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+
+    // -------------------------------- Property accessors -----------------------------
+
+    public void setCurrentItem(String currentId)
+    {
+        this.currentItem = currentId;
+    }
+
+    public void setCurrentClass(String currentClass)
+    {
+        this.currentClass = currentClass;
+    }
+
+    public void setDisabledClass(String disabledClass)
+    {
+        this.disabledClass = disabledClass;
+    }
+
+    public void setExpandedClass(String expandedClass)
+    {
+        this.expandedClass = expandedClass;
+    }
+
+    public void setEnabledClass(String enabledClass)
+    {
+        this.enabledClass = enabledClass;
+    }
+
+    public void setActionItem(String actionItem)
+    {
+        this.actionItem = actionItem;
+    }
+
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ParamTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ParamTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ParamTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/ParamTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,93 @@
+package org.apache.empire.struts2.jsp.tags;
+
+import java.io.Writer;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.empire.commons.StringUtils;
+import org.apache.empire.data.ColumnExpr;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class ParamTag extends EmpireValueTagSupport
+{
+    public static class ParamComponent extends Component
+    {
+        public String name;
+        public String value;
+
+        public ParamComponent(ValueStack stack)
+        {
+            super(stack);
+        }
+        @Override
+        public boolean start(Writer writer)
+        {   // no body support
+            return false;
+        }
+        @Override
+        public boolean end(Writer writer, String body)
+        {
+            try {
+                Component component = findAncestor(Component.class);
+                if (component!=null)
+                {
+                    component.addParameter(name, value);
+                }
+            } finally {
+                popComponentStack();
+            }
+            return false;
+        }
+    }
+    
+    private Object name;
+    
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {
+        // Param Tag
+        name = null;
+        // Value
+        super.resetParams();
+    }
+    
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return new ParamComponent(stack);
+    }
+
+    @Override
+    protected void populateParams()
+    {        
+        super.populateParams();
+        
+        ParamComponent comp = (ParamComponent)component;
+        comp.name  = getTagName(name);
+        comp.value = getStringValue();
+    }
+    
+    public void setName(Object name)
+    {
+        this.name = name;
+    }
+    
+    private String getTagName(Object name)
+    {
+        if (name instanceof ColumnExpr)
+            return ((ColumnExpr)name).getName();
+        if (name == null)
+            setPropertyNameFromValue();
+        // Call Base Class
+        return super.getTagName(StringUtils.toString(name));
+    }
+    
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/RadioButtonTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/RadioButtonTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/RadioButtonTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/RadioButtonTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,151 @@
+/*
+ * ESTEAM Software GmbH, 17.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.ObjectUtils;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class RadioButtonTag extends EmpireValueTagSupport
+{
+    // Checkbox Tag
+    protected String name;
+    protected Object checked;
+    protected Object disabled;
+    // More UI
+    protected String tabindex;
+    protected String onclick;
+    protected String onchange;
+    protected String onfocus;
+    protected String onblur;
+    
+    @Override
+    protected void resetParams()
+    {
+        name = null;
+        checked = null;
+        disabled = null;
+        // AbstractUITag
+        onclick = null;
+        onchange = null;
+        onfocus = null;
+        onblur = null;
+        tabindex = null;
+        // Value
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Tabel cell tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag rb = w.startTag("input");
+        addStandardAttributes(rb, null);
+        rb.addAttribute("type", "radio");
+        rb.addAttribute("name",  getTagName(name));
+        rb.addAttributeNoCheck("value", getStringValue(), true);
+        rb.addAttribute("checked", getChecked());
+        rb.addAttribute("disabled", getBoolean(disabled, false));
+        rb.addAttribute("tabindex", this.tabindex);
+        // Event Attributes
+        rb.addAttribute("onclick",   this.onclick);
+        rb.addAttribute("onchange",  this.onchange);
+        rb.addAttribute("onfocus",   this.onfocus);
+        rb.addAttribute("onblur",    this.onblur);
+        rb.endTag();
+        // wrap.beginBody(getTextValue());
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return SKIP_BODY;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+    
+    // ------- helpers -------
+    
+    public boolean getChecked()
+    {
+        if (checked!=null)
+        {
+            return getBoolean(checked, false);
+        }
+        if (hasDefaultValue())
+        {
+            Object value = getValue();
+            Object defval = getDefaultValue();
+            if ((value instanceof String) && ((String)value).length()==0)
+                value = null;
+            if ((defval instanceof String) && ((String)defval).length()==0)
+                defval = null;
+            return ObjectUtils.compareEqual(value, defval);
+        }
+        // Done
+        return false;
+    }
+
+    // -------------------------------- Property accessors -----------------------------
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    
+    public void setChecked(Object checked)
+    {
+        this.checked = checked;
+    }
+
+    public void setDisabled(Object disabled)
+    {
+        this.disabled = disabled;
+    }
+
+    public void setTabindex(String tabindex)
+    {
+        this.tabindex = tabindex;
+    }
+
+    public void setOnclick(String onclick)
+    {
+        this.onclick = onclick;
+    }
+
+    public void setOnchange(String onchange)
+    {
+        this.onchange = onchange;
+    }
+
+    public void setOnfocus(String onfocus)
+    {
+        this.onfocus = onfocus;
+    }
+
+    public void setOnblur(String onblur)
+    {
+        this.onblur = onblur;
+    }
+    
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/SelectTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/SelectTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/SelectTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/SelectTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,163 @@
+/*
+ * ESTEAM Software GmbH, 17.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.ObjectUtils;
+import org.apache.empire.commons.OptionEntry;
+import org.apache.empire.commons.Options;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class SelectTag extends EmpireValueTagSupport
+{
+    // Checkbox Tag
+    protected String name;
+    protected Options options;
+    protected Object allownull;
+    protected Object disabled;
+    // More UI
+    protected String tabindex;
+    protected String onclick;
+    protected String onchange;
+    protected String onfocus;
+    protected String onblur;
+    
+    @Override
+    protected void resetParams()
+    {
+        name = null;
+        options = null;
+        allownull = null;
+        disabled = null;
+        // AbstractUITag
+        onclick = null;
+        onchange = null;
+        onfocus = null;
+        onblur = null;
+        tabindex = null;
+        // Value
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Select Input Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag select = w.startTag("select");
+        addStandardAttributes(select, null);
+        select.addAttribute("name",     getTagName(name));
+        select.addAttribute("disabled", getBoolean(disabled, false));
+        select.addAttribute("tabindex", this.tabindex);
+        // Event Attributes
+        select.addAttribute("onclick",  this.onclick);
+        select.addAttribute("onchange", this.onchange);
+        select.addAttribute("onfocus",  this.onfocus);
+        select.addAttribute("onblur",   this.onblur);
+        select.beginBody(true);
+        // Render List of Options
+        if (options!=null)
+        {   // Render option list
+            Object current = getValue();
+            if (getBoolean(allownull, false) && options.contains(null)==false)
+            {   // add an empty entry
+                HtmlTag option = w.startTag("option");
+                option.addAttributeNoCheck("value", "", false);
+                option.addAttribute("selected", ObjectUtils.isEmpty(current));
+                option.beginBody("");
+                option.endTag(true);
+            }
+            for (OptionEntry entry : options)
+            {
+                Object value = entry.getValue();
+                boolean isCurrent = ObjectUtils.compareEqual(current, value);
+                // Add Option entry
+                HtmlTag option = w.startTag("option");
+                option.addAttributeNoCheck("value", value, true);
+                option.addAttribute("selected", isCurrent);
+                option.beginBody(getTranslation(entry.getText()));
+                option.endTag(true);
+            }
+        }
+        else
+        {   // No Option list available
+            log.error("No options available for select tag.");
+        }
+        // done
+        select.endTag();
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return SKIP_BODY;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+
+    // -------------------------------- Property accessors -----------------------------
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    
+    public void setOptions(Options options)
+    {
+        this.options = options;
+    }
+
+    public void setAllownull(Object allownull)
+    {
+        this.allownull = allownull;
+    }
+
+    public void setDisabled(Object disabled)
+    {
+        this.disabled = disabled;
+    }
+
+    public void setTabindex(String tabindex)
+    {
+        this.tabindex = tabindex;
+    }
+
+    public void setOnclick(String onclick)
+    {
+        this.onclick = onclick;
+    }
+
+    public void setOnchange(String onchange)
+    {
+        this.onchange = onchange;
+    }
+
+    public void setOnfocus(String onfocus)
+    {
+        this.onfocus = onfocus;
+    }
+
+    public void setOnblur(String onblur)
+    {
+        this.onblur = onblur;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableDataTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableDataTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableDataTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableDataTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,171 @@
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+
+
+
+@SuppressWarnings("serial")
+public class TableDataTag extends DataValueTag
+{
+    // Column Properties
+    protected String width;
+    protected String height;
+    protected String colspan;
+    protected String rowspan;
+    protected String align;
+    protected String valign;
+    protected String wrap;
+    protected String bgcolor;
+    
+    /*
+     * InputControlTag Constructor
+     */
+    public TableDataTag()
+    {
+        // Default constructor
+    }
+
+    @Override
+    protected void resetParams()
+    {
+        width = null;
+        height = null;
+        colspan = null;
+        rowspan = null;
+        align = null;
+        valign = null;
+        wrap = null;
+        bgcolor = null;
+        // Reset Params
+        super.resetParams();
+    }
+    
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Get Row Info 
+        TableRowTag.RowInfo ri = getRowInfo();
+        // Start Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag td = w.startTag("td");
+        td.addAttribute("id", getId());
+        td.addAttribute("class", getCssClass(ri));
+        setStyleAndWrap(td, ri);
+        td.addAttribute("width", width);
+        td.addAttribute("height", height);
+        td.addAttribute("colspan", colspan);
+        td.addAttribute("rowspan", rowspan);
+        td.addAttribute("align", str(align, ri.columnAlign));
+        td.addAttribute("valign", valign);
+        td.addAttribute("bgcolor", bgcolor);
+        td.beginBody();
+        // Start Value
+        this.id=null;
+        this.cssClass=null;
+        this.cssStyle=null;
+        // Render Value
+        return super.doStartTag();
+    }
+    
+    @Override
+    public int doEndTag()
+        throws JspException
+    {
+        int result = super.doEndTag();
+        // Write End Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag td = w.continueTag("td", true);
+        td.endTag();
+        // done
+        return result;
+    }
+
+    private TableRowTag.RowInfo getRowInfo()
+    {
+        Object ri = getPageAttribute(TableRowTag.ROWINFO_ATTRIBUTE, null);
+        if (ri instanceof TableRowTag.RowInfo)
+            return ((TableRowTag.RowInfo)ri);
+        // No current Column Info available
+        log.error("No table row information available! <e:tr> Tag missing?" + getPageName());
+        return new TableRowTag.RowInfo(); 
+    }
+
+    private String getCssClass(TableRowTag.RowInfo ri)
+    {
+        if (this.cssClass!=null)
+            return this.cssClass;
+        // Check if current
+        ColumnExpr column = getColumnExpr();
+        if (ri.currentClass!=null && ri.currentColumn!=null && ri.currentColumn.equals(column))
+            return ri.currentClass; // Current column
+        // Return the columnClass
+        return ri.columnClass; 
+    }
+    
+    private void setStyleAndWrap(HtmlTag tag, TableRowTag.RowInfo ri)
+    {
+        String style = str(cssStyle, ri.columnStyle);
+        String wordwrap = str(wrap, ri.columnWrap);
+        // No wrap
+        if ("nowrap".equalsIgnoreCase(wordwrap))
+        {
+            tag.addAttribute("nowrap");
+        }
+        // Wrap is given
+        else if (wordwrap!=null && wordwrap.length()>0)
+        {   // Append to style
+            wordwrap = "word-wrap: " + wordwrap + ";"; 
+            style = ((style!=null) ? wordwrap + style  : wordwrap) ;
+        }
+        // Set Style
+        tag.addAttribute("style", style);
+    }
+
+    // ------- Property accessors -------
+    
+    public void setAlign(String align)
+    {
+        this.align = align;
+    }
+
+    public void setBgcolor(String bgcolor)
+    {
+        this.bgcolor = bgcolor;
+    }
+
+    public void setColspan(String colspan)
+    {
+        this.colspan = colspan;
+    }
+
+    public void setHeight(String height)
+    {
+        this.height = height;
+    }
+
+    public void setWrap(String wrap)
+    {
+        this.wrap = wrap;
+    }
+
+    public void setRowspan(String rowspan)
+    {
+        this.rowspan = rowspan;
+    }
+
+    public void setValign(String valign)
+    {
+        this.valign = valign;
+    }
+
+    public void setWidth(String width)
+    {
+        this.width = width;
+    }
+    
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadColumnTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadColumnTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadColumnTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadColumnTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,353 @@
+/*
+ * ESTEAM Software GmbH, 01.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import java.util.HashMap;
+
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.empire.struts2.jsp.components.AnchorComponent;
+
+
+@SuppressWarnings("serial")
+public class TableHeadColumnTag extends LinkTag
+{
+    // TableHeadColumnTag
+    protected ColumnExpr column;
+
+    // Select 
+    protected ColumnExpr[] select;
+    protected String selectName;
+    protected String selectAction;
+    
+    // th
+    protected String width;
+    protected String height;
+    protected String colspan;
+    protected String rowspan;
+    protected String align;
+    protected String valign;
+    protected String wrap;
+    protected String bgcolor;
+    protected String columnname;
+    
+    // Temporary String
+    private String orderIndicator = null;
+    
+    @Override
+    protected void resetParams()
+    {
+        column = null;
+        select = null;
+        width = null;
+        height = null;
+        colspan = null;
+        rowspan = null;
+        align = null;
+        valign = null;
+        wrap = null;
+        bgcolor = null;
+        columnname = null;
+        // Reset Params
+        super.resetParams();
+    }
+
+    @Override
+    public String getBody()
+    {
+        String body = super.getBody();
+        if (orderIndicator==null || orderIndicator.length()==0)
+            return body;
+        if (body==null || body.length()==0)
+            return orderIndicator;  
+        // beides zusammen
+        return orderIndicator + " " + body; 
+    }
+
+    @Override
+    public int doStartTag() throws JspException
+    {
+        TableHeadRowTag.HeadRowInfo hri = getHeadRowInfo();
+        // HtmlWriter
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        orderIndicator = getSortOrderIdicator(hri, dic);
+        // Start Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.startTag(dic.TableHeadColumnTag());
+        wrap.addAttribute("id", getId());
+        wrap.addAttribute("class", getCssClass(hri));
+        setStyleAndWrap(wrap, hri);
+        wrap.addAttribute("width", width);
+        wrap.addAttribute("height", height);
+        wrap.addAttribute("colspan", colspan);
+        wrap.addAttribute("rowspan", rowspan);
+        wrap.addAttribute("align", str(align, hri.columnAlign));
+        wrap.addAttribute("valign", valign);
+        wrap.addAttribute("bgcolor", bgcolor);
+        // Body
+        wrap.beginBody();
+        if (prepareLinkParams(hri))
+        {   // The Anchor
+            this.cssClass = getLinkClass(hri, dic);
+            this.cssStyle = null;
+            // OnClick
+            if (onclick== null)
+                onclick = dic.TableHeadLinkDefaultOnClickScript();
+            // render column choices 
+            if (select!=null)
+            {
+               renderColumnSelect(w);
+               text = "";
+            }
+            // Start the tag
+            super.doStartTag();
+            // Add Sort Param
+            AnchorComponent anchor = (AnchorComponent)component;
+            anchor.addParameter(hri.sortColumnParam, getColumnName());
+            if (hri.sortOrderChangeable && hri.sortOrderParam!=null)
+            {
+                anchor.addParameter(hri.sortOrderParam, (hri.sortDescending) ? "0" : "1");
+            }
+            // render Link
+            super.doEndTag();
+        }
+        else
+        {   // The value
+            HtmlTag text = w.startTag("span"); // dic.AnchorDisabledTag()
+            text.addAttribute("class", getLinkClass(hri, dic));
+            text.beginBody(getColumnTitle());
+            text.endTag(getBody());
+        }
+        // Don't call base class
+        return EVAL_BODY_INCLUDE;
+    }
+    
+    @Override
+    public int doEndTag() throws JspException
+    {
+        // done
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.continueTag(dic.TableHeadColumnTag(), true);
+        wrap.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+
+    private void renderColumnSelect(HtmlWriter w)
+    {
+        HtmlTag selectTag = w.startTag("select");
+        selectTag.addAttribute("name", selectName);
+        HashMap<String, String> params = new HashMap<String, String>();
+        params.put(selectName, "");
+        selectTag.addAttribute("onchange", "window.location='" + getActionURL(selectAction, params) + "'+options[selectedIndex].value" );
+        selectTag.beginBody();
+        
+        for (int i=0; i<select.length; i++)
+        {
+            HtmlTag option = w.startTag("option");
+            option.addAttribute("value", select[i].getName());
+            option.addAttribute("selected", (select[i].equals(column)));
+            option.endTag(getString(select[i].getTitle()));
+        }
+        selectTag.endTag();
+    }
+    
+    private TableHeadRowTag.HeadRowInfo getHeadRowInfo()
+    {
+        Object hri = getPageAttribute(TableHeadRowTag.HEADROWINFO_ATTRIBUTE, null);
+        if (hri instanceof TableHeadRowTag.HeadRowInfo)
+            return ((TableHeadRowTag.HeadRowInfo)hri);
+        // No current Column Info available
+        log.error("No table head row information available! <e:thr> Tag missing?" + getPageName());
+        return new TableHeadRowTag.HeadRowInfo(); 
+    }
+    
+    private void setStyleAndWrap(HtmlTag tag, TableHeadRowTag.HeadRowInfo hri)
+    {
+        String style = str(cssStyle, hri.columnStyle);
+        String wordwrap = str(wrap, hri.columnWrap);
+        // No wrap
+        if ("nowrap".equalsIgnoreCase(wordwrap))
+        {
+            tag.addAttribute("nowrap");
+        }
+        // Wrap is given
+        else if (wordwrap!=null && wordwrap.length()>0)
+        {   // Append to style
+            wordwrap = "word-wrap: " + wordwrap + ";"; 
+            style = ((style!=null) ? style + " " + wordwrap : wordwrap) ;
+        }
+        // Set Style
+        tag.addAttribute("style", style);
+    }
+    
+    private boolean prepareLinkParams(TableHeadRowTag.HeadRowInfo hri)
+    {
+        if (action==null)
+            action = hri.sortAction; 
+        if (text== null)
+            text = getColumnTitle();
+        // yes, it is a link!
+        return (action!=null && column!=null); 
+    }
+    
+    private String getColumnName()
+    {
+        return str(columnname, column.getName());
+    }
+    
+    private String getColumnTitle()
+    {
+        if (text!=null)
+            return getString(text, "");
+        if (column!=null)
+        {
+            return getTranslation( column.getTitle() ); 
+        }
+        // Error
+        log.error("No Title given for Table Head Column on page " + getPageName());
+        return "";
+    }
+    
+    private boolean isCurrentColumn(TableHeadRowTag.HeadRowInfo hri)
+    {
+        if (column==null || hri.currentColumnName==null)
+            return false;
+        // Compare Name
+        return (hri.currentColumnName.equalsIgnoreCase(column.getName()));        
+    }
+    
+    private String getSortOrderIdicator(TableHeadRowTag.HeadRowInfo hri, HtmlTagDictionary dic)
+    {
+        // Is Sort order changeable
+        if (hri.sortOrderChangeable==false)
+            return null; // Not Changeable
+        // Check if current
+        if (isCurrentColumn(hri))
+        {   // Yes, it is changeable
+            boolean desc = hri.sortDescending; 
+            if (select!=null)
+            {
+                return (desc) ? dic.TableHeadSelectAscendingIndicator() 
+                              : dic.TableHeadSelectDescendingIndicator(); 
+            }
+            else
+            {
+                return (desc) ? dic.TableHeadSortDescendingIndicator() 
+                              : dic.TableHeadSortAscendingIndicator(); 
+            }
+        }
+        // Selection List present?
+        if (select!=null)
+        {
+            return dic.TableHeadSelectColumnIndicator();
+        }
+        // Not the current column
+        return null; 
+    }
+
+    private String getCssClass(TableHeadRowTag.HeadRowInfo hri)
+    {
+        if (this.cssClass!=null)
+            return this.cssClass;
+        // Check if current
+        if (hri.currentClass!=null && isCurrentColumn(hri))
+            return hri.currentClass; // Current column
+        // Return the columnClass
+        return hri.columnClass; 
+    }
+
+    private String getLinkClass(TableHeadRowTag.HeadRowInfo hri, HtmlTagDictionary dic)
+    {
+        // Check if current
+        if (isCurrentColumn(hri))
+        {   // Get Class for current Item
+            if (hri.sortOrderChangeable==false)
+                return dic.TableHeadColumnLinkCurrentClass();
+            if (hri.sortDescending)
+                return dic.TableHeadColumnLinkCurrentDescendingClass();
+            else
+                return dic.TableHeadColumnLinkCurrentAscendingClass();
+        }
+        // Check disabled
+        if (action==null || item==null || getBoolean(disabled, false))
+            return dic.TableHeadColumnLinkDisabledClass();
+        // Return the columnClass
+        return dic.TableHeadColumnLinkEnabledClass(); 
+    }
+
+    // ------- Property accessors -------
+    
+    public void setAlign(String align)
+    {
+        this.align = align;
+    }
+
+    public void setBgcolor(String bgcolor)
+    {
+        this.bgcolor = bgcolor;
+    }
+
+    public void setColspan(String colspan)
+    {
+        this.colspan = colspan;
+    }
+
+    public void setColumn(ColumnExpr column)
+    {
+        this.column = column;
+    }
+
+    public void setColumnname(String columnname)
+    {
+        this.columnname = columnname;
+    }
+
+    public void setHeight(String height)
+    {
+        this.height = height;
+    }
+
+    public void setWrap(String wrap)
+    {
+        this.wrap = wrap;
+    }
+
+    public void setRowspan(String rowspan)
+    {
+        this.rowspan = rowspan;
+    }
+
+    public void setValign(String valign)
+    {
+        this.valign = valign;
+    }
+
+    public void setWidth(String width)
+    {
+        this.width = width;
+    }
+
+    public void setSelect(ColumnExpr[] select)
+    {
+        this.select = select;
+    }
+
+    public void setSelectAction(String selectAction)
+    {
+        this.selectAction = selectAction;
+    }
+
+    public void setSelectName(String selectName)
+    {
+        this.selectName = selectName;
+    }
+    
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadRowTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadRowTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadRowTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableHeadRowTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,217 @@
+/*
+ * ESTEAM Software GmbH, 02.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.StringUtils;
+import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.struts2.action.ListSortingInfo;
+import org.apache.empire.struts2.html.HtmlTagDictionary;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class TableHeadRowTag extends EmpireTagSupport
+{
+    public static final String HEADROWINFO_ATTRIBUTE  = "tableHeadRowInfo";
+
+    public static class HeadRowInfo
+    {
+        public String currentColumnName;
+        public boolean sortOrderChangeable;
+        public boolean sortDescending;
+        public String sortAction;
+        public String sortColumnParam;
+        public String sortOrderParam;
+        public String currentClass;
+        // Overridable column defaults
+        public String columnClass;
+        public String columnStyle;
+        public String columnAlign;
+        public String columnWrap;
+    }
+    
+    // Item Information 
+    protected ListSortingInfo sortingInfo;
+    protected ColumnExpr currentColumn;
+    protected Object sortOrder;         // null=none, 0=ascending, 1=descending
+    protected String sortAction;
+    protected String sortColumnParam;
+    protected String sortOrderParam;
+    protected String currentClass;
+    // Overridable column defaults
+    protected String columnClass;
+    protected String columnStyle;
+    protected String columnAlign;
+    protected String columnWrap;
+
+    // Temporäry Information 
+    private Object oldHeadRowInfo;
+    
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {
+        // Item Information
+        sortingInfo = null;
+        currentColumn = null;
+        sortOrder = null;
+        sortAction = null;
+        currentClass = null;
+        columnClass = null;
+        columnStyle = null;
+        columnAlign = null;
+        columnWrap = null;
+        sortColumnParam = null;
+        sortOrderParam = null;
+        // reset
+        super.resetParams();
+    }
+    
+    @Override
+    public Component getBean(ValueStack arg0, HttpServletRequest arg1, HttpServletResponse arg2)
+    {
+        return null;
+    }
+    
+    @Override
+    protected void populateParams()
+    {
+        log.error("Illegal Method call");
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int doStartTag() throws JspException
+    {
+        // Tabel cell tag
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag thr = w.startTag(dic.TableHeadRowTag());
+        addStandardAttributes(thr, null);
+        thr.beginBody(true);
+        // Set current Column
+        HeadRowInfo hri = new HeadRowInfo();
+        // Is sorting Info supplied 
+        if (sortingInfo!=null)
+        {   // Set from sorting Info
+            hri.currentColumnName = sortingInfo.getSortColumn();      
+            hri.sortOrderChangeable = true;
+            hri.sortDescending = sortingInfo.isSortDescending();
+            hri.sortColumnParam = getSortParamName(sortingInfo, "sortColumn");
+            hri.sortOrderParam  = getSortParamName(sortingInfo, "sortDesc");
+        }
+        else
+        {   // Set Manually
+            hri.currentColumnName = ((currentColumn!=null) ? currentColumn.getName() : null);  
+            hri.sortOrderChangeable = (sortOrder!=null);
+            hri.sortDescending  = getBoolean(sortOrder, false);
+            hri.sortColumnParam = sortColumnParam;
+            hri.sortOrderParam = sortOrderParam;
+        }
+        hri.sortAction = sortAction;
+        hri.columnClass = columnClass;
+        hri.currentClass = currentClass;
+        hri.columnAlign = columnAlign;
+        hri.columnStyle = columnStyle;
+        hri.columnWrap = columnWrap;
+        oldHeadRowInfo = putPageAttribute(HEADROWINFO_ATTRIBUTE, hri);
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return EVAL_BODY_INCLUDE;
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public int doEndTag() throws JspException
+    {
+        // Set current Column
+        removePageAttribute(HEADROWINFO_ATTRIBUTE, oldHeadRowInfo);
+        oldHeadRowInfo = null;
+        // Write End Tag
+        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag thr = w.continueTag (dic.TableHeadRowTag(), true);
+        thr.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+    
+    // ------- helpers -------
+    
+    private String getSortParamName(ListSortingInfo sortInfo, String sortProperty)
+    {
+        String listProperty = sortInfo.getListPropertyName();
+        if (StringUtils.isEmpty(listProperty))
+            return sortProperty;
+        return listProperty + "." + sortProperty; 
+    }
+
+    // -------------------------------- Property accessors -----------------------------
+
+    public void setCurrentClass(String currentClass)
+    {
+        this.currentClass = currentClass;
+    }
+
+    public void setCurrentColumn(ColumnExpr currentColumn)
+    {
+        this.currentColumn = currentColumn;
+    }
+
+    public void setSortAction(String sortAction)
+    {
+        this.sortAction = sortAction;
+    }
+
+    public void setSortOrder(Object sortOrder)
+    {
+        this.sortOrder = sortOrder;
+    }
+
+    public void setSortColumnParam(String sortColumnParam)
+    {
+        this.sortColumnParam = sortColumnParam;
+    }
+
+    public void setSortOrderParam(String sortOrderParam)
+    {
+        this.sortOrderParam = sortOrderParam;
+    }
+
+    public void setColumnClass(String columnClass)
+    {
+        this.columnClass = columnClass;
+    }
+
+    public void setColumnStyle(String columnStyle)
+    {
+        this.columnStyle = columnStyle;
+    }
+
+    public void setColumnAlign(String columnAlign)
+    {
+        this.columnAlign = columnAlign;
+    }
+
+    public void setColumnWrap(String columnWrap)
+    {
+        this.columnWrap = columnWrap;
+    }
+
+    public void setSortingInfo(ListSortingInfo sortingInfo)
+    {
+        this.sortingInfo = sortingInfo;
+    }
+
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableRowTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableRowTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableRowTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TableRowTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,171 @@
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+import org.apache.struts2.views.jsp.IteratorStatus;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class TableRowTag extends EmpireTagSupport 
+{
+    public static final String ITERATOR_STATUS_ATTRIBUTE = "listRowStatus";
+    public static final String ROWINFO_ATTRIBUTE  = "tableRowInfo";
+
+    public static class RowInfo
+    {
+        public ColumnExpr currentColumn;
+        public String currentClass;
+        // Overridable column defaults
+        public String columnClass;
+        public String columnAlign;
+        public String columnStyle;
+        public String columnWrap;
+    }
+    
+    // Common UI
+    protected String cssOddClass;
+    protected String cssOddStyle;
+    // Overridable column defaults
+    protected ColumnExpr currentColumn;
+    protected String currentClass;
+    protected String columnClass;
+    protected String columnStyle;
+    protected String columnAlign;
+    protected String columnWrap;
+
+    // Temporäry Information 
+    private Object oldRowInfo;
+    
+    /*
+     * Clears all params since tag is reused
+     */
+    @Override
+    protected void resetParams()
+    {
+        // Common UI 
+        cssOddClass = null;
+        cssOddStyle = null;
+        // Column info
+        currentColumn = null;
+        currentClass = null;
+        columnClass = null;
+        columnStyle = null;
+        columnAlign = null;
+        columnWrap = null;
+        // reset
+        super.resetParams();
+    }
+    
+    @Override
+    public Component getBean(ValueStack arg0, HttpServletRequest arg1, HttpServletResponse arg2)
+    {
+        return null;
+    }
+    
+    @Override
+    protected void populateParams()
+    {
+        log.error("Illegal Method call");
+    }
+    
+    @Override
+    public int doStartTag() throws JspException
+    {
+        // Tabel cell tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag trTag = w.startTag("tr");
+        trTag.addAttribute("id", getId());
+        trTag.addAttribute("class", (isOddStatus() && cssOddClass!=null) ? cssOddClass : cssClass);
+        trTag.addAttribute("style", (isOddStatus() && cssOddStyle!=null) ? cssOddStyle : cssStyle);
+        trTag.beginBody();
+        // Set Row Info
+        RowInfo ri = new RowInfo();
+        ri.currentColumn = currentColumn;  
+        ri.columnClass = columnClass;
+        ri.currentClass = currentClass;
+        ri.columnAlign = columnAlign;
+        ri.columnStyle = columnStyle;
+        ri.columnWrap = columnWrap;
+        oldRowInfo = putPageAttribute(ROWINFO_ATTRIBUTE, ri);
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return EVAL_BODY_INCLUDE;
+        
+    }
+    
+    @Override
+    public int doEndTag() throws JspException
+    {
+        // Set current Column
+        removePageAttribute(ROWINFO_ATTRIBUTE, oldRowInfo);
+        oldRowInfo = null;
+        // Write End Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag trTag = w.continueTag("tr", true);
+        trTag.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+
+    // ------- Helpers -------
+    
+    private boolean isOddStatus()
+    {
+        Object statusAttr = getPageAttribute(ITERATOR_STATUS_ATTRIBUTE, null);
+        if (statusAttr==null)
+            return false;
+        IteratorStatus status = (IteratorStatus)getStack().getContext().get(statusAttr);
+        return (status!=null && status.isOdd());
+    }
+
+    // ------- Property setters -------
+    
+    public void setCssOddClass(String cssOddClass)
+    {
+        this.cssOddClass = cssOddClass;
+    }
+
+    public void setCssOddStyle(String cssOddStyle)
+    {
+        this.cssOddStyle = cssOddStyle;
+    }
+
+    public void setCurrentColumn(ColumnExpr currentColumn)
+    {
+        this.currentColumn = currentColumn;
+    }
+
+    public void setCurrentClass(String currentClass)
+    {
+        this.currentClass = currentClass;
+    }
+
+    public void setColumnClass(String columnClass)
+    {
+        this.columnClass = columnClass;
+    }
+
+    public void setColumnAlign(String columnAlign)
+    {
+        this.columnAlign = columnAlign;
+    }
+
+    public void setColumnStyle(String columnStyle)
+    {
+        this.columnStyle = columnStyle;
+    }
+
+    public void setColumnWrap(String columnWrap)
+    {
+        this.columnWrap = columnWrap;
+    }
+     
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TextTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TextTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TextTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/TextTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,104 @@
+/*
+ * ESTEAM Software GmbH, 04.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.data.Column;
+import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.struts2.html.HtmlWriter;
+import org.apache.empire.struts2.html.HtmlWriter.HtmlTag;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class TextTag extends EmpireTagSupport
+{
+    public static final String TEXT_DEFAULT_VALUE = "&nbsp;"; 
+    
+    // Properties
+    protected Object   value;
+    protected String   tag;
+    protected String   defValue = TEXT_DEFAULT_VALUE;
+
+    @Override
+    protected void resetParams()
+    {
+        value = null;
+        tag = null;
+        defValue = TEXT_DEFAULT_VALUE;
+        // reset
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Tabel cell tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.startTag(tag);
+        addStandardAttributes(wrap, null);
+        wrap.beginBody(getTextValue());
+        // return usesBody ? EVAL_BODY_BUFFERED : EVAL_BODY_INCLUDE;
+        return EVAL_BODY_INCLUDE;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {
+        // Write End Tag
+        HtmlWriter w = new HtmlWriter(pageContext.getOut());
+        HtmlTag wrap = w.continueTag (tag, true);
+        wrap.endTag();
+        // done
+        resetParams();
+        return EVAL_PAGE;
+    }
+    
+    private String getTextValue()
+    {
+        if (value instanceof ColumnExpr)
+        {   // Get Column Title
+            Column column = ((ColumnExpr)value).getSourceColumn();
+            if (column!=null)
+                return getTranslation( column.getTitle() );
+        }
+        if (value!=null)
+        {   // Get Value
+            String val = getString(value);
+            return ((val!=null && val.length()>0) ? val : defValue);
+        }
+        // default
+        return defValue;
+    }
+    
+    // ------- Property setters -------
+
+    public void setTag(String tag)
+    {
+        this.tag = tag;
+    }
+
+    public void setValue(Object value)
+    {
+        this.value = value;
+    }
+
+    public void setDefault(String defValue)
+    {
+        this.defValue = defValue;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseIfTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseIfTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseIfTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseIfTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,83 @@
+/*
+ * ESTEAM Software GmbH, 13.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags.flow;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.ObjectUtils;
+import org.apache.empire.struts2.jsp.tags.EmpireTagSupport;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class ElseIfTag extends EmpireTagSupport
+{
+    /*
+    private static class ElseIfComponent extends org.apache.struts2.components.ElseIf
+    {
+        public IfComponent(ValueStack stack)
+        {
+            super(stack);
+        }
+    }
+    */
+
+    public Object test;
+    
+    @Override
+    protected void resetParams()
+    {
+        test=null;
+        // reset base params
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Get Result from If
+        boolean result = ObjectUtils.getBoolean(getPageAttribute(IfTag.IF_RESULT_ANSWER, false));
+        removePageAttribute(IfTag.IF_RESULT_ANSWER, null);
+        // Tabel cell tag
+        if (result==true)
+        {   test = result;
+            return SKIP_BODY;
+        }
+        // Evaluate Expression if not already a boolean
+        result = this.getBoolean(test, true);
+        test = result;
+        // Tabel cell tag
+        if (result==false)
+            return SKIP_BODY; 
+        // Condition is true, i.e. inlcude body
+        return EVAL_BODY_INCLUDE;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // Put with End-Tag to allow Else being outside the if-tag
+        putPageAttribute(IfTag.IF_RESULT_ANSWER, test);
+        test=null;
+        return EVAL_PAGE;
+    }
+    
+    // ------- Property accessors -------
+    
+    public void setTest(Object test)
+    {
+        this.test = test;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/ElseTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,63 @@
+/*
+ * ESTEAM Software GmbH, 13.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags.flow;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.commons.ObjectUtils;
+import org.apache.empire.struts2.jsp.tags.EmpireTagSupport;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class ElseTag extends EmpireTagSupport
+{
+    /*
+    private static class ElseComponent extends org.apache.struts2.components.Else
+    {
+        public ElseComponent(ValueStack stack)
+        {
+            super(stack);
+        }
+    }
+    */
+    
+    @Override
+    protected void resetParams()
+    {
+        // reset base params
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Get Result from If
+        boolean result = ObjectUtils.getBoolean(getPageAttribute(IfTag.IF_RESULT_ANSWER, false));
+        removePageAttribute(IfTag.IF_RESULT_ANSWER, null);
+        // Tabel cell tag
+        if (result==true)
+            return SKIP_BODY; 
+        // Condition is true, i.e. inlcude body
+        return EVAL_BODY_INCLUDE;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // Nothing to do
+        return EVAL_PAGE;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/IfTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/IfTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/IfTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/IfTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,76 @@
+/*
+ * ESTEAM Software GmbH, 13.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags.flow;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.empire.struts2.jsp.tags.EmpireTagSupport;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class IfTag extends EmpireTagSupport
+{
+    public static final String IF_RESULT_ANSWER = "esteam.if.result";
+    
+    /*
+    private static class IfComponent extends org.apache.struts2.components.If
+    {
+        public IfComponent(ValueStack stack)
+        {
+            super(stack);
+        }
+    }
+    */
+
+    public Object test;
+    
+    @Override
+    protected void resetParams()
+    {
+        test=null;
+        // reset base params
+        super.resetParams();
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return null;
+    }
+
+    @Override
+    public int doStartTag()
+        throws JspException
+    {
+        // Evaluate Expression if not already a boolean
+        boolean result = this.getBoolean(test, true);
+        test = result;
+        // Tabel cell tag
+        if (result==false)
+            return SKIP_BODY; 
+        // Condition is true, i.e. inlcude body
+        return EVAL_BODY_INCLUDE;
+    }
+
+    @Override
+    public int doEndTag()
+        throws JspException
+    {   // Put with End-Tag to allow Else being outside the if-tag
+        putPageAttribute(IF_RESULT_ANSWER, test);
+        test=null;
+        return EVAL_PAGE;
+    }
+
+    // ------- Property accessors -------
+    
+    public void setTest(Object test)
+    {
+        this.test = test;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/SetTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/SetTag.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/SetTag.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/SetTag.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,80 @@
+/*
+ * ESTEAM Software GmbH, 13.07.2007
+ */
+package org.apache.empire.struts2.jsp.tags.flow;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.empire.struts2.jsp.tags.EmpireTagSupport;
+import org.apache.struts2.components.Component;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+
+@SuppressWarnings("serial")
+public class SetTag extends EmpireTagSupport  // org.apache.struts2.views.jsp.SetTag
+{   
+    private static class SetComponent extends org.apache.struts2.components.Set
+    {
+        public Object object;
+        public SetComponent(ValueStack stack)
+        {
+            super(stack);
+        }
+        @Override
+        protected Object findValue(String expr)
+        {
+            return object;
+        }
+        public void setValue(Object object)
+        {
+            this.object = object;
+        }
+    }
+
+    // Properties
+    protected String name;
+    protected String scope;
+    protected Object value;
+
+    @Override
+    protected void resetParams()
+    {
+        name = null;
+        scope = null;
+        value = null;
+        // reset base params
+        super.resetParams();
+    }
+    
+    @Override
+    protected void populateParams()
+    {
+        Object object = getObject(value, null, Object.class);
+        // Use Struts Component
+        SetComponent c = (SetComponent)component;
+        c.setName(name);
+        c.setScope(scope);
+        c.setValue(object);
+    }
+
+    @Override
+    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res)
+    {
+        return new SetComponent(stack);
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    public void setScope(String scope)
+    {
+        this.scope = scope;
+    }
+    public void setValue(Object value)
+    {
+        this.value = value;
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/package.html
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/package.html?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/package.html (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/flow/package.html Wed Aug  6 02:34:41 2008
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+/*
+ * ESTEAM Software GmbH, 12.12.2007
+ */
+-->
+</head>
+<body>
+
+
+
+</body></html>
\ No newline at end of file

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/package.html
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/package.html?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/package.html (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/package.html Wed Aug  6 02:34:41 2008
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+/*
+ * ESTEAM Software GmbH, 12.12.2007
+ */
+-->
+</head>
+<body>
+
+
+
+</body></html>
\ No newline at end of file

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/DefaultWebRequest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/DefaultWebRequest.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/DefaultWebRequest.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/DefaultWebRequest.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,41 @@
+package org.apache.empire.struts2.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class DefaultWebRequest implements WebRequest
+{    
+    private HttpServletRequest  httpRequest;
+    private HttpServletResponse httpResponse; 
+    
+    public boolean init(HttpServletRequest request, HttpServletResponse response, Object session)
+    {
+        this.httpRequest = request;
+        this.httpResponse = response;
+        return true;
+    }
+
+    /**
+     * @see WebRequest#getHttpRequest()
+     */
+    public HttpServletRequest getHttpRequest()
+    {
+        return httpRequest;
+    }
+
+    /**
+     * @see WebRequest#getHttpResponse()
+     */
+    public HttpServletResponse getHttpResponse()
+    {
+        return httpResponse;
+    }
+    
+    /**
+     * @see WebRequest#exit(int)
+     */
+    public void exit(int exitCode)
+    {
+        // nothing to do
+    }
+}

Added: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/EmpireFilterDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/EmpireFilterDispatcher.java?rev=683198&view=auto
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/EmpireFilterDispatcher.java (added)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/web/EmpireFilterDispatcher.java Wed Aug  6 02:34:41 2008
@@ -0,0 +1,33 @@
+package org.apache.empire.struts2.web;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.FilterConfig;
+
+import org.apache.struts2.dispatcher.Dispatcher;
+import org.apache.struts2.dispatcher.FilterDispatcher;
+
+public class EmpireFilterDispatcher extends FilterDispatcher
+{
+    public EmpireFilterDispatcher()
+    {
+        // Default Constructor
+    }
+
+    @Override
+    protected Dispatcher createDispatcher(FilterConfig filterConfig)
+    {
+        Map<String, String> params = new HashMap<String, String>();
+        for (Enumeration e = filterConfig.getInitParameterNames(); 
+             e.hasMoreElements();)
+        {
+            String name = (String) e.nextElement();
+            String value = filterConfig.getInitParameter(name);
+            params.put(name, value);
+        }
+        return new EmpireStrutsDispatcher(filterConfig.getServletContext(), params);
+    }
+
+}



Mime
View raw message