Wikitty-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
July 2011
- 4 participants
- 85 discussions
r1040 - in trunk/wikitty-struts/src/main: java/org/nuiton/wikitty/struts java/org/nuiton/wikitty/struts/component java/org/nuiton/wikitty/struts/tag tld
by mfortun@users.nuiton.org 04 Jul '11
by mfortun@users.nuiton.org 04 Jul '11
04 Jul '11
Author: mfortun
Date: 2011-07-04 15:23:21 +0200 (Mon, 04 Jul 2011)
New Revision: 1040
Url: http://nuiton.org/repositories/revision/wikitty/1040
Log:
* allow tag to be used outside form tag, but in this case wikitty attribute and proxy must be defined
Added:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/TagUseException.java
Modified:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/BooleanBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/HiddenBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextAreaBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextFieldBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/AbstractWikittyTag.java
trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
Added: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/TagUseException.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/TagUseException.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/TagUseException.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -0,0 +1,25 @@
+package org.nuiton.wikitty.struts;
+
+public class TagUseException extends RuntimeException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5985271991430090753L;
+
+ public TagUseException() {
+ }
+
+ public TagUseException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public TagUseException(String message) {
+ super(message);
+ }
+
+ public TagUseException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/TagUseException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -5,6 +5,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.components.ClosingUIBean;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.struts.TagUseException;
import org.nuiton.wikitty.struts.WikittyFieldHandler;
import com.opensymphony.xwork2.util.ValueStack;
@@ -18,6 +21,16 @@
protected WikittyFieldHandler handler;
protected String fqFieldName;
+ /**
+ * Never used directly this attribute use the getter
+ */
+ protected Wikitty wikitty;
+
+ /**
+ * Never used directly this attribute use the getter
+ */
+ protected WikittyProxy proxy;
+
protected AbstractWikittyComponent(ValueStack stack,
HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -25,14 +38,52 @@
handler = (WikittyFieldHandler) stack.getContext().get(
WikittyFieldHandler.WIKITTY_STACK_KEY);
- if (handler == null) {
+ if (handler == null && wikitty == null) {
log.info("Handler not found in the stack");
// TODO mfortun-2011-06-29 throw exception if handler not in the
// stack
+
+ throw new TagUseException(
+ "Tag must declare Wikitty attribute if used outside ws:form tag");
}
}
+ public boolean isIncluded(String fieldName) {
+ if (handler != null) {
+ return handler.isIncluded(fieldName);
+ }
+ return true;
+ }
+
+ public WikittyProxy getProxy() {
+ if (handler != null) {
+ return handler.getProxy();
+ }
+ return proxy;
+ }
+
+ public Wikitty getWikitty() {
+ if (handler != null) {
+ return handler.getWikitty();
+ }
+ return wikitty;
+ }
+
+ @Override
+ protected void evaluateExtraParams() {
+ super.evaluateExtraParams();
+ if (fqFieldName != null) {
+ addParameter("fqFieldName", fqFieldName);
+ }
+ if (isIncluded(fqFieldName)) {
+ if (handler != null) {
+ handler.addAddedField(fqFieldName);
+ }
+ }
+
+ }
+
public WikittyFieldHandler getHandler() {
return handler;
}
@@ -49,12 +100,12 @@
this.fqFieldName = fqFieldName;
}
- @Override
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
- if ( fqFieldName !=null) {
- addParameter("fqFieldName", fqFieldName);
- }
+ public void setWikitty(Wikitty wikitty) {
+ this.wikitty = wikitty;
}
+ public void setProxy(WikittyProxy proxy) {
+ this.proxy = proxy;
+ }
+
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/BooleanBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/BooleanBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/BooleanBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -32,8 +32,7 @@
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
- handler.addAddedField(fqFieldName);
+ if (isIncluded(fqFieldName)) {
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
@@ -41,7 +40,7 @@
"included",true);
addParameter(
"value",
- handler.getWikitty().getFieldAsBoolean(fieldsAccess[0],
+ getWikitty().getFieldAsBoolean(fieldsAccess[0],
fieldsAccess[1]));
}
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -33,13 +33,13 @@
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
+ if (isIncluded(fqFieldName)) {
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
- Object val = handler.getWikitty().getFieldAsDate(fieldsAccess[0],
+ Object val = getWikitty().getFieldAsDate(fieldsAccess[0],
fieldsAccess[1]);
val = val==null?"":val;
@@ -49,7 +49,6 @@
addParameter("enableHour", enableHour);
}
- handler.addAddedField(fqFieldName);
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -101,6 +101,10 @@
handler.setOrderBefore(orderBefore);
} else {
+ // when the tag is closing remove the handler from the stack
+ stack.getContext().remove(WikittyFieldHandler.WIKITTY_STACK_KEY);
+
+
handler = (WikittyFieldHandler) temp;
}
// add field that have to be write inside the page
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/HiddenBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/HiddenBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/HiddenBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -30,15 +30,14 @@
super.evaluateExtraParams();
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
- handler.addAddedField(fqFieldName);
+ if (isIncluded(fqFieldName)) {
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
addParameter(
"value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ getWikitty().getFieldAsString(fieldsAccess[0],
fieldsAccess[1]));
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -8,11 +8,13 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.search.Criteria;
import org.nuiton.wikitty.search.PagedResult;
import org.nuiton.wikitty.struts.Option;
+import org.nuiton.wikitty.struts.TagUseException;
import org.nuiton.wikitty.struts.WikittyFieldHandler;
import com.opensymphony.xwork2.util.ValueStack;
@@ -40,26 +42,28 @@
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
-
-
-
-
- handler.addAddedField(fqFieldName);
-
- // parse extname and field name
+ if (isIncluded(fqFieldName)) {
+ // parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
addParameter(
"value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ getWikitty().getFieldAsString(fieldsAccess[0],
fieldsAccess[1]));
List<Option> fixlist = new LinkedList<Option>();
+ WikittyProxy proxy= getProxy();
+
+ if (proxy == null) {
+ throw new TagUseException(
+ "Tag must declare a valid proxy attribute if used outside ws:form tag");
+ }
+
+
// search for the wikitty with the criteria
- PagedResult<Wikitty> wikitties = handler.getProxy()
+ PagedResult<Wikitty> wikitties = proxy
.findAllByCriteria(criteria);
String[] descriptor = StringUtil.split(descfield, WikittyFieldHandler.FIELD_SEPARATOR);
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -35,15 +35,15 @@
super.evaluateExtraParams();
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
- handler.addAddedField(fqFieldName);
+ if (isIncluded(fqFieldName)) {
+
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
addParameter(
"value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ getWikitty().getFieldAsString(fieldsAccess[0],
fieldsAccess[1]));
List<Option> fixlist = new LinkedList<Option>();
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextAreaBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextAreaBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextAreaBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -29,15 +29,15 @@
super.evaluateExtraParams();
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
- handler.addAddedField(fqFieldName);
+ if (isIncluded(fqFieldName)) {
+
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
addParameter(
"value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ getWikitty().getFieldAsString(fieldsAccess[0],
fieldsAccess[1]));
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextFieldBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextFieldBean.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/TextFieldBean.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -30,16 +30,15 @@
// if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
+ if (isIncluded(fqFieldName)) {
// parse extname and field name
String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
// add parametters to be use by the template
addParameter("included", true);
addParameter(
"value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ getWikitty().getFieldAsString(fieldsAccess[0],
fieldsAccess[1]));
- handler.addAddedField(fqFieldName);
}
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/AbstractWikittyTag.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/AbstractWikittyTag.java 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/AbstractWikittyTag.java 2011-07-04 13:23:21 UTC (rev 1040)
@@ -1,6 +1,8 @@
package org.nuiton.wikitty.struts.tag;
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.struts.component.AbstractWikittyComponent;
public abstract class AbstractWikittyTag extends AbstractClosingTag {
@@ -8,6 +10,8 @@
private static final long serialVersionUID = -3401870606519882751L;
protected String fqFieldName;
+ protected Wikitty wikitty;
+ protected WikittyProxy proxy;
public String getFqFieldName() {
return fqFieldName;
@@ -18,11 +22,29 @@
}
+ public Wikitty getWikitty() {
+ return wikitty;
+ }
+
+ public void setWikitty(Wikitty wikitty) {
+ this.wikitty = wikitty;
+ }
+
+ public WikittyProxy getProxy() {
+ return proxy;
+ }
+
+ public void setProxy(WikittyProxy proxy) {
+ this.proxy = proxy;
+ }
+
@Override
protected void populateParams() {
super.populateParams();
AbstractWikittyComponent wikittyComponent = (AbstractWikittyComponent) component;
wikittyComponent.setFqFieldName(fqFieldName);
+ wikittyComponent.setWikitty(wikitty);
+ wikittyComponent.setProxy(proxy);
}
Modified: trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
===================================================================
--- trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-04 12:57:41 UTC (rev 1039)
+++ trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-04 13:23:21 UTC (rev 1040)
@@ -15,7 +15,7 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description><![CDATA[the wikitty to edit]]></description>
@@ -67,8 +67,8 @@
<name>orderBefore</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
-
-
+
+
<attribute>
<description><![CDATA[If a delele button must be in the form]]></description>
<name>allowDelete</name>
@@ -85,9 +85,19 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <description><![CDATA[the proxy from whom search for wikitty required if tag not used inside form tag]]></description>
+ <name>proxy</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[if subtype == wikitty, use the list of wikitty found by criteria as option for select]]></description>
<name>criteria</name>
<rtexprvalue>true</rtexprvalue>
@@ -120,9 +130,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[if subtype == fixed, use the list of fixed value as option for a select]]></description>
<name>fixvalues</name>
<rtexprvalue>true</rtexprvalue>
@@ -149,9 +164,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -167,9 +187,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -182,7 +207,7 @@
<required>true</required>
</attribute>
</tag>
-
+
<tag>
<name>date</name>
<tagclass>org.nuiton.wikitty.struts.tag.DateTag</tagclass>
@@ -190,9 +215,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -210,8 +240,8 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
-
+
<tag>
<name>textArea</name>
<tagclass>org.nuiton.wikitty.struts.tag.TextAreaTag</tagclass>
@@ -219,9 +249,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -242,9 +277,14 @@
<attribute>
<description><![CDATA[id for the field]]></description>
<name>id</name>
- <rtexprvalue>true</rtexprvalue>
+ <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <description><![CDATA[the wikitty to edit]]></description>
+ <name>wikitty</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
1
0
r1039 - in trunk/wikitty-struts/src/main: java resources resources/template resources/template/xhtml
by sletellier@users.nuiton.org 04 Jul '11
by sletellier@users.nuiton.org 04 Jul '11
04 Jul '11
Author: sletellier
Date: 2011-07-04 14:57:41 +0200 (Mon, 04 Jul 2011)
New Revision: 1039
Url: http://nuiton.org/repositories/revision/wikitty/1039
Log:
Move template to correct directory
Added:
trunk/wikitty-struts/src/main/resources/template/
trunk/wikitty-struts/src/main/resources/template/xhtml/
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-boolean-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-boolean.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-commons.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-date-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-date.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-commons.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-hidden-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-hidden.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectcriteria-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectcriteria.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectfixed-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectfixed.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textarea-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textarea.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textfield-close.ftl
trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textfield.ftl
Removed:
trunk/wikitty-struts/src/main/java/template/
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-boolean.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-boolean.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-boolean.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-boolean.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,9 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="checkbox" name="${parameters.fqFieldName}" value="true" <#t/>
+ <#if aKey.value=="true" > <#t/>
+ checked='true'<#t/>
+ </#if>
+ />
+</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-commons.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-commons.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-commons.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-commons.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,3 @@
+<#if parameters.id?? ><#t/>
+id="${parameters.id}"<#t/>
+</#if><#t/>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-date.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-date.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-date.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,7 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${parameters.fqFieldName}" type="text" value="${parameters.value}"> </p>
+</#if><#t/>
+
+
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-close.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-close.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-close.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-close.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,6 @@
+<#include "/${parameters.templateDir}/xhtml/ws-form-commons.ftl" />
+<input type="submit" name="store" value="Store" />
+<#if parameters.allowDelete?? && parameters.allowDelete==true >
+<input type="submit" name="delete" value="Delete" />
+</#if>
+</form>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-commons.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-commons.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-commons.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form-commons.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,50 @@
+<#assign aKeys = parameters.wikittyfields><#t/>
+ <#list aKeys as aKey><#t/>
+<#--<#if aKey.type=="file">
+<input type="hidden" name="${aKey.name}" value="BINARY" />
+${aKey.label} : <input type="file" name="File" label ="File"/>
+</#if>-->
+<#if aKey.type=="hidden">
+<input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="hidden" name="${aKey.name}" value="${aKey.value}" />
+</#if>
+<#if aKey.type=="textarea" >
+${aKey.label} : <textarea
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ cols="80" rows="20" name="${aKey.name}">${aKey.value}</textarea>
+</#if>
+<#if aKey.type=="textfield" >
+${aKey.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="text" name="${aKey.name}" value="${aKey.value}" >
+</#if>
+<#if aKey.type=="boolean" >
+${aKey.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="checkbox" name="${aKey.name}" value="true"
+ <#if aKey.value=="true" >
+ checked='true'
+ </#if>
+ />
+</#if>
+<#--
+
+-->
+<#if aKey.type=="select" >
+${aKey.label} :
+<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${aKey.name}" size="1">
+<#assign optionKeys = aKey.listOption><#t/>
+ <#list optionKeys as optionKey><#t/>
+ <option value="${optionKey.valeur}"
+ <#if optionKey.valeur==aKey.value >
+ selected
+ </#if>
+ > ${optionKey.description} </option>
+ </#list><#t/>
+</select>
+</#if>
+</br>
+</#list><#t/>
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-form.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-form.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,10 @@
+<form
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+class="edit" action="${parameters.action}" method="post" enctype="multipart/form-data" >
+<input type="hidden" name="id" value="${parameters.wikittyid}" />
+<#if parameters.redirect??>
+<input type="hidden" name="redirect" value="${parameters.redirect}" />
+</#if><#t/>
+<#if parameters.orderBefore?? && parameters.orderBefore==true >
+<#include "/${parameters.templateDir}/xhtml/ws-form-commons.ftl" />
+</#if><#t/>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-hidden.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-hidden.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-hidden.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-hidden.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,5 @@
+<#if parameters.included?? && parameters.included==true >
+<input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+type="hidden" name="${parameters.fqFieldName}" value="${parameters.value}" /><#t/>
+</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectcriteria.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectcriteria.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectcriteria.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,14 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} :<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${parameters.fqFieldName}" size="1">
+<#assign optionKeys = parameters.wikittiesvalues>
+ <#list optionKeys as optionKey>
+ <option value="${optionKey.valeur}"<#t/>
+ <#if optionKey.valeur==parameters.value >
+ selected <#t/>
+ </#if> <#t/>
+ > ${optionKey.description} </option>
+ </#list>
+</select><#t/>
+</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectfixed.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectfixed.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-selectfixed.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,14 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} :<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+name="${parameters.fqFieldName}" size="1">
+<#assign optionKeys = parameters.fixvalues><#t/>
+ <#list optionKeys as optionKey><#t/>
+ <option value="${optionKey.valeur}" <#t/>
+ <#if optionKey.valeur==parameters.value >
+ selected <#t/>
+ </#if> <#t/>
+ > ${optionKey.description} </option>
+ </#list>
+</select><#t/>
+</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textarea.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-textarea.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textarea.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textarea.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,5 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} : <textarea
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ cols="80" rows="20" name="${parameters.fqFieldName}">${parameters.value}</textarea><#t/>
+</#if><#t/>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textfield.ftl (from rev 1038, trunk/wikitty-struts/src/main/java/template/xhtml/ws-textfield.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textfield.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/resources/template/xhtml/ws-textfield.ftl 2011-07-04 12:57:41 UTC (rev 1039)
@@ -0,0 +1,5 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+type="text" name="${parameters.fqFieldName}" value="${parameters.value}" ><#t/>
+</#if><#t/>
\ No newline at end of file
1
0
04 Jul '11
Author: mfortun
Date: 2011-07-04 14:13:13 +0200 (Mon, 04 Jul 2011)
New Revision: 1038
Url: http://nuiton.org/repositories/revision/wikitty/1038
Log:
* add an example of the tag lib use, need to be completed
Added:
trunk/wikitty-struts/src/main/webapps/
trunk/wikitty-struts/src/main/webapps/example.jsp
Added: trunk/wikitty-struts/src/main/webapps/example.jsp
===================================================================
--- trunk/wikitty-struts/src/main/webapps/example.jsp (rev 0)
+++ trunk/wikitty-struts/src/main/webapps/example.jsp 2011-07-04 12:13:13 UTC (rev 1038)
@@ -0,0 +1,42 @@
+<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
+<%@page import="org.nuiton.wikitty.entities.Wikitty"%>
+
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@taglib prefix="ws" uri="/wikitty-struts"%>
+
+
+<%
+
+// temp action inherit of the AbstractWikittyEditAction
+TempAction action = TempAction.getAction();
+
+Wikitty wikitty = action.getWikitty();
+
+%>
+
+<% if (wikitty != null) { %>
+<pre><%=StringEscapeUtils.escapeHtml(String.valueOf(wikitty))%></pre>
+<% } %>
+
+<ws:form wikitty="<%=wikitty%>"
+ proxy="<%=action.getProxy()%>"
+ action="/wikitty-publication/temp.action" allowDelete="true"
+ exclude="WikittyToken.date"
+
+>
+
+ <ws:selectCriteria fqFieldName="WikittyToken.user" label="user" criteria="<%=action.getCrit() %>"/>
+ <ws:date fqFieldName="WikittyToken.date" label="dateuh"/>
+ <ws:selectFixed fqFieldName="WikittyUser.password" fixvalues="password,truc,passwordPourri" label="motdepasse"/>
+
+ <!-- exclude="WikittyToken.date"
+ <s:url var="urlFragment" action="temp" />
+ <sj:submit targets="wikittyInfo" href="%{#urlFragment}"> </sj:submit> -->
+</ws:form>
+
+
+
+
+
+
+
Property changes on: trunk/wikitty-struts/src/main/webapps/example.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
1
0
r1037 - in trunk/wikitty-struts/src/main: java/org/nuiton/wikitty/struts java/org/nuiton/wikitty/struts/component java/org/nuiton/wikitty/struts/tag java/template/xhtml tld
by mfortun@users.nuiton.org 04 Jul '11
by mfortun@users.nuiton.org 04 Jul '11
04 Jul '11
Author: mfortun
Date: 2011-07-04 12:16:24 +0200 (Mon, 04 Jul 2011)
New Revision: 1037
Url: http://nuiton.org/repositories/revision/wikitty/1037
Log:
* add support for id attribute
* rename tag
* change location of stack key for handler
Added:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FormTag.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectCriteriaTag.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectFixedTag.java
trunk/wikitty-struts/src/main/java/template/xhtml/ws-commons.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-commons.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-form.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed.ftl
Removed:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FixedSelectBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittySelectBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittyTagBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FixedSelectTag.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittySelectTag.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittyTag.java
trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-commons.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/wikitty.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect.ftl
Modified:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/WikittyFieldHandler.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java
trunk/wikitty-struts/src/main/java/template/xhtml/ws-boolean.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-hidden.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-textarea.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-textfield.ftl
trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/WikittyFieldHandler.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/WikittyFieldHandler.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/WikittyFieldHandler.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -40,6 +40,8 @@
// if include is enable it change how to construct result
protected boolean includeEnable = false;
+ public static final String WIKITTY_STACK_KEY = "wikitty_key";
+
public Set<String> getFieldAdded() {
return fieldAdded;
}
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -23,7 +23,7 @@
super(stack, request, response);
handler = (WikittyFieldHandler) stack.getContext().get(
- WikittyTagBean.WIKITTY_STACK_KEY);
+ WikittyFieldHandler.WIKITTY_STACK_KEY);
if (handler == null) {
log.info("Handler not found in the stack");
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FixedSelectBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FixedSelectBean.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FixedSelectBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,76 +0,0 @@
-package org.nuiton.wikitty.struts.component;
-
-import java.util.LinkedList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.nuiton.util.StringUtil;
-import org.nuiton.wikitty.WikittyUtil;
-import org.nuiton.wikitty.struts.Option;
-import org.nuiton.wikitty.struts.WikittyFieldHandler;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-@StrutsTag(name = "fixedSelect", tldTagClass = "org.nuiton.wikitty.struts.tag.FixedSelectTag", description = "", allowDynamicAttributes = false)
-public class FixedSelectBean extends AbstractWikittyComponent {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- final static private Log log = LogFactory.getLog(FixedSelectBean.class);
-
- public static final String OPEN_TEMPLATE = "ws-fixedselect";
- public static final String TEMPLATE = "ws-fixedselect-close";
-
- protected String fixvalues;
-
- public FixedSelectBean(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- @Override
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- // if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
- handler.addAddedField(fqFieldName);
- // parse extname and field name
- String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
- // add parametters to be use by the template
- addParameter("included", true);
- addParameter(
- "value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
- fieldsAccess[1]));
-
- List<Option> fixlist = new LinkedList<Option>();
- String[] values = StringUtil.split(fixvalues, WikittyFieldHandler.FIELD_SEPARATOR);
- for (String it : values) {
- fixlist.add(new Option(it, it));
- }
- addParameter("fixvalues", fixlist);
-
- }
-
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public String getFixvalues() {
- return fixvalues;
- }
-
- public void setFixvalues(String fixvalues) {
- this.fixvalues = fixvalues;
- }
-
-}
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittyTagBean.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,201 @@
+package org.nuiton.wikitty.struts.component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.components.ClosingUIBean;
+import org.apache.struts2.views.annotations.StrutsTag;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.struts.WikittyFieldHandler;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+@StrutsTag(name = "Wikitty", tldTagClass = "org.nuiton.wikitty.struts.tag.FormTag",
+ description = "", allowDynamicAttributes = false)
+public class FormTagBean extends ClosingUIBean {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ final static private Log log = LogFactory.getLog(FormTagBean.class);
+
+
+ public static final String OPEN_TEMPLATE = "ws-form";
+ public static final String TEMPLATE = "ws-form-close";
+ protected Wikitty wikitty;
+ protected WikittyProxy proxy;
+
+ protected String action;
+ protected String redirect;
+
+ protected String include;
+ protected String exclude;
+
+ protected String order;
+ protected Boolean orderBefore;
+
+ protected Boolean allowDelete;
+
+ public FormTagBean(ValueStack stack, HttpServletRequest request,
+ HttpServletResponse response) {
+ super(stack, request, response);
+ }
+
+ @Override
+ protected void evaluateExtraParams() {
+ super.evaluateExtraParams();
+
+
+ /* this methode is called two times:
+ * - first when the wikitty open tag is red
+ * - second when the wikitty closing tag is red
+ *
+ * for the first called this create an object wikittyfieldhandler
+ * that will be store inside the stack and used by the included tag (
+ * inside the wikitty tags to store)
+ *
+ *
+ */
+
+ if (action != null) {
+ addParameter("action", findString(action));
+ }
+
+ if (redirect != null) {
+ addParameter("redirect", findString(redirect));
+ }
+
+ if (allowDelete != null) {
+ addParameter("allowDelete", allowDelete);
+ }
+
+ if (orderBefore!=null) {
+ addParameter("orderBefore", orderBefore);
+ }
+
+ if (wikitty != null) {
+ addParameter("wikittyid", findString(wikitty.getId()));
+ //no uses finally:
+ //addParameter("wikittyversion", findString(wikitty.getVersion()));
+ //addParameter("wikittyextensions", findString(wikitty
+ // .getExtensionNames().toString()));
+ }
+
+ Object temp = stack.getContext().get(WikittyFieldHandler.WIKITTY_STACK_KEY);
+ WikittyFieldHandler handler;
+ if (temp == null) {
+
+ // construct wikitty field handler withh
+ // all required param and put it in the stack
+ handler = new WikittyFieldHandler();
+
+ log.info(handler + " Added to the stack");
+
+ stack.getContext().put(WikittyFieldHandler.WIKITTY_STACK_KEY, handler);
+
+ handler.setExclude(exclude);
+ handler.setInclude(include);
+ handler.setOrder(order);
+ handler.setWikitty(wikitty);
+ handler.setProxy(proxy);
+ handler.setOrderBefore(orderBefore);
+
+ } else {
+ handler = (WikittyFieldHandler) temp;
+ }
+ // add field that have to be write inside the page
+ log.info("add wikitty fields to the parametters");
+ addParameter("wikittyfields", handler.getWikittyField());
+
+
+ }
+
+ public String getDefaultOpenTemplate() {
+ return OPEN_TEMPLATE;
+ }
+
+ protected String getDefaultTemplate() {
+ return TEMPLATE;
+ }
+
+ public Wikitty getWikitty() {
+ return wikitty;
+ }
+
+ public void setWikitty(Wikitty wikitty) {
+ this.wikitty = wikitty;
+ }
+
+ public WikittyProxy getProxy() {
+ return proxy;
+ }
+
+ public void setProxy(WikittyProxy proxy) {
+ this.proxy = proxy;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public String getRedirect() {
+ return redirect;
+ }
+
+ public void setRedirect(String redirect) {
+ this.redirect = redirect;
+ }
+
+ public String getInclude() {
+ return include;
+ }
+
+ public void setInclude(String include) {
+ this.include = include;
+ }
+
+ public String getExclude() {
+ return exclude;
+ }
+
+ public void setExclude(String exclude) {
+ this.exclude = exclude;
+ }
+
+ public String getOrder() {
+ return order;
+ }
+
+ public void setOrder(String order) {
+ this.order = order;
+ }
+
+ public boolean isAllowDelete() {
+ return allowDelete;
+ }
+
+ public void setAllowDelete(boolean allowDelete) {
+ this.allowDelete = allowDelete;
+ }
+
+ public Boolean getOrderBefore() {
+ return orderBefore;
+ }
+
+ public void setOrderBefore(Boolean orderBefore) {
+ this.orderBefore = orderBefore;
+ }
+
+ public Boolean getAllowDelete() {
+ return allowDelete;
+ }
+
+ public void setAllowDelete(Boolean allowDelete) {
+ this.allowDelete = allowDelete;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FormTagBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittySelectBean.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,121 @@
+package org.nuiton.wikitty.struts.component;
+
+import java.util.LinkedList;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.views.annotations.StrutsTag;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.WikittyUtil;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.search.Criteria;
+import org.nuiton.wikitty.search.PagedResult;
+import org.nuiton.wikitty.struts.Option;
+import org.nuiton.wikitty.struts.WikittyFieldHandler;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+@StrutsTag(name = "wikittyselect", tldTagClass = "org.nuiton.wikitty.struts.tag.SelectCriteriaTag", description = "", allowDynamicAttributes = false)
+public class SelectCriteriaBean extends AbstractWikittyComponent {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ final static private Log log = LogFactory.getLog(SelectCriteriaBean.class);
+
+ public static final String OPEN_TEMPLATE = "ws-selectcriteria";
+ public static final String TEMPLATE = "ws-selectcriteria-close";
+
+ protected Criteria criteria;
+ protected String descfield;
+
+ public SelectCriteriaBean(ValueStack stack, HttpServletRequest request,
+ HttpServletResponse response) {
+ super(stack, request, response);
+ }
+
+ @Override
+ protected void evaluateExtraParams() {
+ super.evaluateExtraParams();
+
+
+ // if field defined as inclued
+ if (handler.isIncluded(fqFieldName)) {
+
+
+
+
+ handler.addAddedField(fqFieldName);
+
+ // parse extname and field name
+ String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
+ // add parametters to be use by the template
+ addParameter("included", true);
+ addParameter(
+ "value",
+ handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ fieldsAccess[1]));
+
+ List<Option> fixlist = new LinkedList<Option>();
+
+ // search for the wikitty with the criteria
+ PagedResult<Wikitty> wikitties = handler.getProxy()
+ .findAllByCriteria(criteria);
+
+ String[] descriptor = StringUtil.split(descfield, WikittyFieldHandler.FIELD_SEPARATOR);
+
+ // if wikitties not null contruct option result
+ // with descriptor
+ if (wikitties != null) {
+ for (Wikitty wiki : wikitties) {
+ // by default value and description are the same
+ // wikitty id
+ String val = wiki.getId();
+
+ String desc = wiki.getId();
+
+ // if attribute descripteur fill with something
+ // extract from wikitty corresponding field value
+ if (descriptor.length != 0) {
+ desc = "";
+ for (String descriptorIt : descriptor) {
+ String[] descTable = StringUtil.split(descriptorIt,
+ ".");
+
+ desc += wiki.getFieldAsWikitty(descTable[0],
+ descTable[1]);
+ }
+ }
+ fixlist.add(new Option(val, desc));
+ }
+ addParameter("wikittiesvalues", fixlist);
+ }
+ }
+
+ }
+
+ public String getDefaultOpenTemplate() {
+ return OPEN_TEMPLATE;
+ }
+
+ protected String getDefaultTemplate() {
+ return TEMPLATE;
+ }
+
+ public Criteria getCriteria() {
+ return criteria;
+ }
+
+ public void setCriteria(Criteria criteria) {
+ this.criteria = criteria;
+ }
+
+ public String getDescfield() {
+ return descfield;
+ }
+
+ public void setDescfield(String descfield) {
+ this.descfield = descfield;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectCriteriaBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/FixedSelectBean.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,76 @@
+package org.nuiton.wikitty.struts.component;
+
+import java.util.LinkedList;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.views.annotations.StrutsTag;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.WikittyUtil;
+import org.nuiton.wikitty.struts.Option;
+import org.nuiton.wikitty.struts.WikittyFieldHandler;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+@StrutsTag(name = "fixedSelect", tldTagClass = "org.nuiton.wikitty.struts.tag.SelectFixedTag", description = "", allowDynamicAttributes = false)
+public class SelectFixedBean extends AbstractWikittyComponent {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ final static private Log log = LogFactory.getLog(SelectFixedBean.class);
+
+ public static final String OPEN_TEMPLATE = "ws-selectfixed";
+ public static final String TEMPLATE = "ws-selectfixed-close";
+
+ protected String fixvalues;
+
+ public SelectFixedBean(ValueStack stack, HttpServletRequest request,
+ HttpServletResponse response) {
+ super(stack, request, response);
+ }
+
+ @Override
+ protected void evaluateExtraParams() {
+ super.evaluateExtraParams();
+
+ // if field defined as inclued
+ if (handler.isIncluded(fqFieldName)) {
+ handler.addAddedField(fqFieldName);
+ // parse extname and field name
+ String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
+ // add parametters to be use by the template
+ addParameter("included", true);
+ addParameter(
+ "value",
+ handler.getWikitty().getFieldAsString(fieldsAccess[0],
+ fieldsAccess[1]));
+
+ List<Option> fixlist = new LinkedList<Option>();
+ String[] values = StringUtil.split(fixvalues, WikittyFieldHandler.FIELD_SEPARATOR);
+ for (String it : values) {
+ fixlist.add(new Option(it, it));
+ }
+ addParameter("fixvalues", fixlist);
+
+ }
+
+ }
+
+ public String getDefaultOpenTemplate() {
+ return OPEN_TEMPLATE;
+ }
+
+ protected String getDefaultTemplate() {
+ return TEMPLATE;
+ }
+
+ public String getFixvalues() {
+ return fixvalues;
+ }
+
+ public void setFixvalues(String fixvalues) {
+ this.fixvalues = fixvalues;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/SelectFixedBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittySelectBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittySelectBean.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittySelectBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,121 +0,0 @@
-package org.nuiton.wikitty.struts.component;
-
-import java.util.LinkedList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.nuiton.util.StringUtil;
-import org.nuiton.wikitty.WikittyUtil;
-import org.nuiton.wikitty.entities.Wikitty;
-import org.nuiton.wikitty.search.Criteria;
-import org.nuiton.wikitty.search.PagedResult;
-import org.nuiton.wikitty.struts.Option;
-import org.nuiton.wikitty.struts.WikittyFieldHandler;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-@StrutsTag(name = "wikittyselect", tldTagClass = "org.nuiton.wikitty.struts.tag.WikittySelectTag", description = "", allowDynamicAttributes = false)
-public class WikittySelectBean extends AbstractWikittyComponent {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- final static private Log log = LogFactory.getLog(WikittySelectBean.class);
-
- public static final String OPEN_TEMPLATE = "ws-wikittyselect";
- public static final String TEMPLATE = "ws-wikittyselect-close";
-
- protected Criteria criteria;
- protected String descfield;
-
- public WikittySelectBean(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- @Override
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
-
- // if field defined as inclued
- if (handler.isIncluded(fqFieldName)) {
-
-
-
-
- handler.addAddedField(fqFieldName);
-
- // parse extname and field name
- String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
- // add parametters to be use by the template
- addParameter("included", true);
- addParameter(
- "value",
- handler.getWikitty().getFieldAsString(fieldsAccess[0],
- fieldsAccess[1]));
-
- List<Option> fixlist = new LinkedList<Option>();
-
- // search for the wikitty with the criteria
- PagedResult<Wikitty> wikitties = handler.getProxy()
- .findAllByCriteria(criteria);
-
- String[] descriptor = StringUtil.split(descfield, WikittyFieldHandler.FIELD_SEPARATOR);
-
- // if wikitties not null contruct option result
- // with descriptor
- if (wikitties != null) {
- for (Wikitty wiki : wikitties) {
- // by default value and description are the same
- // wikitty id
- String val = wiki.getId();
-
- String desc = wiki.getId();
-
- // if attribute descripteur fill with something
- // extract from wikitty corresponding field value
- if (descriptor.length != 0) {
- desc = "";
- for (String descriptorIt : descriptor) {
- String[] descTable = StringUtil.split(descriptorIt,
- ".");
-
- desc += wiki.getFieldAsWikitty(descTable[0],
- descTable[1]);
- }
- }
- fixlist.add(new Option(val, desc));
- }
- addParameter("wikittiesvalues", fixlist);
- }
- }
-
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public Criteria getCriteria() {
- return criteria;
- }
-
- public void setCriteria(Criteria criteria) {
- this.criteria = criteria;
- }
-
- public String getDescfield() {
- return descfield;
- }
-
- public void setDescfield(String descfield) {
- this.descfield = descfield;
- }
-
-}
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittyTagBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittyTagBean.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/WikittyTagBean.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,203 +0,0 @@
-package org.nuiton.wikitty.struts.component;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts2.components.ClosingUIBean;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.entities.Wikitty;
-import org.nuiton.wikitty.struts.WikittyFieldHandler;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-@StrutsTag(name = "Wikitty", tldTagClass = "org.nuiton.wikitty.struts.tag.WikittyTag",
- description = "", allowDynamicAttributes = false)
-public class WikittyTagBean extends ClosingUIBean {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- final static private Log log = LogFactory.getLog(WikittyTagBean.class);
-
-
- public static final String OPEN_TEMPLATE = "wikitty";
- public static final String TEMPLATE = "wikitty-close";
- public static final String WIKITTY_STACK_KEY = "wikitty_key";
-
- protected Wikitty wikitty;
- protected WikittyProxy proxy;
-
- protected String action;
- protected String redirect;
-
- protected String include;
- protected String exclude;
-
- protected String order;
- protected Boolean orderBefore;
-
- protected Boolean allowDelete;
-
- public WikittyTagBean(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- @Override
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
-
- /* this methode is called two times:
- * - first when the wikitty open tag is red
- * - second when the wikitty closing tag is red
- *
- * for the first called this create an object wikittyfieldhandler
- * that will be store inside the stack and used by the included tag (
- * inside the wikitty tags to store)
- *
- *
- */
-
- if (action != null) {
- addParameter("action", findString(action));
- }
-
- if (redirect != null) {
- addParameter("redirect", findString(redirect));
- }
-
- if (allowDelete != null) {
- addParameter("allowDelete", allowDelete);
- }
-
- if (orderBefore!=null) {
- addParameter("orderBefore", orderBefore);
- }
-
- if (wikitty != null) {
- addParameter("wikittyid", findString(wikitty.getId()));
- //no uses finally:
- //addParameter("wikittyversion", findString(wikitty.getVersion()));
- //addParameter("wikittyextensions", findString(wikitty
- // .getExtensionNames().toString()));
- }
-
- Object temp = stack.getContext().get(WIKITTY_STACK_KEY);
- WikittyFieldHandler handler;
- if (temp == null) {
-
- // construct wikitty field handler withh
- // all required param and put it in the stack
- handler = new WikittyFieldHandler();
-
- log.info(handler + " Added to the stack");
-
- stack.getContext().put(WIKITTY_STACK_KEY, handler);
-
- handler.setExclude(exclude);
- handler.setInclude(include);
- handler.setOrder(order);
- handler.setWikitty(wikitty);
- handler.setProxy(proxy);
- handler.setOrderBefore(orderBefore);
-
- } else {
- handler = (WikittyFieldHandler) temp;
- }
- // add field that have to be write inside the page
- log.info("add wikitty fields to the parametters");
- addParameter("wikittyfields", handler.getWikittyField());
-
-
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public Wikitty getWikitty() {
- return wikitty;
- }
-
- public void setWikitty(Wikitty wikitty) {
- this.wikitty = wikitty;
- }
-
- public WikittyProxy getProxy() {
- return proxy;
- }
-
- public void setProxy(WikittyProxy proxy) {
- this.proxy = proxy;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getRedirect() {
- return redirect;
- }
-
- public void setRedirect(String redirect) {
- this.redirect = redirect;
- }
-
- public String getInclude() {
- return include;
- }
-
- public void setInclude(String include) {
- this.include = include;
- }
-
- public String getExclude() {
- return exclude;
- }
-
- public void setExclude(String exclude) {
- this.exclude = exclude;
- }
-
- public String getOrder() {
- return order;
- }
-
- public void setOrder(String order) {
- this.order = order;
- }
-
- public boolean isAllowDelete() {
- return allowDelete;
- }
-
- public void setAllowDelete(boolean allowDelete) {
- this.allowDelete = allowDelete;
- }
-
- public Boolean getOrderBefore() {
- return orderBefore;
- }
-
- public void setOrderBefore(Boolean orderBefore) {
- this.orderBefore = orderBefore;
- }
-
- public Boolean getAllowDelete() {
- return allowDelete;
- }
-
- public void setAllowDelete(Boolean allowDelete) {
- this.allowDelete = allowDelete;
- }
-
-}
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FixedSelectTag.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FixedSelectTag.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FixedSelectTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,43 +0,0 @@
-package org.nuiton.wikitty.struts.tag;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-import org.nuiton.wikitty.struts.component.FixedSelectBean;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class FixedSelectTag extends AbstractWikittyTag {
-
- /**
- *
- */
- private static final long serialVersionUID = -8415432856577152486L;
- protected String fixvalues;
-
- @Override
- public Component getBean(ValueStack stack, HttpServletRequest req,
- HttpServletResponse res) {
- return new FixedSelectBean(stack, req, res);
- }
-
- @Override
- protected void populateParams() {
- super.populateParams();
- FixedSelectBean fieldtag = ((FixedSelectBean) component);
-
- fieldtag.setFixvalues(fixvalues);
-
- }
-
- public String getFixvalues() {
- return fixvalues;
- }
-
- public void setFixvalues(String fixvalues) {
- this.fixvalues = fixvalues;
- }
-
-}
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FormTag.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittyTag.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FormTag.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FormTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,123 @@
+package org.nuiton.wikitty.struts.tag;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.struts2.components.Component;
+import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.struts.component.FormTagBean;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+public class FormTag extends AbstractClosingTag {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 258152544560583399L;
+ protected Wikitty wikitty;
+ protected WikittyProxy proxy;
+ protected String action;
+ protected String redirect;
+ protected String include;
+ protected String exclude;
+ protected String order;
+ protected boolean allowDelete;
+ protected boolean orderBefore;
+
+ public boolean isOrderBefore() {
+ return orderBefore;
+ }
+
+ public void setOrderBefore(boolean orderBefore) {
+ this.orderBefore = orderBefore;
+ }
+
+ public String getInclude() {
+ return include;
+ }
+
+ public void setInclude(String include) {
+ this.include = include;
+ }
+
+ public String getExclude() {
+ return exclude;
+ }
+
+ public void setExclude(String exclude) {
+ this.exclude = exclude;
+ }
+
+ public String getOrder() {
+ return order;
+ }
+
+ public void setOrder(String order) {
+ this.order = order;
+ }
+
+ public boolean isAllowDelete() {
+ return allowDelete;
+ }
+
+ public void setAllowDelete(boolean allowDelete) {
+ this.allowDelete = allowDelete;
+ }
+
+ @Override
+ public Component getBean(ValueStack stack, HttpServletRequest req,
+ HttpServletResponse res) {
+ return new FormTagBean(stack, req, res);
+
+ }
+
+ @Override
+ protected void populateParams() {
+ super.populateParams();
+ FormTagBean wikittyTag = ((FormTagBean) component);
+ wikittyTag.setAction(action);
+ wikittyTag.setRedirect(redirect);
+ wikittyTag.setWikitty(wikitty);
+ wikittyTag.setProxy(proxy);
+ wikittyTag.setOrder(order);
+ wikittyTag.setOrderBefore(orderBefore);
+ wikittyTag.setAllowDelete(allowDelete);
+ wikittyTag.setInclude(include);
+ wikittyTag.setExclude(exclude);
+ }
+
+ public Wikitty getWikitty() {
+ return wikitty;
+ }
+
+ public void setWikitty(Wikitty wikitty) {
+ this.wikitty = wikitty;
+ }
+
+ public WikittyProxy getProxy() {
+ return proxy;
+ }
+
+ public void setProxy(WikittyProxy proxy) {
+ this.proxy = proxy;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public String getRedirect() {
+ return redirect;
+ }
+
+ public void setRedirect(String redirect) {
+ this.redirect = redirect;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FormTag.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectCriteriaTag.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittySelectTag.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectCriteriaTag.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectCriteriaTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,58 @@
+package org.nuiton.wikitty.struts.tag;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts2.components.Component;
+import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
+
+import org.nuiton.wikitty.search.Criteria;
+import org.nuiton.wikitty.struts.component.SelectCriteriaBean;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+public class SelectCriteriaTag extends AbstractWikittyTag {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2807198744532780915L;
+ protected Criteria criteria;
+ protected String descfield;
+
+ @Override
+ public Component getBean(ValueStack stack, HttpServletRequest req,
+ HttpServletResponse res) {
+ return new SelectCriteriaBean(stack, req, res);
+
+ }
+
+
+
+ @Override
+ protected void populateParams() {
+ super.populateParams();
+ SelectCriteriaBean fieldtag = ((SelectCriteriaBean) component);
+
+ fieldtag.setCriteria(criteria);
+ fieldtag.setDescfield(descfield);
+ }
+
+
+ public Criteria getCriteria() {
+ return criteria;
+ }
+
+ public void setCriteria(Criteria criteria) {
+ this.criteria = criteria;
+ }
+
+ public String getDescfield() {
+ return descfield;
+ }
+
+ public void setDescfield(String descfield) {
+ this.descfield = descfield;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectCriteriaTag.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectFixedTag.java (from rev 1033, trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/FixedSelectTag.java)
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectFixedTag.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectFixedTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,43 @@
+package org.nuiton.wikitty.struts.tag;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts2.components.Component;
+import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
+import org.nuiton.wikitty.struts.component.SelectFixedBean;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+public class SelectFixedTag extends AbstractWikittyTag {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8415432856577152486L;
+ protected String fixvalues;
+
+ @Override
+ public Component getBean(ValueStack stack, HttpServletRequest req,
+ HttpServletResponse res) {
+ return new SelectFixedBean(stack, req, res);
+ }
+
+ @Override
+ protected void populateParams() {
+ super.populateParams();
+ SelectFixedBean fieldtag = ((SelectFixedBean) component);
+
+ fieldtag.setFixvalues(fixvalues);
+
+ }
+
+ public String getFixvalues() {
+ return fixvalues;
+ }
+
+ public void setFixvalues(String fixvalues) {
+ this.fixvalues = fixvalues;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/SelectFixedTag.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittySelectTag.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittySelectTag.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittySelectTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,58 +0,0 @@
-package org.nuiton.wikitty.struts.tag;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-
-import org.nuiton.wikitty.search.Criteria;
-import org.nuiton.wikitty.struts.component.WikittySelectBean;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class WikittySelectTag extends AbstractWikittyTag {
-
- /**
- *
- */
- private static final long serialVersionUID = 2807198744532780915L;
- protected Criteria criteria;
- protected String descfield;
-
- @Override
- public Component getBean(ValueStack stack, HttpServletRequest req,
- HttpServletResponse res) {
- return new WikittySelectBean(stack, req, res);
-
- }
-
-
-
- @Override
- protected void populateParams() {
- super.populateParams();
- WikittySelectBean fieldtag = ((WikittySelectBean) component);
-
- fieldtag.setCriteria(criteria);
- fieldtag.setDescfield(descfield);
- }
-
-
- public Criteria getCriteria() {
- return criteria;
- }
-
- public void setCriteria(Criteria criteria) {
- this.criteria = criteria;
- }
-
- public String getDescfield() {
- return descfield;
- }
-
- public void setDescfield(String descfield) {
- this.descfield = descfield;
- }
-
-}
Deleted: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittyTag.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittyTag.java 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/WikittyTag.java 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,123 +0,0 @@
-package org.nuiton.wikitty.struts.tag;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.struts2.components.Component;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.entities.Wikitty;
-import org.nuiton.wikitty.struts.component.WikittyTagBean;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class WikittyTag extends AbstractClosingTag {
-
- /**
- *
- */
- private static final long serialVersionUID = 258152544560583399L;
- protected Wikitty wikitty;
- protected WikittyProxy proxy;
- protected String action;
- protected String redirect;
- protected String include;
- protected String exclude;
- protected String order;
- protected boolean allowDelete;
- protected boolean orderBefore;
-
- public boolean isOrderBefore() {
- return orderBefore;
- }
-
- public void setOrderBefore(boolean orderBefore) {
- this.orderBefore = orderBefore;
- }
-
- public String getInclude() {
- return include;
- }
-
- public void setInclude(String include) {
- this.include = include;
- }
-
- public String getExclude() {
- return exclude;
- }
-
- public void setExclude(String exclude) {
- this.exclude = exclude;
- }
-
- public String getOrder() {
- return order;
- }
-
- public void setOrder(String order) {
- this.order = order;
- }
-
- public boolean isAllowDelete() {
- return allowDelete;
- }
-
- public void setAllowDelete(boolean allowDelete) {
- this.allowDelete = allowDelete;
- }
-
- @Override
- public Component getBean(ValueStack stack, HttpServletRequest req,
- HttpServletResponse res) {
- return new WikittyTagBean(stack, req, res);
-
- }
-
- @Override
- protected void populateParams() {
- super.populateParams();
- WikittyTagBean wikittyTag = ((WikittyTagBean) component);
- wikittyTag.setAction(action);
- wikittyTag.setRedirect(redirect);
- wikittyTag.setWikitty(wikitty);
- wikittyTag.setProxy(proxy);
- wikittyTag.setOrder(order);
- wikittyTag.setOrderBefore(orderBefore);
- wikittyTag.setAllowDelete(allowDelete);
- wikittyTag.setInclude(include);
- wikittyTag.setExclude(exclude);
- }
-
- public Wikitty getWikitty() {
- return wikitty;
- }
-
- public void setWikitty(Wikitty wikitty) {
- this.wikitty = wikitty;
- }
-
- public WikittyProxy getProxy() {
- return proxy;
- }
-
- public void setProxy(WikittyProxy proxy) {
- this.proxy = proxy;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getRedirect() {
- return redirect;
- }
-
- public void setRedirect(String redirect) {
- this.redirect = redirect;
- }
-
-}
Deleted: trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-close.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-close.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-close.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,6 +0,0 @@
-<#include "/${parameters.templateDir}/xhtml/wikitty-commons.ftl" />
-<input type="submit" name="store" value="Store" />
-<#if parameters.allowDelete?? && parameters.allowDelete==true >
-<input type="submit" name="delete" value="Delete" />
-</#if>
-</form>
\ No newline at end of file
Deleted: trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-commons.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-commons.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-commons.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,40 +0,0 @@
-<#assign aKeys = parameters.wikittyfields><#t/>
- <#list aKeys as aKey><#t/>
-<#--<#if aKey.type=="file">
-<input type="hidden" name="${aKey.name}" value="BINARY" />
-${aKey.label} : <input type="file" name="File" label ="File"/>
-</#if>-->
-<#if aKey.type=="hidden">
-<input type="hidden" name="${aKey.name}" value="${aKey.value}" />
-</#if>
-<#if aKey.type=="textarea" >
-${aKey.label} : <textarea id="${aKey.name}" cols="80" rows="20" name="${aKey.name}">${aKey.value}</textarea>
-</#if>
-<#if aKey.type=="textfield" >
-${aKey.label} : <input type="text" name="${aKey.name}" value="${aKey.value}" >
-</#if>
-<#if aKey.type=="boolean" >
-${aKey.label} : <input type="checkbox" name="${aKey.name}" value="true"
- <#if aKey.value=="true" >
- checked='true'
- </#if>
- />
-</#if>
-<#--
-
--->
-<#if aKey.type=="select" >
-${aKey.label} :
-<select name="${aKey.name}" size="1">
-<#assign optionKeys = aKey.listOption><#t/>
- <#list optionKeys as optionKey><#t/>
- <option value="${optionKey.valeur}"
- <#if optionKey.valeur==aKey.value >
- selected
- </#if>
- > ${optionKey.description} </option>
- </#list><#t/>
-</select>
-</#if>
-</br>
-</#list><#t/>
Deleted: trunk/wikitty-struts/src/main/java/template/xhtml/wikitty.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/wikitty.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/wikitty.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,8 +0,0 @@
-<form class="edit" action="${parameters.action}" method="post" enctype="multipart/form-data" >
-<input type="hidden" name="id" value="${parameters.wikittyid}" />
-<#if parameters.redirect??>
-<input type="hidden" name="redirect" value="${parameters.redirect}" />
-</#if><#t/>
-<#if parameters.orderBefore?? && parameters.orderBefore==true >
-<#include "/${parameters.templateDir}/xhtml/wikitty-commons.ftl" />
-</#if><#t/>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/java/template/xhtml/ws-boolean.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-boolean.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-boolean.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,5 +1,7 @@
<#if parameters.included?? && parameters.included==true >
-${parameters.label} : <input type="checkbox" name="${parameters.fqFieldName}" value="true" <#t/>
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="checkbox" name="${parameters.fqFieldName}" value="true" <#t/>
<#if aKey.value=="true" > <#t/>
checked='true'<#t/>
</#if>
Added: trunk/wikitty-struts/src/main/java/template/xhtml/ws-commons.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-commons.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-commons.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,3 @@
+<#if parameters.id?? ><#t/>
+id="${parameters.id}"<#t/>
+</#if><#t/>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,5 +1,7 @@
<#if parameters.included?? && parameters.included==true >
-${parameters.label} : <input id="datepicker" name="${parameters.fqFieldName}" type="text" value="${parameters.value}"> </p>
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${parameters.fqFieldName}" type="text" value="${parameters.value}"> </p>
</#if><#t/>
Deleted: trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,12 +0,0 @@
-<#if parameters.included?? && parameters.included==true >
-${parameters.label} :<select name="${parameters.fqFieldName}" size="1">
-<#assign optionKeys = parameters.fixvalues><#t/>
- <#list optionKeys as optionKey><#t/>
- <option value="${optionKey.valeur}" <#t/>
- <#if optionKey.valeur==parameters.value >
- selected <#t/>
- </#if> <#t/>
- > ${optionKey.description} </option>
- </#list>
-</select><#t/>
-</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-close.ftl (from rev 1033, trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-close.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-close.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-close.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,6 @@
+<#include "/${parameters.templateDir}/xhtml/ws-form-commons.ftl" />
+<input type="submit" name="store" value="Store" />
+<#if parameters.allowDelete?? && parameters.allowDelete==true >
+<input type="submit" name="delete" value="Delete" />
+</#if>
+</form>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-commons.ftl (from rev 1033, trunk/wikitty-struts/src/main/java/template/xhtml/wikitty-commons.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-commons.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-form-commons.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,50 @@
+<#assign aKeys = parameters.wikittyfields><#t/>
+ <#list aKeys as aKey><#t/>
+<#--<#if aKey.type=="file">
+<input type="hidden" name="${aKey.name}" value="BINARY" />
+${aKey.label} : <input type="file" name="File" label ="File"/>
+</#if>-->
+<#if aKey.type=="hidden">
+<input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="hidden" name="${aKey.name}" value="${aKey.value}" />
+</#if>
+<#if aKey.type=="textarea" >
+${aKey.label} : <textarea
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ cols="80" rows="20" name="${aKey.name}">${aKey.value}</textarea>
+</#if>
+<#if aKey.type=="textfield" >
+${aKey.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="text" name="${aKey.name}" value="${aKey.value}" >
+</#if>
+<#if aKey.type=="boolean" >
+${aKey.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ type="checkbox" name="${aKey.name}" value="true"
+ <#if aKey.value=="true" >
+ checked='true'
+ </#if>
+ />
+</#if>
+<#--
+
+-->
+<#if aKey.type=="select" >
+${aKey.label} :
+<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${aKey.name}" size="1">
+<#assign optionKeys = aKey.listOption><#t/>
+ <#list optionKeys as optionKey><#t/>
+ <option value="${optionKey.valeur}"
+ <#if optionKey.valeur==aKey.value >
+ selected
+ </#if>
+ > ${optionKey.description} </option>
+ </#list><#t/>
+</select>
+</#if>
+</br>
+</#list><#t/>
Copied: trunk/wikitty-struts/src/main/java/template/xhtml/ws-form.ftl (from rev 1033, trunk/wikitty-struts/src/main/java/template/xhtml/wikitty.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-form.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-form.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,10 @@
+<form
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+class="edit" action="${parameters.action}" method="post" enctype="multipart/form-data" >
+<input type="hidden" name="id" value="${parameters.wikittyid}" />
+<#if parameters.redirect??>
+<input type="hidden" name="redirect" value="${parameters.redirect}" />
+</#if><#t/>
+<#if parameters.orderBefore?? && parameters.orderBefore==true >
+<#include "/${parameters.templateDir}/xhtml/ws-form-commons.ftl" />
+</#if><#t/>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/java/template/xhtml/ws-hidden.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-hidden.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-hidden.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,3 +1,5 @@
<#if parameters.included?? && parameters.included==true >
-<input type="hidden" name="${parameters.fqFieldName}" value="${parameters.value}" /><#t/>
+<input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+type="hidden" name="${parameters.fqFieldName}" value="${parameters.value}" /><#t/>
</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria.ftl (from rev 1033, trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectcriteria.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,14 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} :<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ name="${parameters.fqFieldName}" size="1">
+<#assign optionKeys = parameters.wikittiesvalues>
+ <#list optionKeys as optionKey>
+ <option value="${optionKey.valeur}"<#t/>
+ <#if optionKey.valeur==parameters.value >
+ selected <#t/>
+ </#if> <#t/>
+ > ${optionKey.description} </option>
+ </#list>
+</select><#t/>
+</#if>
\ No newline at end of file
Copied: trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed.ftl (from rev 1033, trunk/wikitty-struts/src/main/java/template/xhtml/ws-fixedselect.ftl)
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-selectfixed.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -0,0 +1,14 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} :<select
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+name="${parameters.fqFieldName}" size="1">
+<#assign optionKeys = parameters.fixvalues><#t/>
+ <#list optionKeys as optionKey><#t/>
+ <option value="${optionKey.valeur}" <#t/>
+ <#if optionKey.valeur==parameters.value >
+ selected <#t/>
+ </#if> <#t/>
+ > ${optionKey.description} </option>
+ </#list>
+</select><#t/>
+</#if>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/java/template/xhtml/ws-textarea.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-textarea.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-textarea.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,3 +1,5 @@
<#if parameters.included?? && parameters.included==true >
-${parameters.label} : <textarea id="${parameters.fqFieldName}" cols="80" rows="20" name="${parameters.fqFieldName}">${parameters.value}</textarea><#t/>
+${parameters.label} : <textarea
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+ cols="80" rows="20" name="${parameters.fqFieldName}">${parameters.value}</textarea><#t/>
</#if><#t/>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/java/template/xhtml/ws-textfield.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-textfield.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-textfield.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,3 +1,5 @@
<#if parameters.included?? && parameters.included==true >
-${parameters.label} : <input type="text" name="${parameters.fqFieldName}" value="${parameters.value}" ><#t/>
+${parameters.label} : <input
+<#include "/${parameters.templateDir}/xhtml/ws-commons.ftl" />
+type="text" name="${parameters.fqFieldName}" value="${parameters.value}" ><#t/>
</#if><#t/>
\ No newline at end of file
Deleted: trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect.ftl 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-wikittyselect.ftl 2011-07-04 10:16:24 UTC (rev 1037)
@@ -1,12 +0,0 @@
-<#if parameters.included?? && parameters.included==true >
-${parameters.label} :<select name="${parameters.fqFieldName}" size="1">
-<#assign optionKeys = parameters.wikittiesvalues>
- <#list optionKeys as optionKey>
- <option value="${optionKey.valeur}"<#t/>
- <#if optionKey.valeur==parameters.value >
- selected <#t/>
- </#if> <#t/>
- > ${optionKey.description} </option>
- </#list>
-</select><#t/>
-</#if>
\ No newline at end of file
Modified: trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
===================================================================
--- trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-01 15:45:35 UTC (rev 1036)
+++ trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-04 10:16:24 UTC (rev 1037)
@@ -9,10 +9,15 @@
<uri>/wikitty-struts</uri>
<tag>
- <name>wikitty</name>
- <tagclass>org.nuiton.wikitty.struts.tag.WikittyTag</tagclass>
+ <name>form</name>
+ <tagclass>org.nuiton.wikitty.struts.tag.FormTag</tagclass>
<description><![CDATA[Tag use to make a form to edit wikitty]]></description>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the wikitty to edit]]></description>
<name>wikitty</name>
<rtexprvalue>true</rtexprvalue>
@@ -74,10 +79,15 @@
<tag>
- <name>wikittySelect</name>
- <tagclass>org.nuiton.wikitty.struts.tag.WikittySelectTag</tagclass>
+ <name>selectCriteria</name>
+ <tagclass>org.nuiton.wikitty.struts.tag.SelectCriteriaTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[if subtype == wikitty, use the list of wikitty found by criteria as option for select]]></description>
<name>criteria</name>
<rtexprvalue>true</rtexprvalue>
@@ -104,10 +114,15 @@
<tag>
- <name>fixedSelect</name>
- <tagclass>org.nuiton.wikitty.struts.tag.FixedSelectTag</tagclass>
+ <name>selectFixed</name>
+ <tagclass>org.nuiton.wikitty.struts.tag.SelectFixedTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[if subtype == fixed, use the list of fixed value as option for a select]]></description>
<name>fixvalues</name>
<rtexprvalue>true</rtexprvalue>
@@ -132,6 +147,11 @@
<tagclass>org.nuiton.wikitty.struts.tag.HiddenTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -145,6 +165,11 @@
<tagclass>org.nuiton.wikitty.struts.tag.TextFieldTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -163,6 +188,11 @@
<tagclass>org.nuiton.wikitty.struts.tag.DateTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -187,6 +217,11 @@
<tagclass>org.nuiton.wikitty.struts.tag.TextAreaTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
@@ -205,6 +240,11 @@
<tagclass>org.nuiton.wikitty.struts.tag.BooleanTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
+ <description><![CDATA[id for the field]]></description>
+ <name>id</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description><![CDATA[the name of the field that have to be specialize]]></description>
<name>fqFieldName</name>
<rtexprvalue>true</rtexprvalue>
1
0
r1036 - in trunk/wikitty-struts/src/main: java/org/nuiton/wikitty/struts/component java/org/nuiton/wikitty/struts/tag java/template/xhtml tld
by mfortun@users.nuiton.org 01 Jul '11
by mfortun@users.nuiton.org 01 Jul '11
01 Jul '11
Author: mfortun
Date: 2011-07-01 17:45:35 +0200 (Fri, 01 Jul 2011)
New Revision: 1036
Url: http://nuiton.org/repositories/revision/wikitty/1036
Log:
* base class + template for date tag
Added:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/DateTag.java
trunk/wikitty-struts/src/main/java/template/xhtml/ws-date-close.ftl
trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl
Modified:
trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
Added: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java 2011-07-01 15:45:35 UTC (rev 1036)
@@ -0,0 +1,76 @@
+package org.nuiton.wikitty.struts.component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.WikittyUtil;
+
+import com.opensymphony.xwork2.util.ValueStack;
+
+public class DateBean extends AbstractWikittyComponent {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ final static private Log log = LogFactory.getLog(DateBean.class);
+
+ public static final String OPEN_TEMPLATE = "ws-date";
+ public static final String TEMPLATE = "ws-date-close";
+
+
+ protected Boolean enableHour = false;
+
+ public DateBean(ValueStack stack, HttpServletRequest request,
+ HttpServletResponse response) {
+ super(stack, request, response);
+
+ }
+
+ @Override
+ protected void evaluateExtraParams() {
+ super.evaluateExtraParams();
+
+
+
+ // if field defined as inclued
+ if (handler.isIncluded(fqFieldName)) {
+ // parse extname and field name
+ String[] fieldsAccess = StringUtil.split(fqFieldName, WikittyUtil.FQ_FIELD_NAME_SEPARATOR);
+ // add parametters to be use by the template
+ addParameter("included", true);
+
+ Object val = handler.getWikitty().getFieldAsDate(fieldsAccess[0],
+ fieldsAccess[1]);
+ val = val==null?"":val;
+
+
+ addParameter("value",val);
+ if ( enableHour !=null) {
+ addParameter("enableHour", enableHour);
+ }
+
+ handler.addAddedField(fqFieldName);
+ }
+
+
+
+
+ }
+
+ public String getDefaultOpenTemplate() {
+ return OPEN_TEMPLATE;
+ }
+
+ protected String getDefaultTemplate() {
+ return TEMPLATE;
+ }
+
+ public Boolean getEnableHour() {
+ return enableHour;
+ }
+
+ public void setEnableHour(Boolean enableHour) {
+ this.enableHour = enableHour;
+ }
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/DateBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/DateTag.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/DateTag.java (rev 0)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/DateTag.java 2011-07-01 15:45:35 UTC (rev 1036)
@@ -0,0 +1,48 @@
+package org.nuiton.wikitty.struts.tag;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.struts2.components.Component;
+import org.nuiton.wikitty.struts.component.DateBean;
+import com.opensymphony.xwork2.util.ValueStack;
+
+public class DateTag extends AbstractWikittyTag{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8514230617417184770L;
+
+
+ protected Boolean enableHour;
+
+ @Override
+ public Component getBean(ValueStack stack, HttpServletRequest req,
+ HttpServletResponse res) {
+ return new DateBean(stack, req, res);
+
+ }
+
+
+ @Override
+ protected void populateParams() {
+ super.populateParams();
+ DateBean datebean = (DateBean) component;
+ datebean.setEnableHour(enableHour);
+
+ }
+
+
+ public Boolean getEnableHour() {
+ return enableHour;
+ }
+
+ public void setEnableHour(Boolean enableHour) {
+ this.enableHour = enableHour;
+ }
+
+
+
+
+
+}
Property changes on: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/tag/DateTag.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl
===================================================================
--- trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl (rev 0)
+++ trunk/wikitty-struts/src/main/java/template/xhtml/ws-date.ftl 2011-07-01 15:45:35 UTC (rev 1036)
@@ -0,0 +1,5 @@
+<#if parameters.included?? && parameters.included==true >
+${parameters.label} : <input id="datepicker" name="${parameters.fqFieldName}" type="text" value="${parameters.value}"> </p>
+</#if><#t/>
+
+
Modified: trunk/wikitty-struts/src/main/tld/wikitty-struts.tld
===================================================================
--- trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-01 15:13:56 UTC (rev 1035)
+++ trunk/wikitty-struts/src/main/tld/wikitty-struts.tld 2011-07-01 15:45:35 UTC (rev 1036)
@@ -157,6 +157,30 @@
<required>true</required>
</attribute>
</tag>
+
+ <tag>
+ <name>date</name>
+ <tagclass>org.nuiton.wikitty.struts.tag.DateTag</tagclass>
+ <bodycontent>empty</bodycontent>
+ <attribute>
+ <description><![CDATA[the name of the field that have to be specialize]]></description>
+ <name>fqFieldName</name>
+ <rtexprvalue>true</rtexprvalue>
+ <required>true</required>
+ </attribute>
+ <attribute>
+ <description><![CDATA[the label of the field]]></description>
+ <name>label</name>
+ <rtexprvalue>true</rtexprvalue>
+ <required>true</required>
+ </attribute>
+ <attribute>
+ <description><![CDATA[the label of the field]]></description>
+ <name>enableHour</name>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
<tag>
<name>textArea</name>
1
0
r1035 - in trunk: . wikitty-api/src/license wikitty-jdbc wikitty-jdbc/src/test/java/org/nuiton/wikitty/services wikitty-solr wikitty-solr/src/license
by echatellier@users.nuiton.org 01 Jul '11
by echatellier@users.nuiton.org 01 Jul '11
01 Jul '11
Author: echatellier
Date: 2011-07-01 17:13:56 +0200 (Fri, 01 Jul 2011)
New Revision: 1035
Url: http://nuiton.org/repositories/revision/wikitty/1035
Log:
Fix dependencies.
jbossjta contains a lot a useless dependencies
Modified:
trunk/pom.xml
trunk/wikitty-api/src/license/THIRD-PARTY.properties
trunk/wikitty-jdbc/pom.xml
trunk/wikitty-jdbc/src/test/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java
trunk/wikitty-solr/pom.xml
trunk/wikitty-solr/src/license/THIRD-PARTY.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/pom.xml 2011-07-01 15:13:56 UTC (rev 1035)
@@ -120,7 +120,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
- <scope>compile</scope>
+ <scope>runtime</scope>
</dependency>
<dependency>
@@ -214,6 +214,88 @@
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
+ <exclusion>
+ <artifactId>jboss-server-manager</artifactId>
+ <groupId>org.jboss.jbossas</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-httpclient</artifactId>
+ <groupId>commons-httpclient</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>emma</artifactId>
+ <groupId>emma</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>emma_ant</artifactId>
+ <groupId>emma</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jbossws-common</artifactId>
+ <groupId>org.jboss.ws</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jacorb</artifactId>
+ <groupId>jacorb</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+ <groupId>org.jboss.spec.javax.ejb</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>idl</artifactId>
+ <groupId>jacorb</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-corba-ots-spi</artifactId>
+ <groupId>org.jboss.integration</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-remoting</artifactId>
+ <groupId>org.jboss.remoting</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ironjacamar-spec-api</artifactId>
+ <groupId>org.jboss.ironjacamar</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>netty</artifactId>
+ <groupId>org.jboss.netty</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>hornetq-core</artifactId>
+ <groupId>org.hornetq</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>wrapper</artifactId>
+ <groupId>tanukisoft</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-logging-generator</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-logging-processor</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>
+ jboss-transaction-api_1.1_spec
+ </artifactId>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ </exclusion>
</exclusions>
</dependency>
Modified: trunk/wikitty-api/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/wikitty-api/src/license/THIRD-PARTY.properties 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/wikitty-api/src/license/THIRD-PARTY.properties 2011-07-01 15:13:56 UTC (rev 1035)
@@ -1,4 +1,4 @@
-# Generated by org.nuiton.license.plugin.AddThirdPartyMojo
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - Apache 2
@@ -8,18 +8,23 @@
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
-# - LGPL 2.1
# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
# - Public Domain
# - Public domain
# - TECHNOLOGY LICENSE FROM SUN MICROSYSTEMS, INC.
# - The Apache Software License, Version 2.0
+# - lgpl
+# - license.txt
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Jan 27 11:01:32 CET 2011
+#Fri Jul 01 16:43:22 CEST 2011
commons-primitives--commons-primitives--1.0--jar=The Apache Software License, Version 2.0
concurrent--concurrent--1.0--jar=TECHNOLOGY LICENSE FROM SUN MICROSYSTEMS, INC.
+dom4j--dom4j--1.6.1--jar=BSD License
javax.transaction--jta--1.1--jar=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
xpp3--xpp3_min--1.1.3.4.O--jar=Indiana University Extreme\! Lab Software License, vesion 1.1.1
Modified: trunk/wikitty-jdbc/pom.xml
===================================================================
--- trunk/wikitty-jdbc/pom.xml 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/wikitty-jdbc/pom.xml 2011-07-01 15:13:56 UTC (rev 1035)
@@ -28,6 +28,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wikitty-api</artifactId>
<version>${project.version}</version>
Modified: trunk/wikitty-jdbc/src/test/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java
===================================================================
--- trunk/wikitty-jdbc/src/test/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/wikitty-jdbc/src/test/java/org/nuiton/wikitty/services/WikittyServiceInMemoryJdbcSolr.java 2011-07-01 15:13:56 UTC (rev 1035)
@@ -24,7 +24,6 @@
*/
package org.nuiton.wikitty.services;
-
import java.io.File;
import java.util.UUID;
import org.apache.commons.logging.Log;
Modified: trunk/wikitty-solr/pom.xml
===================================================================
--- trunk/wikitty-solr/pom.xml 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/wikitty-solr/pom.xml 2011-07-01 15:13:56 UTC (rev 1035)
@@ -72,11 +72,6 @@
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
-
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
Modified: trunk/wikitty-solr/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/wikitty-solr/src/license/THIRD-PARTY.properties 2011-07-01 15:06:15 UTC (rev 1034)
+++ trunk/wikitty-solr/src/license/THIRD-PARTY.properties 2011-07-01 15:13:56 UTC (rev 1035)
@@ -3,28 +3,33 @@
# Already used licenses in project :
# - Apache 2
# - Apache License
+# - Apache Software License, Version 1.1
# - Apache Software License, version 1.1
# - BSD License
+# - BSD style
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Development and Distribution License (CDDL) v1.0
# - Common Public License Version 1.0
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
-# - LGPL 2.1
# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
# - MIT License
# - Public Domain
# - Public domain
# - TECHNOLOGY LICENSE FROM SUN MICROSYSTEMS, INC.
# - The Apache Software License, Version 2.0
+# - lgpl
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Tue Apr 26 16:24:04 CEST 2011
+#Fri Jul 01 16:52:09 CEST 2011
antlr--antlr--2.7.2--jar=BSD License
commons-primitives--commons-primitives--1.0--jar=The Apache Software License, Version 2.0
concurrent--concurrent--1.0--jar=TECHNOLOGY LICENSE FROM SUN MICROSYSTEMS, INC.
dom4j--dom4j--1.1--jar=BSD License
+dom4j--dom4j--1.6.1--jar=BSD License
jakarta-regexp--jakarta-regexp--1.4--jar=The Apache Software License, Version 2.0
javax.servlet--servlet-api--2.5--jar=Common Development and Distribution License (CDDL) v1.0
javax.transaction--jta--1.1--jar=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
1
0
Author: echatellier
Date: 2011-07-01 17:06:15 +0200 (Fri, 01 Jul 2011)
New Revision: 1034
Url: http://nuiton.org/repositories/revision/wikitty/1034
Log:
Too verbose
Modified:
trunk/wikitty-jdbc/src/test/resources/log4j.properties
Modified: trunk/wikitty-jdbc/src/test/resources/log4j.properties
===================================================================
--- trunk/wikitty-jdbc/src/test/resources/log4j.properties 2011-07-01 14:36:16 UTC (rev 1033)
+++ trunk/wikitty-jdbc/src/test/resources/log4j.properties 2011-07-01 15:06:15 UTC (rev 1034)
@@ -5,7 +5,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2010 CodeLutin, Benjamin Poussin
+# Copyright (C) 2011 CodeLutin, Benjamin Poussin, Chatellier Eric
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
@@ -28,6 +28,5 @@
log4j.appender.logConsole.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
# Configuration by components
-log4j.rootLogger=DEBUG, logConsole
-log4j.category.org.nuiton.wikitty=DEBUG
-log4j.category.org.enhydra=DEBUG
+log4j.rootLogger = ERROR, logConsole
+log4j.category.org.nuiton.wikitty=INFO
1
0
r1033 - trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts
by sletellier@users.nuiton.org 01 Jul '11
by sletellier@users.nuiton.org 01 Jul '11
01 Jul '11
Author: sletellier
Date: 2011-07-01 16:36:16 +0200 (Fri, 01 Jul 2011)
New Revision: 1033
Url: http://nuiton.org/repositories/revision/wikitty/1033
Log:
- Fix and reformat code
Modified:
trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/AbstractWikittyEditAction.java
Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/AbstractWikittyEditAction.java
===================================================================
--- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/AbstractWikittyEditAction.java 2011-07-01 14:32:57 UTC (rev 1032)
+++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/AbstractWikittyEditAction.java 2011-07-01 14:36:16 UTC (rev 1033)
@@ -1,15 +1,18 @@
package org.nuiton.wikitty.struts;
+import static org.apache.commons.lang.StringUtils.EMPTY;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.StringUtil;
import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.entities.FieldType;
import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.entities.FieldType.TYPE;
@@ -19,110 +22,86 @@
public abstract class AbstractWikittyEditAction extends ActionSupport {
- /**
- *
- */
private static final long serialVersionUID = 1959245739866183821L;
/** to use log facility, just put in your code: log.info(\"...\"); */
final static private Log log = LogFactory.getLog(AbstractWikittyEditAction.class);
-
- protected String id;
- protected String redirect;
- protected String delete;
- protected String store;
-
- protected Map<String, Object> wikittyFieldMap = new HashMap<String, Object>();
-
- /*
- rajouter les attributs par défaut id tout ça
- et ensuite on rajoute les méthodes de parsage des arguments
- et qui les rajoute dans les wikitty field tout ça.
- sauf les file parce que les files compliqué.
-
- */
+ public static final String PREFIX_WIKITTY = "Wikitty";
+
+ /**
+ * rajouter les attributs par défaut id tout ça
+ * et ensuite on rajoute les méthodes de parsage des arguments
+ * et qui les rajoute dans les wikitty field tout ça.
+ * sauf les file parce que les files compliqué.
+ */
@Override
public String execute() throws Exception {
// restore basic element to know what to do
- id = getArgument("id", "");
- redirect = getArgument("redirect", "");
+ String id = getArgument("id", EMPTY);
+ String redirect = getArgument("redirect", EMPTY);
- delete = getArgument("delete", "");
- store = getArgument("store", "");
-
-
+ String delete = getArgument("delete", EMPTY);
+ String store = getArgument("store", EMPTY);
+
WikittyProxy proxy = getProxy();
- if (delete != "" ){
+ if (!StringUtils.isEmpty(delete)) {
proxy.delete(id);
- } else if (store != ""){
+ } else if (!StringUtils.isEmpty(store)) {
Map<String, Object> param = ActionContext.getContext().getParameters();
- this.formatArgs(param);
-
+ Map<String, Object> wikittyFieldMap = formatArgs(param);
+
Wikitty wikitty = proxy.restore(id);
- if (wikitty != null){
-
- for (Entry<String, Object> entry : wikittyFieldMap.entrySet()){
- //wikitty.setFqField(entry.getKey(), entry.getValue());
-
- FieldType ftype = wikitty.getFieldType(entry.getKey());
-
- Object value = entry.getValue();
-
- // Patch to handle string collection
- if (ftype.isCollection()
- && ftype.getType() == TYPE.STRING
- && value != null) {
+ if (wikitty != null) {
- String valueString = value.toString();
+ for (Entry<String, Object> entry : wikittyFieldMap.entrySet()){
+ //wikitty.setFqField(entry.getKey(), entry.getValue());
- valueString = new String(valueString.substring(
- 1, valueString.length() - 1));
+ FieldType ftype = wikitty.getFieldType(entry.getKey());
- Collection<String> list = new ArrayList<String>();
+ Object value = entry.getValue();
- String[] valuesString = StringUtil.split(
- valueString, ",");
+ // Patch to handle string collection
+ if (ftype.isCollection()
+ && ftype.getType() == TYPE.STRING
+ && value != null) {
- for (String element : valuesString) {
- list.add(element.trim());
- }
+ String valueString = value.toString();
- value = list;
+ valueString = new String(valueString.substring(
+ 1, valueString.length() - 1));
+
+ Collection<String> list = new ArrayList<String>();
+
+ String[] valuesString = StringUtil.split(
+ valueString, ",");
+
+ for (String element : valuesString) {
+ list.add(element.trim());
+ }
+
+ value = list;
+ }
+ wikitty.setFqField(entry.getKey(), value);
}
-
-
- wikitty.setFqField(entry.getKey(), value);
-
-
-
}
-
- }
-
-
proxy.store(wikitty);
}
-
-
-
return SUCCESS;
}
-
public abstract WikittyProxy getProxy();
-
protected Map<String, Object> formatArgs(Map<String, Object> args) {
- wikittyFieldMap = new HashMap<String, Object>();
+ Map<String, Object> wikittyFieldMap = new HashMap<String, Object>();
for (Entry<String, Object> en : args.entrySet()) {
- if (en.getKey().startsWith("Wikitty")) {
+ if (en.getKey().startsWith(PREFIX_WIKITTY)) {
- String value = "";
+ String value = EMPTY;
if (en.getValue() instanceof String[]) {
for (String occu : (String[]) en.getValue()) {
@@ -141,7 +120,7 @@
public String getArgument(String key, String defaultValue) {
Object temp = ActionContext.getContext().getParameters().get(key);
// same method used inside wikitty publication base action
- String result = "";
+ String result = EMPTY;
// TODO mfortun-2011-06-29 fix this with something clean
if (temp == null) {
result = defaultValue;
@@ -151,13 +130,9 @@
result += t;
}
} else {
- result = temp.toString();
-
+ result = temp.toString();
}
-
}
return result;
}
-
-
}
1
0
r1032 - in trunk: . wikitty-api wikitty-jdbc wikitty-lucene wikitty-solr
by echatellier@users.nuiton.org 01 Jul '11
by echatellier@users.nuiton.org 01 Jul '11
01 Jul '11
Author: echatellier
Date: 2011-07-01 16:32:57 +0200 (Fri, 01 Jul 2011)
New Revision: 1032
Url: http://nuiton.org/repositories/revision/wikitty/1032
Log:
Fix test logging
Modified:
trunk/pom.xml
trunk/wikitty-api/pom.xml
trunk/wikitty-jdbc/pom.xml
trunk/wikitty-lucene/pom.xml
trunk/wikitty-solr/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
+++ trunk/pom.xml 2011-07-01 14:32:57 UTC (rev 1032)
@@ -210,6 +210,10 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
</exclusion>
+ <exclusion>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
Modified: trunk/wikitty-api/pom.xml
===================================================================
--- trunk/wikitty-api/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
+++ trunk/wikitty-api/pom.xml 2011-07-01 14:32:57 UTC (rev 1032)
@@ -82,11 +82,22 @@
<groupId>org.jboss.jbossts</groupId>
<artifactId>jbossjta</artifactId>
</dependency>
+
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+
<!-- for event serialization -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
Modified: trunk/wikitty-jdbc/pom.xml
===================================================================
--- trunk/wikitty-jdbc/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
+++ trunk/wikitty-jdbc/pom.xml 2011-07-01 14:32:57 UTC (rev 1032)
@@ -89,6 +89,16 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
</dependencies>
Modified: trunk/wikitty-lucene/pom.xml
===================================================================
--- trunk/wikitty-lucene/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
+++ trunk/wikitty-lucene/pom.xml 2011-07-01 14:32:57 UTC (rev 1032)
@@ -38,6 +38,16 @@
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
Modified: trunk/wikitty-solr/pom.xml
===================================================================
--- trunk/wikitty-solr/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
+++ trunk/wikitty-solr/pom.xml 2011-07-01 14:32:57 UTC (rev 1032)
@@ -86,15 +86,26 @@
<artifactId>commons-lang</artifactId>
</dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+
<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
</dependencies>
1
0
Author: echatellier
Date: 2011-07-01 16:09:02 +0200 (Fri, 01 Jul 2011)
New Revision: 1031
Url: http://nuiton.org/repositories/revision/wikitty/1031
Log:
Exclude spring and other strange deps
Modified:
trunk/wikitty-lucene/pom.xml
Modified: trunk/wikitty-lucene/pom.xml
===================================================================
--- trunk/wikitty-lucene/pom.xml 2011-07-01 14:06:12 UTC (rev 1030)
+++ trunk/wikitty-lucene/pom.xml 2011-07-01 14:09:02 UTC (rev 1031)
@@ -56,6 +56,20 @@
<groupId>com.browseengine.bobo</groupId>
<artifactId>bobo-browse</artifactId>
<version>2.5.0</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>protobuf-java</artifactId>
+ <groupId>com.google.protobuf</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-context</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-cli</artifactId>
+ <groupId>commons-cli</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
1
0