Author: michiel
Date: 2009-09-17 14:43:59 +0200 (Thu, 17 Sep 2009)
New Revision: 38667
Removed:
didactor/trunk/components/core/src/main/java/nl/didactor/taglib/ShuffledListTag.java
Modified:
didactor/trunk/components/core/src/main/resources/META-INF/taglib.tld
Log:
Dropped 'shuffledlist' tag. This funcationlity is availabl ein every mmbase
list tag allready
Deleted:
didactor/trunk/components/core/src/main/java/nl/didactor/taglib/ShuffledListTag.java
===================================================================
---
didactor/trunk/components/core/src/main/java/nl/didactor/taglib/ShuffledListTag.java
2009-09-17 11:35:20 UTC (rev 38666)
+++
didactor/trunk/components/core/src/main/java/nl/didactor/taglib/ShuffledListTag.java
2009-09-17 12:43:59 UTC (rev 38667)
@@ -1,39 +0,0 @@
-package nl.didactor.taglib;
-
-import java.io.IOException;
-import java.util.*;
-import java.text.*;
-import javax.servlet.jsp.tagext.Tag;
-import javax.servlet.jsp.tagext.BodyTag;
-import javax.servlet.jsp.tagext.BodyTagSupport;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspTagException;
-import org.mmbase.bridge.*;
-import org.mmbase.bridge.implementation.BasicNodeList;
-import org.mmbase.bridge.jsp.taglib.*;
-
-/**
- * This tag will return a shuffled list: useful for shuffling
- * possible answers to a question.
- * @author Johannes Verelst <[email protected]>
- */
-public class ShuffledListTag extends AbstractNodeListTag {
- private static Random random = new Random();
-
- public int doStartTag() throws JspException {
- return doStartTagHelper();
- }
-
- protected int setReturnValues(NodeList nodes, boolean trim) throws
JspTagException {
- BasicNodeList bnodes = (BasicNodeList)nodes;
- for (int i=0; i<bnodes.size(); i++) {
- int randomindex = random.nextInt(bnodes.size());
- Node o1 = bnodes.getNode(i);
- Node o2 = bnodes.getNode(randomindex);
- bnodes.set(i, o2);
- bnodes.set(randomindex, o1);
- }
-
- return super.setReturnValues(bnodes, trim);
- }
-}
Modified: didactor/trunk/components/core/src/main/resources/META-INF/taglib.tld
===================================================================
--- didactor/trunk/components/core/src/main/resources/META-INF/taglib.tld
2009-09-17 11:35:20 UTC (rev 38666)
+++ didactor/trunk/components/core/src/main/resources/META-INF/taglib.tld
2009-09-17 12:43:59 UTC (rev 38667)
@@ -7,16 +7,6 @@
<uri>http://www.didactor.nl/ditaglib_1.0</uri>
<tag>
- <name>shuffledlist</name>
- <tag-class>nl.didactor.taglib.ShuffledListTag</tag-class>
- <attribute>
- <name>referid</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
<name>translate</name>
<tag-class>nl.didactor.taglib.TranslateTag</tag-class>
<!-- bodycontent>JSP</bodycontent -->
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs