You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jbo...@li...> - 2006-05-03 22:14:39
|
Author: adamw Date: 2006-05-03 18:14:34 -0400 (Wed, 03 May 2006) New Revision: 4074 Added: labs/shotoku/trunk/shotoku-svn/hooks/post-commit labs/shotoku/trunk/shotoku-svn/hooks/shotoku-update.sh Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-31 Added: labs/shotoku/trunk/shotoku-svn/hooks/post-commit =================================================================== --- labs/shotoku/trunk/shotoku-svn/hooks/post-commit 2006-05-03 22:12:00 UTC (rev 4073) +++ labs/shotoku/trunk/shotoku-svn/hooks/post-commit 2006-05-03 22:14:34 UTC (rev 4074) @@ -0,0 +1,11 @@ +#!/bin/sh + +# POST-COMMIT HOOK + +REPOS="$1" +REV="$2" + +HOOK_PATH=/usr/svn/repo1/hooks +export PATH=/usr/local/bin:/usr/bin + +$HOOK_PATH/shotoku-update.sh $REPOS $REV Property changes on: labs/shotoku/trunk/shotoku-svn/hooks/post-commit ___________________________________________________________________ Name: svn:executable + * Added: labs/shotoku/trunk/shotoku-svn/hooks/shotoku-update.sh =================================================================== --- labs/shotoku/trunk/shotoku-svn/hooks/shotoku-update.sh 2006-05-03 22:12:00 UTC (rev 4073) +++ labs/shotoku/trunk/shotoku-svn/hooks/shotoku-update.sh 2006-05-03 22:14:34 UTC (rev 4074) @@ -0,0 +1,21 @@ +#!/bin/bash + +# TRIGGERS A SHOTOKU WC UPDATE ON A GIVEN REMOTE MACHINE + +# CONFIGURATION +USERNAME="ShotokuUpdate" +PASSWORD="ShotokuUpdate" +REMOTE="http://192.168.1.102:8080/shotoku-admin/update" +# ------------- + +REPOS="$1" +REV="$2" +OPTS="--revision $2" + +SVNLOOK=svnlook + +POST_DATA="data=default#$REV#"`$SVNLOOK dirs-changed $OPTS $REPOS | tr [:space:] :` + +wget -O - --http-user=$USERNAME --http-password=$PASSWORD --post-data="$POST_DATA" $REMOTE >/dev/null + +exit 0 Property changes on: labs/shotoku/trunk/shotoku-svn/hooks/shotoku-update.sh ___________________________________________________________________ Name: svn:executable + * |
From: <jbo...@li...> - 2006-05-03 22:12:05
|
Author: adamw Date: 2006-05-03 18:12:00 -0400 (Wed, 03 May 2006) New Revision: 4073 Added: labs/shotoku/trunk/shotoku-svn/hooks/ Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-31 |
From: <jbo...@li...> - 2006-05-03 22:11:33
|
Author: adamw Date: 2006-05-03 18:11:15 -0400 (Wed, 03 May 2006) New Revision: 4072 Added: labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/UpdateServlet.java Modified: labs/shotoku/trunk/project.properties labs/shotoku/trunk/shotoku-admin/project.xml labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml labs/shotoku/trunk/shotoku-admin/src/web/roles.properties labs/shotoku/trunk/shotoku-admin/src/web/users.properties labs/shotoku/trunk/shotoku-portal/lib/portal-cms-lib.jar labs/shotoku/trunk/shotoku-portal/lib/portal-common-lib.jar labs/shotoku/trunk/shotoku-portal/lib/portal-core-lib.jar labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-31 Modified: labs/shotoku/trunk/project.properties =================================================================== --- labs/shotoku/trunk/project.properties 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/project.properties 2006-05-03 22:11:15 UTC (rev 4072) @@ -27,4 +27,5 @@ maven.jar.jstl=${shotoku.root.dir}lib/taglibs/jars/jstl.jar maven.jar.shotoku-base=${shotoku.root.dir}shotoku-base/target/shotoku-base.jar +maven.jar.shotoku-svn=${shotoku.root.dir}shotoku-svn/target/shotoku-svn.jar maven.jar.shotoku-aop=${shotoku.root.dir}shotoku-aop/target/shotoku-aop.jar Modified: labs/shotoku/trunk/shotoku-admin/project.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/project.xml 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/project.xml 2006-05-03 22:11:15 UTC (rev 4072) @@ -11,6 +11,12 @@ <artifactId>shotoku-base</artifactId> <jar>shotoku-base.jar</jar> </dependency> + + <dependency> + <groupId>shotoku</groupId> + <artifactId>shotoku-svn</artifactId> + <jar>shotoku-svn.jar</jar> + </dependency> <dependency> <groupId>jboss</groupId> Modified: labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml =================================================================== --- labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml 2006-05-03 22:11:15 UTC (rev 4072) @@ -12,6 +12,7 @@ <orderEntry type="module" module-name="shotoku-base" /> <orderEntry type="library" name="jsf" level="application" /> <orderEntry type="library" name="jboss" level="application" /> + <orderEntry type="module" module-name="shotoku-svn" /> <orderEntryProperties /> </component> </module> Added: labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/UpdateServlet.java =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/UpdateServlet.java 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/UpdateServlet.java 2006-05-03 22:11:15 UTC (rev 4072) @@ -0,0 +1,55 @@ +package org.jboss.shotoku.web.admin; + +import org.jboss.shotoku.svn.SvnTools; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; +import java.io.IOException; +import java.util.Set; +import java.util.HashSet; + +/** + * @author Adam Warski (ad...@as...) + */ +public class UpdateServlet extends HttpServlet { + protected void service(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException { + String data = request.getParameter("data"); + if (data == null) { + return; + } + + try { + String[] tokens = data.split("#"); + String id = tokens[0]; + long revision = Integer.valueOf(tokens[1]); + + tokens = tokens[2].split(":"); + + Set<String> toUpdate = new HashSet<String>(); + + String current = tokens[0]; + toUpdate.add(current); + + for (String token : tokens) { + if (!"".equals(token) && !token.startsWith(current)) { + current = token; + toUpdate.add(token); + } + } + + for (String a : toUpdate) { + System.out.println(a); + } + + System.out.println("Rev: " + revision + ", id: " + id); + + SvnTools.getService().addPathsToUpdate(id, revision, toUpdate); + } catch (Exception e) { + // In case of an exception, doing nothing. + } + } +} Modified: labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-03 22:11:15 UTC (rev 4072) @@ -34,19 +34,42 @@ <url-pattern>/admin/*</url-pattern> </servlet-mapping> + <servlet> + <servlet-name>Update Servlet</servlet-name> + <servlet-class>org.jboss.shotoku.web.admin.UpdateServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>Update Servlet</servlet-name> + <url-pattern>/update/*</url-pattern> + </servlet-mapping> + <security-constraint> <web-resource-collection> <web-resource-name>All resources</web-resource-name> - <url-pattern>/*</url-pattern> + <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>ShotokuAdmin</role-name> </auth-constraint> </security-constraint> + <security-constraint> + <web-resource-collection> + <web-resource-name>All resources</web-resource-name> + <url-pattern>/update/*</url-pattern> + </web-resource-collection> + <auth-constraint> + <role-name>ShotokuUpdate</role-name> + </auth-constraint> + </security-constraint> + <security-role> <role-name>ShotokuAdmin</role-name> </security-role> + <security-role> + <role-name>ShotokuUpdate</role-name> + </security-role> <login-config> <auth-method>BASIC</auth-method> Modified: labs/shotoku/trunk/shotoku-admin/src/web/roles.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/roles.properties 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/src/web/roles.properties 2006-05-03 22:11:15 UTC (rev 4072) @@ -1 +1,2 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file +ShotokuAdmin=ShotokuAdmin +ShotokuUpdate=ShotokuUpdate \ No newline at end of file Modified: labs/shotoku/trunk/shotoku-admin/src/web/users.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/users.properties 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-admin/src/web/users.properties 2006-05-03 22:11:15 UTC (rev 4072) @@ -1 +1,2 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file +ShotokuAdmin=ShotokuAdmin +ShotokuUpdate=ShotokuUpdate \ No newline at end of file Modified: labs/shotoku/trunk/shotoku-portal/lib/portal-cms-lib.jar =================================================================== (Binary files differ) Modified: labs/shotoku/trunk/shotoku-portal/lib/portal-common-lib.jar =================================================================== (Binary files differ) Modified: labs/shotoku/trunk/shotoku-portal/lib/portal-core-lib.jar =================================================================== (Binary files differ) Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java =================================================================== --- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2006-05-03 22:11:15 UTC (rev 4072) @@ -25,6 +25,8 @@ import org.jboss.shotoku.svn.service.delayed.DelayedOperation; import org.jboss.shotoku.service.AdministratedService; +import java.util.Set; + /** * @author Adam Warski (ad...@as...) * @author Damon Sicore (da...@si...) @@ -174,4 +176,12 @@ * @param op Operation to perform. */ public void addDelayedOperation(String id, DelayedOperation op); + + /** + * Adds the given paths to update queue. + * @param id Id of the repository for which to add the paths. + * @param revision Revision in which the paths were changed. + * @param paths Changed paths to update. + */ + public void addPathsToUpdate(String id, long revision, Set<String> paths); } Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java =================================================================== --- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2006-05-03 22:11:15 UTC (rev 4072) @@ -29,6 +29,7 @@ import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.tools.ConcurrentSet; import org.jboss.shotoku.tools.ConcurrentHashSet; +import org.jboss.shotoku.tools.Pair; import org.jboss.shotoku.svn.service.delayed.DelayedOperation; import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.exceptions.ResourceDoesNotExist; @@ -64,6 +65,8 @@ private ConcurrentSet<String> frozenModifiedTrees; private ConcurrentSet<String> frozenDeletedResources; + private Set<Pair<Long, Set<String>>> toUpdate; + /** * <code>lastRevision</code> - last revision to which the wc was updated. * Used to prevent unnecessary updates if the revision hasn't changed. @@ -117,6 +120,8 @@ delayedOperations = new ConcurrentHashSet<DelayedOperation>(); + toUpdate = new ConcurrentHashSet<Pair<Long, Set<String>>>(); + log.info("SVNRepository created."); } @@ -237,6 +242,10 @@ } } + public void addPathsToUpdate(String id, long revision, Set<String> paths) { + toUpdate.add(new Pair<Long, Set<String>>(revision, paths)); + } + private void deleteFromSet(Set<String> resources, String deletedPath) { for (Iterator<String> iter = resources.iterator(); iter.hasNext();) { if (iter.next().startsWith(deletedPath)) { @@ -284,12 +293,8 @@ */ String suffFullPath = Tools.addPaths(fullPath, ""); - if (checkPrefixes(deletedResources, suffFullPath) || - checkPrefixes(frozenDeletedResources, suffFullPath)) { - return true; - } - - return false; + return checkPrefixes(deletedResources, suffFullPath) || + checkPrefixes(frozenDeletedResources, suffFullPath); } public boolean isModified(String fullPath) { @@ -352,12 +357,8 @@ public boolean isTreeModified(String fullPath) { String suffFullPath = Tools.addPaths(fullPath, ""); - if (checkPrefixes(modifiedTrees, suffFullPath) || - checkPrefixes(frozenModifiedTrees, suffFullPath)) { - return true; - } - - return false; + return checkPrefixes(modifiedTrees, suffFullPath) || + checkPrefixes(frozenModifiedTrees, suffFullPath); } public void addDelayedOperation(DelayedOperation op) { Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2006-05-03 21:38:22 UTC (rev 4071) +++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2006-05-03 22:11:15 UTC (rev 4072) @@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentHashMap; import java.util.Calendar; +import java.util.Set; import javax.ejb.Local; @@ -53,7 +54,8 @@ @Local(SvnServiceLocal.class) @Management(SvnService.class) @Depends(Constants.SHOTOKU_SERVICE_NAME) -public class SvnServiceImpl extends AdministratedServiceImpl implements SvnService, SvnServiceLocal { +public class SvnServiceImpl extends AdministratedServiceImpl + implements SvnService, SvnServiceLocal { private static final Logger log = Logger.getLogger(SvnServiceImpl.class); private ConcurrentMap<String, SvnRepository> repositories; @@ -223,4 +225,8 @@ public void addDelayedOperation(String id, DelayedOperation op) { repositories.get(id).addDelayedOperation(op); } + + public void addPathsToUpdate(String id, long revision, Set<String> paths) { + repositories.get(id).addPathsToUpdate(id, revision, paths); + } } |
From: <jbo...@li...> - 2006-05-03 21:38:29
|
Author: mar...@jb... Date: 2006-05-03 17:38:22 -0400 (Wed, 03 May 2006) New Revision: 4071 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/EvalCondition.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/PackageCompilationData.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/MockEvalCondition.java Log: JBRULES-237 Eval throws exception on modify -EvalConditionNode should now be working correctly. -I have completely rewritten the test to be more exhaustive. -MockEvalCondition can now have its isAllowed result modified after construction. Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java 2006-05-03 20:57:35 UTC (rev 4070) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java 2006-05-03 21:38:22 UTC (rev 4071) @@ -158,7 +158,8 @@ PropagationContext context, WorkingMemoryImpl workingMemory) { LinkedList memory = (LinkedList) workingMemory.getNodeMemory( this ); - boolean exists = ((tuple.getNext() != null && tuple.getPrevious() != null) || memory.getFirst() == tuple); + boolean exists = (tuple.getLinkedTuples() != null); + if ( exists ) { // Remove the tuple so it can be readded to the top of the list memory.remove( tuple ); Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/EvalCondition.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/EvalCondition.java 2006-05-03 20:57:35 UTC (rev 4070) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/EvalCondition.java 2006-05-03 21:38:22 UTC (rev 4071) @@ -73,6 +73,25 @@ EvalCondition eval = new EvalCondition( this.expression, this.requiredDeclarations ); return eval; - } - + } + +// public int hashcode() { +// return this.expression.hashCode(); +// } +// +// public boolean equals(Object object) { +// if (object == null ) { +// return false; +// } else if ( object == this ){ +// return true; +// } +// +// if ( ! (object instanceof EvalExpression) ) { +// return false; +// } +// +// EvalCondition other = ( EvalCondition ) object; +// +// return this.expression.equals( other.expression ); +// } }; \ No newline at end of file Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/PackageCompilationData.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/PackageCompilationData.java 2006-05-03 20:57:35 UTC (rev 4070) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/PackageCompilationData.java 2006-05-03 21:38:22 UTC (rev 4071) @@ -21,9 +21,11 @@ import java.io.ByteArrayOutputStream; import java.io.Externalizable; import java.io.IOException; +import java.io.InputStream; import java.io.ObjectInput; import java.io.ObjectOutput; import java.io.ObjectOutputStream; +import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -282,6 +284,8 @@ return clazz; } + + /** * Javadocs recommend that this method not be overloaded. We overload this so that we can prioritise the fastFindClass * over method calls to parent.loadClass(name, false); and c = findBootstrapClass0(name); which the default implementation @@ -316,6 +320,15 @@ } return clazz; } + + public InputStream getResourceAsStream(String name) { + byte[] bytes = read( name ); + if ( bytes != null ) { + return null; + } else { + return super.getResourceAsStream( name ); + } + } } } \ No newline at end of file Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java 2006-05-03 20:57:35 UTC (rev 4070) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java 2006-05-03 21:38:22 UTC (rev 4071) @@ -86,105 +86,221 @@ * * @throws FactException */ - public void testAllowed() throws FactException { - - // Create a test node that always returns true + public void testAssertedAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( true ); + + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); + eval ); MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); - // Create the Tuple + // Create the Tuple FactHandleImpl f0 = new FactHandleImpl( 0 ); - ReteTuple tuple = new ReteTuple( f0 ); + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); - // Tuple should pass and propagate - node.assertTuple( tuple, + // Tuple should pass and propagate + node.assertTuple( tuple0, this.context, this.workingMemory ); + + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); + + // Tuple should pass and propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); // Check memory was populated LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); - assertEquals( 1, + assertEquals( 2, memory.size() ); - assertEquals( tuple, + + // Check list is in the correct order + assertEquals( tuple0, memory.getFirst() ); - - // Now test that the fact is retracted correctly - node.retractTuple( tuple, - context, - workingMemory ); - - // Now test that the fact is retracted correctly - assertEquals( 0, - memory.size() ); + assertEquals( tuple1, + tuple0.getNext() ); + + // make sure assertions were propagated + assertEquals( 2, + sink.getAsserted().size() ); } - - /** - * If a Condition does not allow an incoming Object, then the object MUST - * NOT be propagated. - * - * @throws FactException - */ - public void testNotAllowed() throws FactException { + + public void testAssertedAllowedThenRetract() throws FactException { + MockEvalCondition eval = new MockEvalCondition( true ); + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); + eval ); MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); // Create the Tuple FactHandleImpl f0 = new FactHandleImpl( 0 ); - ReteTuple tuple = new ReteTuple( f0 ); + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); // Tuple should pass and propagate - node.assertTuple( tuple, + node.assertTuple( tuple0, this.context, this.workingMemory ); + + // we create and retract two tuples, checking the linkedtuples is null for JBRULES-246 "NPE on retract()" + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); + + // Tuple should pass and propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); - // make sure no assertions were propagated - assertEquals( 0, - sink.getAsserted().size() ); + // Check memory was populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); - } + assertEquals( 2, + memory.size() ); + assertEquals( tuple0, + memory.getFirst() ); + assertEquals( tuple1, + tuple0.getNext() ); - public void testRetractNotAllowed() throws Exception { + // make sure assertions were propagated + assertEquals( 2, + sink.getAsserted().size() ); + + // Now test that the fact is retracted correctly + node.retractTuple( tuple0, + context, + workingMemory ); + + // Now test that the fact is retracted correctly + assertEquals( 1, + memory.size() ); + + assertEquals( tuple1, + memory.getFirst() ); + + // make sure retractions were propagated + assertEquals( 1, + sink.getRetracted().size() ); + + // Now test that the fact is retracted correctly + node.retractTuple( tuple1, + context, + workingMemory ); + + // Now test that the fact is retracted correctly + assertEquals( 0, + memory.size() ); + + // make sure retractions were propagated + assertEquals( 2, + sink.getRetracted().size() ); + } + + + public void testAssertedAllowedThenModifyAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( true ); + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); + eval ); MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); // Create the Tuple FactHandleImpl f0 = new FactHandleImpl( 0 ); - ReteTuple tuple = new ReteTuple( f0 ); + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); // Tuple should pass and propagate - node.assertTuple( tuple, + node.assertTuple( tuple0, this.context, this.workingMemory ); + + // we create and retract two tuples, checking the linkedtuples is null for JBRULES-246 "NPE on retract()" + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); + + // Tuple should pass and propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); - node.retractTuple( tuple, + // Check memory was populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 2, + memory.size() ); + assertEquals( tuple0, + memory.getFirst() ); + assertEquals( tuple1, + tuple0.getNext() ); + + // make sure assertions were propagated + assertEquals( 2, + sink.getAsserted().size() ); + + + + // Now test that the fact is modified correctly + node.modifyTuple( tuple0, context, workingMemory ); - - // make sure no assertions were propagated - assertEquals( 0, - sink.getRetracted().size() ); - } - - public void testRetractAllowed() throws Exception { + assertEquals( 2, + memory.size() ); + + // notice the order is reversed, as tuple0 was modified last and is more recent + assertEquals( tuple1, + memory.getFirst() ); + + assertEquals( tuple0, + tuple1.getNext() ); + + // make sure modifications were propagated + assertEquals( 1, + sink.getModified().size() ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple1, + context, + workingMemory ); + + // notice the order is reversed, as tuple0 was modified last and is more recent + assertEquals( tuple0, + memory.getFirst() ); + + assertEquals( tuple1, + tuple0.getNext() ); + + // make sure modifications were propagated + assertEquals( 2, + sink.getModified().size() ); + } + + public void testAssertedAllowedThenModifyNotAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( true ); + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); + eval ); MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); @@ -208,123 +324,238 @@ // Tuple should pass and propagate node.assertTuple( tuple1, this.context, - this.workingMemory ); + this.workingMemory ); + + // Check memory was populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 2, + memory.size() ); + assertEquals( tuple0, + memory.getFirst() ); + assertEquals( tuple1, + tuple0.getNext() ); - // to stimulate JBRULES-246 we retract the second tuple1 first. - node.retractTuple( tuple1, - context, - workingMemory ); - - List list = sink.getRetracted(); + // make sure assertions were propagated + assertEquals( 2, + sink.getAsserted().size() ); - // make sure no assertions were propagated - assertEquals( 1, - sink.getRetracted().size() ); - - ReteTuple retractedTuple0 = ( ReteTuple ) ( ( Object[] ) list.get( 0 ) )[0]; - assertNull( retractedTuple0.getLinkedTuples() ); + eval.setIsAllowed( false ); - node.retractTuple( tuple0, + // Now test that the fact is modified correctly + node.modifyTuple( tuple0, context, workingMemory ); - // make sure no assertions were propagated + // tuple1 has now been removed + assertEquals( 1, + memory.size() ); + assertEquals( tuple1, + memory.getFirst() ); + + // make sure modifications were propagated as a retraction, as it is now no longer passing + assertEquals( 1, + sink.getRetracted().size() ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple1, + context, + workingMemory ); + + // tuple0 has now been removed + assertEquals( 0, + memory.size() ); + + // make sure modifications were propagated as a retraction assertEquals( 2, - sink.getRetracted().size() ); + sink.getRetracted().size() ); + } + public void testAssertedNotAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( false ); - ReteTuple retractedTuple1 = ( ReteTuple ) ( ( Object[] ) list.get( 1) )[0]; - assertNull( retractedTuple1.getLinkedTuples() ); + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + eval ); + + MockTupleSink sink = new MockTupleSink(); + node.addTupleSink( sink ); + + // Create the Tuple + FactHandleImpl f0 = new FactHandleImpl( 0 ); + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); + + // Tuple should fail and not propagate + node.assertTuple( tuple0, + this.context, + this.workingMemory ); + + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); - assertNotSame( retractedTuple0, retractedTuple1); + // Tuple should fail and not propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); + + // Check memory was not populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 0, + memory.size() ); + + // test no propagations + assertEquals( 0, + sink.getAsserted().size() ); + assertEquals( 0, + sink.getModified().size() ); + assertEquals( 0, + sink.getRetracted().size() ); } - public void testModifyNotAllowed() throws Exception { + public void testAssertedNotAllowedThenModifyNotAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( false ); + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); - + eval ); + MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); - + // Create the Tuple FactHandleImpl f0 = new FactHandleImpl( 0 ); - ReteTuple tuple = new ReteTuple( f0 ); - - // Tuple should pass and propagate - node.assertTuple( tuple, + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); + + // Tuple should fail and not propagate + node.assertTuple( tuple0, this.context, this.workingMemory ); - - node.modifyTuple( tuple, + + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); + + // Tuple should fail and not propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); + + // Check memory was not populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 0, + memory.size() ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple0, + context, + workingMemory ); + assertEquals( 0, + memory.size() ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple1, context, - workingMemory ); - - // make sure no assertions were propagated + workingMemory ); + + // make sure the memory wasn't populated assertEquals( 0, - sink.getRetracted().size() ); + memory.size() ); + + // test no propagations assertEquals( 0, + sink.getAsserted().size() ); + assertEquals( 0, sink.getModified().size() ); assertEquals( 0, - sink.getAsserted().size() ); - } + sink.getRetracted().size() ); + } - public void testModifyAllowed() throws Exception { + public void testAssertedNotAllowedThenModifyAllowed() throws FactException { + MockEvalCondition eval = new MockEvalCondition( false ); + // Create a test node that always returns false EvalConditionNode node = new EvalConditionNode( 1, new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); - + eval ); + MockTupleSink sink = new MockTupleSink(); node.addTupleSink( sink ); - + // Create the Tuple FactHandleImpl f0 = new FactHandleImpl( 0 ); - ReteTuple tuple = new ReteTuple( f0 ); - - // Tuple should pass and propagate - node.assertTuple( tuple, + f0.setObject( "stilton" ); + ReteTuple tuple0 = new ReteTuple( f0 ); + + // Tuple should fail and not propagate + node.assertTuple( tuple0, this.context, this.workingMemory ); + + // Create the Tuple + FactHandleImpl f1 = new FactHandleImpl( 1 ); + f0.setObject( "cheddar" ); + ReteTuple tuple1 = new ReteTuple( f1 ); + + // Tuple should fail and not propagate + node.assertTuple( tuple1, + this.context, + this.workingMemory ); + + // Check memory was not populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 0, + memory.size() ); + + eval.setIsAllowed( true ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple1, + context, + workingMemory ); + assertEquals( 1, + memory.size() ); + + // As this this wasn't asserted and remember before, will propagate as an assert + assertEquals( 1, + sink.getAsserted().size() ); + + assertSame( tuple1, + memory.getFirst() ); + + // Now test that the fact is modified correctly + node.modifyTuple( tuple0, + context, + workingMemory ); + assertEquals( 2, + memory.size() ); + + // As this this wasn't asserted and remember before, will propagate as an assert + assertEquals( 2, + sink.getAsserted().size() ); + + assertSame( tuple1, + memory.getFirst() ); + + assertSame( tuple0, + tuple1.getNext() ); - node.modifyTuple( tuple, - context, - workingMemory ); - - // make sure no assertions were propagated - assertEquals( 1, + // test no propagations + assertEquals( 0, sink.getModified().size() ); - } + assertEquals( 0, + sink.getRetracted().size() ); + } - // public void testException() throws FactException { - // // Create a eval that will always throw an exception - // MockCondition eval = new MockCondition( true ); - // eval.setTestException( true ); - // - // // Create the TestNode - // EvalConditionNode node = new EvalConditionNode( 1, - // new MockTupleSource( 15 ), - // eval ); - // - // MockTupleSink sink = new MockTupleSink(); - // node.addTupleSink( sink ); - // - // /* Create the Tuple */ - // FactHandleImpl f0 = new FactHandleImpl( 0 ); - // ReteTuple tuple = new ReteTuple( f0 ); - // - // /* When asserting the node should throw an exception */ - // try { - // node.assertTuple( tuple, - // this.context, - // this.workingMemory ); - // fail( "Should have thrown TestException" ); - // } catch ( TestException e ) { - // // should throw exception - // } - // } - public void testUpdateWithMemory() throws FactException { // If no child nodes have children then we need to re-process the left // and right memories Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/MockEvalCondition.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/MockEvalCondition.java 2006-05-03 20:57:35 UTC (rev 4070) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/MockEvalCondition.java 2006-05-03 21:38:22 UTC (rev 4071) @@ -24,23 +24,17 @@ import org.drools.spi.Tuple; public class MockEvalCondition extends EvalCondition { + + private Boolean isAllowed ; - private static EvalExpression trueExpression = new EvalExpression() { + private final EvalExpression expression = new EvalExpression() { public boolean evaluate(Tuple tuple, Declaration[] requiredDeclarations, WorkingMemory workingMemory) { - return true; + return isAllowed .booleanValue(); } }; - private static EvalExpression falseExpression = new EvalExpression() { - public boolean evaluate(Tuple tuple, - Declaration[] requiredDeclarations, - WorkingMemory workingMemory) { - return false; - } - }; - public MockEvalCondition(boolean isAllowed) { this( isAllowed, null ); @@ -48,13 +42,17 @@ public MockEvalCondition(boolean isAllowed, Declaration[] requiredDeclarations) { - this( (isAllowed) ? trueExpression : falseExpression, - requiredDeclarations ); + super( requiredDeclarations ); + setEvalExpression( this.expression ); + setIsAllowed( isAllowed ); } public MockEvalCondition(EvalExpression eval, Declaration[] requiredDeclarations) { - super( eval, - requiredDeclarations ); + super( eval, requiredDeclarations ); } + + public void setIsAllowed(boolean isAllowed ) { + this.isAllowed = new Boolean( isAllowed ); + } } \ No newline at end of file |
From: <jbo...@li...> - 2006-05-03 20:57:40
|
Author: mfrandsen Date: 2006-05-03 16:57:35 -0400 (Wed, 03 May 2006) New Revision: 4070 Modified: labs/jbossrules/trunk/drools-jsr94/pom.xml Log: path for surefire plugin improved Modified: labs/jbossrules/trunk/drools-jsr94/pom.xml =================================================================== --- labs/jbossrules/trunk/drools-jsr94/pom.xml 2006-05-03 20:57:00 UTC (rev 4069) +++ labs/jbossrules/trunk/drools-jsr94/pom.xml 2006-05-03 20:57:35 UTC (rev 4070) @@ -87,7 +87,7 @@ <systemProperties> <property> <name>jsr94.tck.configuration</name> - <value>drools-jsr94/target/test-classes/org/drools/jsr94/tck</value> + <value>${basedir}/target/test-classes/org/drools/jsr94/tck</value> </property> </systemProperties>p <includes> |
From: <jbo...@li...> - 2006-05-03 20:57:05
|
Author: mfrandsen Date: 2006-05-03 16:57:00 -0400 (Wed, 03 May 2006) New Revision: 4069 Modified: labs/jbossrules/trunk/drools-jsr94/src/test/java/org/jcp/jsr94/tck/AllTests.java Log: old commented stuff removed Modified: labs/jbossrules/trunk/drools-jsr94/src/test/java/org/jcp/jsr94/tck/AllTests.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/test/java/org/jcp/jsr94/tck/AllTests.java 2006-05-03 18:16:42 UTC (rev 4068) +++ labs/jbossrules/trunk/drools-jsr94/src/test/java/org/jcp/jsr94/tck/AllTests.java 2006-05-03 20:57:00 UTC (rev 4069) @@ -63,40 +63,4 @@ suite.addTestSuite( RuleTest.class ); return suite; } - // public static Test suite() - // { - // - // - // TestSuite suite = new TestSuite( "JSR 94 Test Compatability Kit" ); - // System.out.println(System.getProperty("jsr94.tck.configuration")); - // suite.addTestSuite(ApiSignatureTest.class); - // suite.addTestSuite(ClassLoaderTest.class); - // suite.addTestSuite(ConfigurationExceptionTest.class); - // suite.addTestSuite(HandleTest.class); - // suite.addTestSuite(InvalidHandleExceptionTest.class); - // suite.addTestSuite(InvalidRuleSessionExceptionTest.class); - // suite.addTestSuite(ObjectFilterTest.class); - // suite.addTestSuite(RuleExceptionTest.class); - // suite.addTestSuite(RuleExecutionExceptionTest.class); - // suite.addTestSuite(RuleExecutionSetMetadataTest.class); - // suite.addTestSuite(RuleExecutionSetNotFoundExceptionTest.class); - // suite.addTestSuite(RuleRuntimeTest.class); - // suite.addTestSuite(RuleServiceProviderManagerTest.class); - // suite.addTestSuite(RuleServiceProviderTest.class); - // suite.addTestSuite(RuleSessionCreateExceptionTest.class); - // suite.addTestSuite(RuleSessionTest.class); - // suite.addTestSuite(RuleSessionTypeUnsupportedExceptionTest.class); - // suite.addTestSuite(StatefulRuleSessionTest.class); - // suite.addTestSuite(StatelessRuleSessionTest.class); - // suite.addTestSuite(LocalRuleExecutionSetProviderTest.class); - // suite.addTestSuite(RuleAdministrationExceptionTest.class); - // suite.addTestSuite(RuleAdministratorTest.class); - // suite.addTestSuite(RuleExecutionSetCreateExceptionTest.class); - //// suite.addTestSuite(RuleExecutionSetProviderTest.class); - // suite.addTestSuite(RuleExecutionSetRegisterExceptionTest.class); - // suite.addTestSuite(RuleExecutionSetTest.class); - // suite.addTestSuite(RuleExecutionSetDeregistrationExceptionTest.class); - // suite.addTestSuite(RuleTest.class); - // return suite; - // } } |
Author: soh...@jb... Date: 2006-05-03 14:16:42 -0400 (Wed, 03 May 2006) New Revision: 4068 Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_edit_preview.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_preview.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_preview.xhtml Removed: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_preview.xhtml Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml Log: http://jira.jboss.com/jira/browse/JBFORUMS-65 - Create a New Topic http://jira.jboss.com/jira/browse/JBFORUMS-66 - Post Reply http://jira.jboss.com/jira/browse/JBFORUMS-67 - Edit Post Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -32,10 +32,14 @@ public static final String START = "start"; public static final String CANCEL = "cancel"; public static final String SUCCESS = "success"; + public static final String START_REPLY = "startReply"; + public static final String START_NEW_TOPIC = "startNewTopic"; + public static final String START_EDIT_POST = "startEditPost"; //---------parameter constants-------------------------------------------------------------------------------------------------- public static final String p_categoryId = "c"; public static final String p_forumId = "f"; public static final String p_topicId = "t"; + public static final String p_postId = "p"; public static final String p_userId = "uid"; public static final String p_option = "o"; public static final String p_poll_title = "POLL_TITLE"; Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -61,6 +61,7 @@ String pollDelete = ForumUtil.getParameter(request,Constants.p_poll_delete); String attachment = ForumUtil.getParameter(request,Constants.p_attachment); String topicId = ForumUtil.getParameter(request,Constants.p_topicId); + String postId = ForumUtil.getParameter(request,Constants.p_postId); String userId = ForumUtil.getParameter(request,Constants.p_userId); if(categoryId!=null && categoryId.trim().length()>0) { @@ -94,5 +95,9 @@ { response.setRenderParameter(Constants.p_userId,userId); } + if(postId!=null && postId.trim().length()>0) + { + response.setRenderParameter(Constants.p_postId,postId); + } } } Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -0,0 +1,326 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.action; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Collection; + +import org.jboss.portlet.forums.ui.BaseController; +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.ForumUtil; +import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; + +import org.jboss.portlet.forums.commands.ValidationException; +import org.jboss.portlet.forums.model.Forum; +import org.jboss.portlet.forums.model.Poll; +import org.jboss.portlet.forums.model.PollOption; +import org.jboss.portlet.forums.model.Poster; +import org.jboss.portlet.forums.model.Message; +import org.jboss.portlet.forums.model.Topic; +import org.jboss.portlet.forums.model.Post; +import org.jboss.portlet.forums.model.Attachment; + +/* + * Created on May 2, 2006 + * + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + */ +public class EditPost extends PostAction +{ + //constructor------------------------------------------------------------------------------------------------------------------ + /** + * + * + */ + public EditPost() + { + super(); + } + + //action processing methods----------------------------------------------------------------------------------------------------- + /** + * + * + */ + public String start() + { + String navState = null; + try + { + int postId = -1; + String p = ForumUtil.getParameter(Constants.p_postId); + if(p!=null && p.trim().length()>0) + { + postId = Integer.parseInt(p); + } + + //grab the post information + if(postId!=-1) + { + //re-initialize this controller to edit the specified post + this.cleanup(); + + //get the post from the module + Post post = BaseController.getForumsModule().findPostById(new Integer(postId)); + Topic topic = post.getTopic(); + + //set the selected post's topic id + this.topicId = topic.getId().intValue(); + this.postId = postId; + + //set the subject of the post + this.subject = post.getMessage().getSubject(); + + //set the message of the post + this.message = post.getMessage().getText(); + + //set the topicType + this.topicType = topic.getType(); + + //setup poll related information + this.setupPoll(topic.getPoll()); + + //setup the attachment related information + this.setupAttachments(post.getAttachments()); + } + + navState = Constants.START_EDIT_POST; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + + /** + * + * + */ + public String execute() + { + String navState = null; + boolean success = false; + try + { + //setup the business objects to be updated + Post post = BaseController.getForumsModule().findPostById(new Integer(this.postId)); + Topic topic = post.getTopic(); + boolean isFirstPost = false; + if(topic.getFirstPost().getId().intValue()==post.getId().intValue()) + { + isFirstPost = true; + } + + //setup the message/subject related data + Message message = PortalUtil.createMessage(); + message.setText(this.message); + message.setSubject(this.subject); + + //update the message/subject/topicType data on the business objects + post.setMessage(message); + if(isFirstPost) + { + topic.setSubject(this.subject); + topic.setType(this.topicType); + } + + //miscellaneous post related update + post.setEditCount(post.getEditCount() + 1); + post.setEditDate(new Date()); + + + //TODO: cleanup this poll update process............move this as a private method + //setup poll information + List localPollOptions = new ArrayList(); + for(Iterator itr=this.options.iterator();itr.hasNext();) + { + String option = (String)itr.next(); + PollOption pollOption = PortalUtil.createPollOption(); + pollOption.setQuestion(option); + pollOption.setVotes(0); + localPollOptions.add(pollOption); + } + + //update poll information + if( topic.getPoll()==null || + topic.getPoll().getTitle() == null || + topic.getPoll().getTitle().trim().length() == 0 + ) + { + //no existing poll information found in the database + if(localPollOptions.size()>0 && this.question!=null && this.question.trim().length()>0) + { + //need to add a new poll to this topic + Poll poll = PortalUtil.createPoll(); + poll.setTitle(this.question); + poll.setLength(this.activeDuration); + poll.setOptions(localPollOptions); + BaseController.getForumsModule().addPollToTopic(topic,poll); + } + } + else + { + //existing poll information is available in the database + if(localPollOptions.size()>0) + { + //this is a diff update.............................. + + //setup the poll to be updated in the database + Poll poll = PortalUtil.createPoll(); + poll.setTitle(this.question); + poll.setLength(this.activeDuration); + poll.setVoted(topic.getPoll().getVoted()); + poll.setCreationDate(topic.getPoll().getCreationDate()); + + Iterator newOptions = localPollOptions.iterator(); + while (newOptions.hasNext()) + { + PollOption newPollOption = (PollOption)newOptions.next(); + Iterator stored = topic.getPoll().getOptions().iterator(); + while(stored.hasNext()) + { + PollOption oldPollOption = (PollOption)stored.next(); + if(oldPollOption!=null && oldPollOption.getQuestion().equals(newPollOption.getQuestion())) + { + newPollOption.setVotes(oldPollOption.getVotes()); + break; + } + } + } + poll.setOptions(localPollOptions); + + BaseController.getForumsModule().addPollToTopic(topic,poll); + } + else + { + //remove the poll from the database...poll was removed during this editPost process + topic.setPoll(null); + } + } + + + //TODO: cleanup this forums update process............move this as a private method + //setup attachment information + Collection attachments = this.produceAttachments(this.attachments); + Collection removeFilter = new ArrayList(); + Collection newAttachments = new ArrayList(); + + //filter out the newly added attachments + for(Iterator itr=attachments.iterator();itr.hasNext();) + { + Attachment cour = (Attachment)itr.next(); + if( + cour.getId()==null + ) + { + newAttachments.add(cour); //adds this new attachment to the database + removeFilter.add(cour); //remove this newly added attachments from the list + //to be compared against the list of stored attachments for update/remove + } + } + attachments.removeAll(removeFilter); + + //update/remove currently stored attachments on this post + Iterator storedAttachments = post.getAttachments().iterator(); + removeFilter = new ArrayList(); + while(storedAttachments.hasNext()) + { + Attachment storedAttachment = (Attachment)storedAttachments.next(); + + //not sure why a record like this is popping out from the hibernate layer + if(storedAttachment.getId()==null) + { + removeFilter.add(storedAttachment); //clean this record up + continue; + } + + //find this storedAttachment in the list of ui attachments. + //ones that are found are to be updated. once not found need to be removed + Iterator uiAttachments = attachments.iterator(); + if(uiAttachments==null || !uiAttachments.hasNext()) + { + //basically all attachments on the ui were deleted + removeFilter.add(storedAttachment); + break; + } + while(uiAttachments.hasNext()) + { + Attachment local = (Attachment)uiAttachments.next(); + if(local.getId().intValue()==storedAttachment.getId().intValue()) + { + //update this attachment + storedAttachment.setComment(local.getComment()); + break; + } + //check if this stored attachment should be removed + if(!uiAttachments.hasNext()) + { + //if i get here, no match was made with the list of ui attachments + //hence this particular stored attachment must be removed + removeFilter.add(storedAttachment); + } + } + } + post.getAttachments().removeAll(removeFilter); + + //add the newly added attachments + for(Iterator itr=newAttachments.iterator();itr.hasNext();) + { + post.addAttachment((Attachment)itr.next()); + } + + + //set the proper navigation state + navState = Constants.SUCCESS; + + success = true; + } + catch(Exception e) + { + if(e instanceof ValidationException) + { + //handle proper validation error with a proper message...not just a generic message.. + //just use generic error page for the proof of concept + //set the custom exception such that e.toString() results in the proper message + JSFUtil.handleException(e); + } + else + { + JSFUtil.handleException(e); + } + } + finally + { + //cleanup if necessary + if(success) + { + this.cleanup(); + } + } + return navState; + } +} Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -22,11 +22,9 @@ package org.jboss.portlet.forums.ui.action; import java.util.Date; -import java.util.Collection; import java.util.List; import java.util.ArrayList; import java.util.Iterator; -import java.text.SimpleDateFormat; import org.jboss.portlet.forums.ui.Constants; import org.jboss.portlet.forums.ui.BaseController; @@ -41,295 +39,16 @@ import org.jboss.portlet.forums.model.Post; import org.jboss.portlet.forums.commands.ValidationException; import org.jboss.portlet.forums.commands.post.PostTools; -import org.jboss.portlet.forums.helper.TempFileBinding; //myfaces -import org.apache.myfaces.custom.fileupload.UploadedFile; /** * @author <a href="mailto:soh...@jb...">Sohil Shah</a> * */ -public class NewTopic extends ActionController -{ - //post related view data - private String subject = null; - private String message = null; - private int topicType = 0; - - //poll related data view data - private String question = null; - private Collection options = new ArrayList(); - private int activeDuration = 0; - private boolean deletePoll = false; - private boolean deletePollActivated = false; - - //attachment related view data - private String attachmentComment = null; - private UploadedFile attachment = null; - private Collection attachments = new ArrayList(); - - - //navigation control related data - private boolean isPreview = false; - private int forumId = -1; - - //business state - - //---------------------------------------------------------------------------------------------------------------------------------------- - /** - * @return Returns the message. - */ - public String getMessage() - { - return message; - } - - /** - * @param message The message to set. - */ - public void setMessage(String message) - { - this.message = message; - } - - /** - * @return Returns the subject. - */ - public String getSubject() - { - return subject; - } - - /** - * @param subject The subject to set. - */ - public void setSubject(String subject) - { - this.subject = subject; - } - - /** - * @return Returns the topicType. - */ - public int getTopicType() - { - return topicType; - } - - /** - * @param topicType The topicType to set. - */ - public void setTopicType(int topicType) - { - this.topicType = topicType; - } - - /** - * - * @return - */ - public String getPostDate() - { - String dateStr = null; - - SimpleDateFormat dateFormat = PortalUtil.getSDF(); - - dateStr = dateFormat.format(new Date()); - - return dateStr; - } - - /** - * - * @return - */ - public String getQuestion() - { - return this.question; - } - - /** - * - * @param question - */ - public void setQuestion(String question) - { - this.question = question; - } - - /** - * @return Returns the activeDuration. - */ - public int getActiveDuration() - { - return activeDuration; - } - /** - * @param activeDuration The activeDuration to set. - */ - public void setActiveDuration(int activeDuration) - { - this.activeDuration = activeDuration; - } - - /** - * @return - */ - public String getOption() - { - return null; - } - - /** - * @param - */ - public void setOption(String option) - { - if(option!=null && option.trim().length()>0) - { - this.options.add(option); - } - } - - public Collection getOptions() - { - return this.options; - } - - /** - * - * @return - */ - public boolean getDeletePoll() - { - return this.deletePoll; - } - - /** - * - * @param deletePoll - */ - public void setDeletePoll(boolean deletePoll) - { - this.deletePoll = deletePoll; - } - - /** - * - * @return - */ - public boolean isDeletePollActivated() - { - return this.deletePollActivated; - } - - - /** - * @return Returns the attachmentComment. - */ - public String getAttachmentComment() - { - return this.attachmentComment; - } - - /** - * @param attachmentComment The attachmentComment to set. - */ - public void setAttachmentComment(String attachmentComment) - { - this.attachmentComment = attachmentComment; - } - - /** - * @return Returns the attachment. - */ - public UploadedFile getAttachment() - { - return attachment; - } - - /** - * @param attachment The attachment to set. - */ - public void setAttachment(UploadedFile attachment) - { - this.attachment = attachment; - } - - /** - * - * @return - */ - public Collection getAttachments() - { - return this.attachments; - } - - /** - * - * @return - */ - public int getNumberOfAttachments() - { - int numberOfAttachments = 0; - - if(this.attachments!=null) - { - numberOfAttachments = this.attachments.size(); - } - - return numberOfAttachments; - } - //-----navigation related data--------------------------------------------------------------------------------------------------------------- - /** - * - */ - public boolean isPreview() - { - return this.isPreview; - } - - /** - * - * - */ - public int getForumId() - { - return this.forumId; - } - - /** - * - * @author sshah - * since this controller is at session scope, must cleanup its state when not needed - * this will help optimize memory usage... - * puts the bean in an uninitialized state in that user's session - * - */ - private void cleanup() - { - //puts this controller in an cleaned up state for the next time it will be used in the session - this.subject = null; - this.message = null; - this.topicType = 0; - this.isPreview = false; - this.forumId = -1; - - //cleanup poll related data - this.question = null; - this.options = new ArrayList(); - this.activeDuration = 0; - this.deletePoll = false; - this.deletePollActivated = false; - - //cleanup attachment related data - this.attachment = null; - this.attachmentComment = null; - this.attachments = new ArrayList(); - } - +public class NewTopic extends PostAction +{ //---------------------------------------------------------------------------------------------------------------------------------------- /** * @@ -339,8 +58,7 @@ public NewTopic() { super(); - } - + } //---------------------------------------------------------------------------------------------------------------------------------------- /** * @@ -380,121 +98,14 @@ } } - navState = Constants.START; + navState = Constants.START_NEW_TOPIC; } catch(Exception e) { JSFUtil.handleException(e); } return navState; - } - //poll related operations-------------------------------------------------------------------------------------------------------------------- - /** - * - * @author sshah - */ - public String deleteOption() - { - String navState = null; - try - { - int optionIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_option)); - - //actually remove the option value - optionIndex--; - ((ArrayList)this.options).remove(optionIndex); - } - catch(Exception e) - { - JSFUtil.handleException(e); - } - return navState; - } - //-----------------attachment related------------------------------------------------------------------------------------------ - /** - * - */ - public String addAttachment() - { - String navState = null; - try - { - if(this.attachment!=null) - { - TempFileBinding file = new TempFileBinding( - this.attachment.getContentType(), - this.attachment.getBytes(), - this.attachment.getName(), - String.valueOf(System.currentTimeMillis()) + "_" + this.attachments.size() //unique fileId for this collection of files - ); - if(this.attachmentComment!=null) - { - file.setComment(this.attachmentComment); - } - this.attachments.add(file); - } - - //clear out the attachment related view data - this.setAttachment(null); - this.setAttachmentComment(null); - } - catch(Exception e) - { - JSFUtil.handleException(e); - } - return navState; - } - - /** - * - * @author sshah - */ - public String deleteAttachment() - { - String navState = null; - try - { - int attachmentIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_attachment)); - - attachmentIndex--; - ((ArrayList)this.attachments).remove(attachmentIndex); - } - catch(Exception e) - { - JSFUtil.handleException(e); - } - return navState; - } - //------------preview------------------------------------------------------------------------------------------------------- - /** - * - * @return - */ - public String preview() - { - String navState = null; - try - { - this.isPreview = true; - } - catch(Exception e) - { - JSFUtil.handleException(e); - } - return navState; - } - - //---------------------------cancel----------------------------------------------------------------------------------------- - /** - * - * @author sshah - * - */ - public String cancel() - { - return Constants.CANCEL; - } - + } //--------execute------------------------------------------------------------------------------------------------------------- /** * @@ -506,6 +117,7 @@ boolean success = false; try { + //setup the message Message message = PortalUtil.createMessage(); message.setText(this.message); message.setSubject(this.subject); @@ -544,7 +156,7 @@ new Date(), poster, poll, //poll - (List)this.attachments, //attachments + (List)this.produceAttachments(this.attachments), //attachments this.topicType ); BaseController.getForumsModule().createWatch(poster,post.getTopic()); @@ -578,5 +190,5 @@ } } return navState; - } + } } Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -0,0 +1,591 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.action; + +import java.util.Date; +import java.util.Collection; +import java.util.ArrayList; +import java.util.List; +import java.util.Iterator; +import java.text.SimpleDateFormat; + +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.ForumUtil; +import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; +import org.jboss.portlet.forums.helper.TempFileBinding; + +import org.jboss.portlet.forums.model.Attachment; +import org.jboss.portlet.forums.impl.AttachmentImpl; +import org.jboss.portlet.forums.model.Poll; +import org.jboss.portlet.forums.model.PollOption; + +//myfaces +import org.apache.myfaces.custom.fileupload.UploadedFile; + + +/** + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + * + */ +public abstract class PostAction extends ActionController +{ + //post related view data + protected String subject = null; + protected String message = null; + protected int topicType = 0; + + //poll related data view data + protected String question = null; + protected Collection options = new ArrayList(); + protected int activeDuration = 0; + protected boolean deletePoll = false; + protected boolean deletePollActivated = false; + + //attachment related view data + protected String attachmentComment = null; + protected UploadedFile attachment = null; + protected Collection attachments = new ArrayList(); + + + //navigation control related data + protected boolean isPreview = false; + protected int forumId = -1; + protected int topicId = -1; + protected int postId = -1; + + //business state + + //ui related data accessors---------------------------------------------------------------------------------------------------------------------------------------- + /** + * @return Returns the message. + */ + public String getMessage() + { + return message; + } + + /** + * @param message The message to set. + */ + public void setMessage(String message) + { + this.message = message; + } + + /** + * @return Returns the subject. + */ + public String getSubject() + { + return subject; + } + + /** + * @param subject The subject to set. + */ + public void setSubject(String subject) + { + this.subject = subject; + } + + /** + * @return Returns the topicType. + */ + public int getTopicType() + { + return topicType; + } + + /** + * @param topicType The topicType to set. + */ + public void setTopicType(int topicType) + { + this.topicType = topicType; + } + + /** + * + * @return + */ + public String getPostDate() + { + String dateStr = null; + + SimpleDateFormat dateFormat = PortalUtil.getSDF(); + + dateStr = dateFormat.format(new Date()); + + return dateStr; + } + + /** + * + * @return + */ + public String getQuestion() + { + return this.question; + } + + /** + * + * @param question + */ + public void setQuestion(String question) + { + this.question = question; + } + + /** + * @return Returns the activeDuration. + */ + public int getActiveDuration() + { + return activeDuration; + } + /** + * @param activeDuration The activeDuration to set. + */ + public void setActiveDuration(int activeDuration) + { + this.activeDuration = activeDuration; + } + + /** + * @return + */ + public String getOption() + { + return null; + } + + /** + * @param + */ + public void setOption(String option) + { + if(option!=null && option.trim().length()>0) + { + this.options.add(option); + } + } + + public Collection getOptions() + { + return this.options; + } + + /** + * + * @return + */ + public boolean getDeletePoll() + { + return this.deletePoll; + } + + /** + * + * @param deletePoll + */ + public void setDeletePoll(boolean deletePoll) + { + this.deletePoll = deletePoll; + } + + /** + * + * @return + */ + public boolean isDeletePollActivated() + { + return this.deletePollActivated; + } + + + /** + * @return Returns the attachmentComment. + */ + public String getAttachmentComment() + { + return this.attachmentComment; + } + + /** + * @param attachmentComment The attachmentComment to set. + */ + public void setAttachmentComment(String attachmentComment) + { + this.attachmentComment = attachmentComment; + } + + /** + * @return Returns the attachment. + */ + public UploadedFile getAttachment() + { + return attachment; + } + + /** + * @param attachment The attachment to set. + */ + public void setAttachment(UploadedFile attachment) + { + this.attachment = attachment; + } + + /** + * + * @return + */ + public Collection getAttachments() + { + return this.attachments; + } + + /** + * + * @return + */ + public int getNumberOfAttachments() + { + int numberOfAttachments = 0; + + if(this.attachments!=null) + { + numberOfAttachments = this.attachments.size(); + } + + return numberOfAttachments; + } + //-----navigation related data--------------------------------------------------------------------------------------------------------------- + /** + * + */ + public boolean isPreview() + { + return this.isPreview; + } + + /** + * + * + */ + public boolean isPollPresent() + { + boolean isPollPresent = false; + + if(this.question!=null && this.question.trim().length()>0) + { + isPollPresent = true; + } + + return isPollPresent; + } + + /** + * + * + */ + public int getForumId() + { + return this.forumId; + } + + /** + * + * + */ + public int getTopicId() + { + return this.topicId; + } + + /** + * + * + */ + public int getPostId() + { + return this.postId; + } + + //------------------------------------------------------------------------------------------------------------------------------------------ + /** + * + * @author sshah + * since this controller is at session scope, must cleanup its state when not needed + * this will help optimize memory usage... + * puts the bean in an uninitialized state in that user's session + * + */ + protected void cleanup() + { + //puts this controller in an cleaned up state for the next time it will be used in the session + this.subject = null; + this.message = null; + this.topicType = 0; + this.isPreview = false; + this.forumId = -1; + this.topicId = -1; + this.postId = -1; + + //cleanup poll related data + this.question = null; + this.options = new ArrayList(); + this.activeDuration = 0; + this.deletePoll = false; + this.deletePollActivated = false; + + //cleanup attachment related data + this.attachment = null; + this.attachmentComment = null; + this.attachments = new ArrayList(); + } + + /** + * Takes a collection of tempFiles setup during data setup and produces attachments that are to be sent + * over to the module + * + * @param tempFiles + * @return + */ + protected Collection produceAttachments(Collection tempFiles) + { + Collection attachments = new ArrayList(); + if(tempFiles!=null) + { + for(Iterator itr=tempFiles.iterator();itr.hasNext();) + { + TempFileBinding cour = (TempFileBinding)itr.next(); + Attachment attachment = cour.produceAttachment(); + if(cour.getFileId()!=null && cour.getFileId().trim().length()>0) + { + try + { + //try to see if this fileId is the attachmentId in the database + int attachmentId = Integer.parseInt(cour.getFileId()); + if(attachmentId!=-1) + { + ((AttachmentImpl)attachment).setId(new Integer(attachmentId)); + } + else + { + ((AttachmentImpl)attachment).setId(null); + } + } + catch(Exception e){/*if an error occurs here...no problem..this is not the attachmentId anyways*/ + ((AttachmentImpl)attachment).setId(null);} + } + attachments.add(attachment); + } + } + return attachments; + } + + /** + * sets the poll information of a post for the ui from the business object + * + */ + protected void setupPoll(Poll poll) + { + if(poll!=null) + { + this.question = poll.getTitle(); + this.activeDuration = poll.getLength(); + List pollOptions = poll.getOptions(); + if(pollOptions!=null && pollOptions.size()>0) + { + this.options = new ArrayList(); + for(Iterator itr=pollOptions.iterator();itr.hasNext();) + { + PollOption cour = (PollOption)itr.next(); + this.options.add(cour.getQuestion()); + } + } + } + } + + /** + * sets up the attachment information of a post for the ui from the business object + * + */ + protected void setupAttachments(Collection attachments) throws Exception + { + if(attachments!=null) + { + this.attachments = new ArrayList(); + for(Iterator itr=attachments.iterator();itr.hasNext();) + { + Attachment cour = (Attachment)itr.next(); + TempFileBinding uiAttachment = new TempFileBinding( + cour.getFile().getContentType(), //contentType + "".getBytes(), //byte content....just use empty data...this object is for the ui and the actual + //content of the attachment is not needed here + cour.getFile().getName(), //file name + String.valueOf(System.currentTimeMillis()) + "_" + this.attachments.size() //unique fileId for this collection of files + ); + uiAttachment.setComment(cour.getComment()); + uiAttachment.setFileId(String.valueOf(cour.getId().intValue())); //this holds the information to actually identify the + //attachment stored in the database + this.attachments.add(uiAttachment); + } + } + } + + //---------------------------------------------------------------------------------------------------------------------------------------- + /** + * + * @author sshah + * + */ + public PostAction() + { + super(); + } + + //---------------------------------------------------------------------------------------------------------------------------------------- + /** + * + * @author sshah + * + */ + public abstract String start(); + + //poll related operations-------------------------------------------------------------------------------------------------------------------- + /** + * + * @author sshah + */ + public String deleteOption() + { + String navState = null; + try + { + int optionIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_option)); + + //actually remove the option value + optionIndex--; + ((ArrayList)this.options).remove(optionIndex); + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + //-----------------attachment related------------------------------------------------------------------------------------------ + /** + * + */ + public String addAttachment() + { + String navState = null; + try + { + if(this.attachment!=null) + { + TempFileBinding file = new TempFileBinding( + this.attachment.getContentType(), + this.attachment.getBytes(), + this.attachment.getName(), + String.valueOf(System.currentTimeMillis()) + "_" + this.attachments.size() //unique fileId for this collection of files + ); + if(this.attachmentComment!=null) + { + file.setComment(this.attachmentComment); + } + file.setFileId("-1"); //identifies attachments from ui that are not stored in the database yet + this.attachments.add(file); + } + + //clear out the attachment related view data + this.setAttachment(null); + this.setAttachmentComment(null); + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + + /** + * + * @author sshah + */ + public String deleteAttachment() + { + String navState = null; + try + { + int attachmentIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_attachment)); + + attachmentIndex--; + ((ArrayList)this.attachments).remove(attachmentIndex); + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + //------------preview------------------------------------------------------------------------------------------------------- + /** + * + * @return + */ + public String preview() + { + String navState = null; + try + { + this.isPreview = true; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + + //---------------------------cancel----------------------------------------------------------------------------------------- + /** + * + * @author sshah + * + */ + public String cancel() + { + return Constants.CANCEL; + } + + //--------execute------------------------------------------------------------------------------------------------------------- + /** + * + * @return + */ + public abstract String execute(); +} Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java 2006-05-03 18:16:42 UTC (rev 4068) @@ -0,0 +1,172 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.action; + +import java.util.Date; +import java.util.List; + + +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.BaseController; +import org.jboss.portlet.forums.ui.ForumUtil; +import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; + +import org.jboss.portlet.forums.model.Forum; +import org.jboss.portlet.forums.model.Poster; +import org.jboss.portlet.forums.model.Topic; +import org.jboss.portlet.forums.model.Message; +import org.jboss.portlet.forums.model.Post; + +import org.jboss.portlet.forums.commands.ValidationException; +import org.jboss.portlet.forums.commands.post.PostTools; + +//myfaces + + +/** + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + * + */ +public class ReplyTopic extends PostAction +{ + //---------------------------------------------------------------------------------------------------------------------------------------- + /** + * + * @author sshah + * + */ + public ReplyTopic() + { + super(); + } + //---------------------------------------------------------------------------------------------------------------------------------------- + /** + * + * @author sshah + * + */ + public String start() + { + String navState = null; + try + { + int forumId = -1; + int topicId = -1; + String f = ForumUtil.getParameter(Constants.p_forumId); + String t = ForumUtil.getParameter(Constants.p_topicId); + if(f!=null && f.trim().length()>0) + { + forumId = Integer.parseInt(f); + } + if(t!=null && t.trim().length()>0) + { + topicId = Integer.parseInt(t); + } + + //grab the forum where this topic will be added + if(forumId!=-1) + { + //re-initialize this controller to add a reply post in a topic + //to the specified forum + this.cleanup(); + + //set the selected forum's id and topic's id + this.forumId = forumId; + this.topicId = topicId; + } + + navState = Constants.START_REPLY; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return navState; + } + //--------execute------------------------------------------------------------------------------------------------------------- + /** + * + * @return + */ + public String execute() + { + String navState = null; + boolean success = false; + try + { + Message message = PortalUtil.createMessage(); + message.setText(this.message); + message.setSubject(this.subject); + + //perform domain level validation of information here....ui level validation should have already passed + //whether done using javascript or JSF validators + PostTools.validate(message); + + //setup the forum and the corresponding poster + Forum forum = BaseController.getForumsModule().findForumById(new Integer(this.forumId)); + Topic topic = BaseController.getForumsModule().findTopicById(new Integer(topicId)); + Poster poster = PortalUtil.getPoster(); + + + //actually post a reply to this topic in the forum + Post post = BaseController.getForumsModule().createPost(topic, + forum, + message, + new Date(), + poster, + (List)this.produceAttachments(this.attachments) //attachments + ); + poster.incrementPostCount(); + + + + //setup the navigation state + navState = Constants.SUCCESS; + + success = true; + } + catch(Exception e) + { + if(e instanceof ValidationException) + { + //handle proper validation error with a proper message...not just a generic message.. + //just use generic error page for the proof of concept + //set the custom exception such that e.toString() results in the proper message + JSFUtil.handleException(e); + } + else + { + JSFUtil.handleException(e); + } + } + finally + { + //cleanup if necessary + if(success) + { + this.cleanup(); + } + } + return navState; + } +} Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-03 18:16:42 UTC (rev 4068) @@ -9,11 +9,11 @@ <!-- general application configuration --> <application> <!-- jbossportal-facelets integration --> - <!--property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver> - <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler--> + <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver> + <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler> <!-- standalone facelets integration --> - <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> + <!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler--> <!-- internationalization --> <locale-config> @@ -58,7 +58,7 @@ </map-entry> <map-entry> <key>posting</key> - <value>/views/topics/posting_body.jsf</value> + <value>/views/topics/posting_new_body.jsf</value> </map-entry> <map-entry> <key>profile</key> @@ -108,7 +108,14 @@ <managed-bean-name>forum</managed-bean-name> <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewForum</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> - </managed-bean> + </managed-bean> + <navigation-rule> + <from-view-id>/views/forums/viewforum_body.xhtml</from-view-id> + <navigation-case> + <from-outcome>startNewTopic</from-outcome> + <to-view-id>/views/topics/posting_new_body.xhtml</to-view-id> + </navigation-case> + </navigation-rule> <!-- configuration for NewTopic --> <managed-bean> @@ -116,27 +123,21 @@ <managed-bean-class>org.jboss.portlet.forums.ui.action.NewTopic</managed-bean-class> <!-- this workflow is chatty and needs to be preserved on the session --> <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - <navigation-rule> - <navigation-case> - <from-outcome>start</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml</to-view-id> - </navigation-case> - </navigation-rule> + </managed-bean> <navigation-rule> - <from-view-id>/views/topics/posting_body.xhtml</from-view-id> + <from-view-id>/views/topics/posting_new_body.xhtml</from-view-id> <!-- straight jsf calls --> <navigation-case> <from-outcome>addOption</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml</to-view-id> + <to-view-id>/views/topics/posting_new_body.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>updateOption</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml</to-view-id> + <to-view-id>/views/topics/posting_new_body.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>updateAttachment</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml</to-view-id> + <to-view-id>/views/topics/posting_new_body.xhtml</to-view-id> </navigation-case> <!-- jsf state by method call on managed bean first --> <navigation-case> @@ -149,12 +150,93 @@ </navigation-case> </navigation-rule> + <!-- configuration for replyTopic --> + <managed-bean> + <managed-bean-name>replyTopic</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.action.ReplyTopic</managed-bean-class> + <!-- this workflow is chatty and needs to be preserved on the session --> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + <navigation-rule> + <from-view-id>/views/topics/posting_reply_body.xhtml</from-view-id> + <!-- straight jsf calls --> + <navigation-case> + <from-outcome>addOption</from-outcome> + <to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>updateOption</from-outcome> + <to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>updateAttachment</from-outcome> + <to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id> + </navigation-case> + <!-- jsf state by method call on managed bean first --> + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <!-- configuration for editPost --> + <managed-bean> + <managed-bean-name>editPost</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.action.EditPost</managed-bean-class> + <!-- this workflow is chatty and needs to be preserved on the session --> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + <navigation-rule> + <from-view-id>/views/topics/posting_edit_body.xhtml</from-view-id> + <!-- straight jsf calls --> + <navigation-case> + <from-outcome>addOption</from-outcome> + <to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>updateOption</from-outcome> + <to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>updateAttachment</from-outcome> + <to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id> + </navigation-case> + <!-- jsf state by method call on managed bean first --> + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + <!-- managedBean for the viewTopic usecase --> <managed-bean> <managed-bean-name>topic</managed-bean-name> <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewTopic</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> + <navigation-rule> + <from-view-id>/views/topics/viewtopic_body.xhtml</from-view-id> + <navigation-case> + <from-outcome>startNewTopic</from-outcome> + <to-view-id>/views/topics/posting_new_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>startReply</from-outcome> + <to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>startEditPost</from-outcome> + <to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id> + </navigation-case> + </navigation-rule> <!-- managedBean for the jumpbox usecase --> <managed-bean> Deleted: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_body.xhtml 2006-05-03 14:57:03 UTC (rev 4067) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/... [truncated message content] |
From: <jbo...@li...> - 2006-05-03 14:57:11
|
Author: adamw Date: 2006-05-03 10:57:03 -0400 (Wed, 03 May 2006) New Revision: 4067 Modified: labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/etc/Messages.properties labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java Log: http://jira.jboss.com/jira/browse/JBLAB-671 Modified: labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/etc/Messages.properties =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/etc/Messages.properties 2006-05-03 12:44:14 UTC (rev 4066) +++ labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/etc/Messages.properties 2006-05-03 14:57:03 UTC (rev 4067) @@ -34,6 +34,7 @@ acceptedMailTextAdmin = \ A new contributor has been accepted. \n\ Name: {0} \n\ + Projects: {4} \n\ Email: {1} \n\ Type: {2} \n\ Login: {3} Modified: labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java 2006-05-03 12:44:14 UTC (rev 4066) +++ labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java 2006-05-03 14:57:03 UTC (rev 4067) @@ -158,7 +158,7 @@ getFormattedMessage("acceptedMailTextAdmin", new Object[] { dataBean.getName(), dataBean.getEmail(), dataBean.getType(), - dataBean.getLogin() }), + dataBean.getLogin(), dataBean.getProjects() }), "lab...@la..."); return true; |
From: <jbo...@li...> - 2006-05-03 09:02:23
|
Author: adamw Date: 2006-05-03 05:01:59 -0400 (Wed, 03 May 2006) New Revision: 4065 Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgePropertiesWatcher.java labs/jbosslabs/trunk/portal-extensions/forge-file-access/forge-file-access.iml Removed: labs/jbosslabs/trunk/portal-extensions/forge-common/src/etc/mime.types labs/jbosslabs/trunk/portal-extensions/forge-common/src/etc/org/ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeProperties.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConTools.java labs/jbosslabs/trunk/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java Log: http://jira.jboss.com/jira/browse/JBLAB-668 + contributors fix Deleted: labs/jbosslabs/trunk/portal-extensions/forge-common/src/etc/mime.types =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/etc/mime.types 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/etc/mime.types 2006-05-03 09:01:59 UTC (rev 4065) @@ -1,22 +0,0 @@ -application/postscript ai eps ps -application/rtf rtf -application/slate -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -audio/basic au snd -audio/x-aiff aif aiff aifc -audio/x-wav wav -image/gif gif -image/ief ief -image/png png -image/jpeg jpeg jpg jpe -image/tiff tiff tif -image/x-xwindowdump xwd -text/html html -text/plain txt -video/mpeg mpeg mpg mpe -video/quicktime qt mov -video/x-msvideo avi -video/x-sgi-movie movie -text/css css Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -50,6 +50,7 @@ import org.jboss.mx.util.MBeanServerLocator; import org.jboss.portlet.JBossRenderRequest; import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.aop.CacheItem; import org.w3c.dom.Node; /** @@ -108,12 +109,6 @@ */ public final static String LABS_PORTAL = "default"; - private final static String MIME_TYPE_FILENAME = "mime.types"; - - private static ForgeProperties props; - - private static MimetypesFileTypeMap mimeTypes; - private static Vector<String> tempFiles; public static final String FILES_PREFIX = "labsTempFile"; @@ -123,12 +118,7 @@ private static VolatileTempFileRemover vtfRemover; static { - // Reading forge properties. - props = new ForgeProperties(); forgeManagement = null; - - mimeTypes = new MimetypesFileTypeMap(ForgeHelper.class - .getResourceAsStream("/" + MIME_TYPE_FILENAME)); tempFiles = new Vector<String>(); @@ -163,7 +153,14 @@ } } - /** + @CacheItem + private static ForgePropertiesWatcher forgeProperties; + + public static Properties getProperties() { + return forgeProperties.get(""); + } + + /** * In <code>str</code>, replaces each occurence of <code>pattern</code> * with <code>replace</code>. * @@ -308,7 +305,7 @@ String message, String from) throws MessagingException { // Set the host smtp address Properties props = new Properties(); - props.put("mail.smtp.host", ForgeHelper.props.getSmtpServer()); + props.put("mail.smtp.host", getProperties().getProperty("smtpserver")); // Create some properties and get the default Session Session session = Session.getDefaultInstance(props, null); @@ -331,16 +328,7 @@ Transport.send(msg); } - /** - * Gets an instance of read ForgeProperties. - * - * @return An instance of read ForgeProperties. - */ - public static ForgeProperties getForgeProperties() { - return props; - } - - /** + /** * Creates a link to a global freezone page basing on the given parameters. * * @param portalName @@ -486,16 +474,8 @@ return makeAddress(request.getScheme(), request.getServerName(), request.getServerPort()); } - - public static String getContentType(File file) { - return mimeTypes.getContentType(file); - } - - public static String getContentType(String fileName) { - return mimeTypes.getContentType(fileName); - } - - /**Add temporary file. This returns you TempFileDescriptor with opened InputStream to the file and link to access it. + + /**Add temporary file. This returns you TempFileDescriptor with opened InputStream to the file and link to access it. * Remember to close the input after use ! * @param fileSuffix suffix of the temporary file (to get apropriate content_type) and allow deletion for not volatile files. * @param volatileFile If true file will be deleted, if false you have to delete it on your own, by using deleteTempFile with apropriate suffix. Deleted: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeProperties.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeProperties.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeProperties.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -1,69 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.jboss.forge.common; - -import java.io.IOException; -import java.util.Properties; - -public class ForgeProperties { - /** - * <code>blogPath</code> - path to the local blog content - */ - private String blogPath; - /** - * <code>smtpServer</code> - a smtp server for sending mails - */ - private String smtpServer; - /** - * <code>contribAdmin</code> - e-mail of "contributor's applications" - * administrator. - */ - private String contribAdmin; - - public ForgeProperties() { - /* Reading the properties */ - Properties properties = new Properties(); - - try { - properties.load(ForgeHelper.class - .getResourceAsStream("forge.properties")); - } catch (IOException e) { - throw new RuntimeException("Error loading properties"); - } - - blogPath = properties.getProperty("blogpath"); - smtpServer = properties.getProperty("smtpserver"); - contribAdmin = properties.getProperty("contribadmin"); - } - - String getBlogPath() { - return blogPath; - } - - public String getContribAdmin() { - return contribAdmin; - } - - String getSmtpServer() { - return smtpServer; - } -} Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgePropertiesWatcher.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgePropertiesWatcher.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgePropertiesWatcher.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -0,0 +1,42 @@ +package org.jboss.forge.common; + +import org.jboss.shotoku.cache.ShotokuResourceWatcher; +import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.exceptions.ResourceDoesNotExist; +import org.jboss.logging.Logger; + +import java.util.Properties; +import java.util.Map; +import java.io.IOException; + +/** + * @author Adam Warski (ad...@as...) + */ +public class ForgePropertiesWatcher extends ShotokuResourceWatcher<String, Properties> { + private static final Logger log = Logger.getLogger(ForgePropertiesWatcher.class); + + private Properties getProperties(String key) { + Properties ret = new Properties(); + + try { + ret.load(getContentManager(key).getNode( + "/configuration/forge.properties").getContentInputStream()); + } catch (Exception e) { + log.error("Error while loading forge.properties.", e); + } + + return ret; + } + + public Properties init(String key) { + return getProperties(key); + } + + protected void update(String key, Properties currentObject, Map changes) { + put(key, getProperties(key)); + } + + protected ContentManager initContentManager(String key) { + return ContentManager.getContentManager(); + } +} Modified: labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConServer.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -42,6 +42,7 @@ import org.jboss.shotoku.aop.CacheItem; import org.jboss.shotoku.exceptions.ResourceDoesNotExist; import org.jboss.shotoku.exceptions.SaveException; +import org.jboss.portlet.PortalNodeURL; import org.xml.sax.InputSource; /** @@ -148,17 +149,17 @@ messages.getString("acceptedMailSubject"), getFormattedMessage("acceptedMailText", new Object[] { dataBean.getName() }), - "for...@la..."); + "lab...@la..."); // Posting a notification to the con-admin ForgeHelper.postMail( - ForgeHelper.getForgeProperties().getContribAdmin(), + ForgeHelper.getProperties().getProperty("contribadmin"), messages.getString("acceptedMailSubject"), getFormattedMessage("acceptedMailTextAdmin", new Object[] { dataBean.getName(), dataBean.getEmail(), dataBean.getType(), dataBean.getLogin() }), - "for...@la..."); + "lab...@la..."); return true; } catch (Exception e) { @@ -276,13 +277,13 @@ confirmed.save("Confirming new application"); unconfirmed.save("Confirming new application"); - PortletURL url = ConTools.createRenderURL(); + PortalNodeURL url = ConTools.createRenderURL(); String adminURL = ConTools.getBaseServerAddress() + url.toString(); // Sending an email to the admin. ForgeHelper.postMail( - ForgeHelper.getForgeProperties().getContribAdmin(), + ForgeHelper.getProperties().getProperty("contribadmin"), messages.getString("adminMailSubject"), getFormattedMessage("adminMailText", new Object[] { newXml, adminURL }), @@ -345,7 +346,7 @@ // Values ok, adding application. // Sending the confirmation e-mail. - PortletURL url = ConTools.createRenderURL(); + PortalNodeURL url = ConTools.createRenderURL(); url.setParameter("confirm", confirmationCode); String confirmationURL = ConTools.getBaseServerAddress() + url.toString(); Modified: labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConTools.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConTools.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-contributor/src/java/org/jboss/forge/contributor/ConTools.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -30,10 +30,7 @@ import org.jboss.forge.common.Constants; import org.jboss.forge.common.ForgeHelper; -import org.jboss.portlet.JBossActionRequest; -import org.jboss.portlet.JBossActionResponse; -import org.jboss.portlet.JBossRenderRequest; -import org.jboss.portlet.JBossRenderResponse; +import org.jboss.portlet.*; /** * @author adamw @@ -41,60 +38,68 @@ * faces and external contexts. */ public class ConTools { - static ExternalContext getExternalContext() { - return FacesContext.getCurrentInstance().getExternalContext(); - } - - static String getRequestProperty(String propertyName) { - Object request = getExternalContext().getRequest(); - if (request instanceof JBossActionRequest) { - return (String) - ((JBossActionRequest) request).getPortalContext(). - getProperty(propertyName); - } else if (request instanceof JBossRenderRequest) { - return (String) - ((JBossRenderRequest) request).getPortalContext(). - getProperty(propertyName); - } else return null; - } - - static PortletURL createRenderURL() { - Object response = getExternalContext().getResponse(); - if (response instanceof JBossActionResponse) { - //TODO - //New "feature" of portal 2.2 ... - //return ((JBossActionResponse) response).createRenderURL(); - return null; - } else if (response instanceof JBossRenderResponse) { - return ((JBossRenderResponse) response).createRenderURL(); - } else return null; - } - - static String getBaseServerAddress() { - Object request = getExternalContext().getRequest(); - if (request instanceof JBossActionRequest) { - return ForgeHelper.getBaseServerAddress((JBossActionRequest) request); - } else if (request instanceof JBossRenderRequest) { - return ForgeHelper.getBaseServerAddress((JBossRenderRequest) request); - } else return ""; - } - - static String getPortalName() { - return getRequestProperty(Constants.PROP_SHOTOKU_PORTAL_DIRECTORY); - } - - static boolean hasPermission(String permission) { - Object request = getExternalContext().getRequest(); - if (request instanceof JBossActionRequest) { - return - ((JBossActionRequest) request).hasPermission(permission); - } else if (request instanceof JBossRenderRequest) { - return - ((JBossRenderRequest) request).hasPermission(permission); - } else return false; - } - - static String getRemoteUser() { - return getExternalContext().getRemoteUser(); - } + static ExternalContext getExternalContext() { + return FacesContext.getCurrentInstance().getExternalContext(); + } + + static String getRequestProperty(String propertyName) { + Object request = getExternalContext().getRequest(); + if (request instanceof JBossActionRequest) { + return (String) + ((JBossActionRequest) request).getPortalContext(). + getProperty(propertyName); + } else if (request instanceof JBossRenderRequest) { + return (String) + ((JBossRenderRequest) request).getPortalContext(). + getProperty(propertyName); + } else return null; + } + + static PortalNodeURL createRenderURL() { + Object response = getExternalContext().getResponse(); + if (response instanceof JBossActionResponse) { + System.out.println("ACTION RESPONSE " + + ((JBossActionResponse) response).createRenderURL( + ((JBossActionRequest) getExternalContext().getRequest()).getPortalNode())); + //TODO + //New "feature" of portal 2.2 ... + return ((JBossActionResponse) response).createRenderURL( + ((JBossActionRequest) getExternalContext().getRequest()).getPortalNode()); + //return null; + } else if (response instanceof JBossRenderResponse) { + return ((JBossRenderResponse) response).createRenderURL( + ((JBossActionRequest) getExternalContext().getRequest()).getPortalNode()); + } else { + System.out.println("UNKNOWN RESPONSE"); + return null; + } + } + + static String getBaseServerAddress() { + Object request = getExternalContext().getRequest(); + if (request instanceof JBossActionRequest) { + return ForgeHelper.getBaseServerAddress((JBossActionRequest) request); + } else if (request instanceof JBossRenderRequest) { + return ForgeHelper.getBaseServerAddress((JBossRenderRequest) request); + } else return ""; + } + + static String getPortalName() { + return getRequestProperty(Constants.PROP_SHOTOKU_PORTAL_DIRECTORY); + } + + static boolean hasPermission(String permission) { + Object request = getExternalContext().getRequest(); + if (request instanceof JBossActionRequest) { + return + ((JBossActionRequest) request).hasPermission(permission); + } else if (request instanceof JBossRenderRequest) { + return + ((JBossRenderRequest) request).hasPermission(permission); + } else return false; + } + + static String getRemoteUser() { + return getExternalContext().getRemoteUser(); + } } Added: labs/jbosslabs/trunk/portal-extensions/forge-file-access/forge-file-access.iml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-file-access/forge-file-access.iml 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-file-access/forge-file-access.iml 2006-05-03 09:01:59 UTC (rev 4065) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/target" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="jboss" level="application" /> + <orderEntry type="module" module-name="forge-common" /> + <orderEntry type="module" module-name="shotoku-base" /> + <orderEntry type="module" module-name="shotoku-aop" /> + <orderEntryProperties /> + </component> +</module> + Modified: labs/jbosslabs/trunk/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java 2006-05-03 08:35:20 UTC (rev 4064) +++ labs/jbosslabs/trunk/portal-extensions/forge-file-access/src/java/org/jboss/forge/fileaccess/FileAccessFilter.java 2006-05-03 09:01:59 UTC (rev 4065) @@ -36,6 +36,7 @@ import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.Node; +import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.aop.Inject; import org.jboss.forge.common.ForgeHelper; @@ -171,9 +172,9 @@ } - InputStream is = null; - String mimeType = null; - int contentLength = 0; + InputStream is; + String mimeType; + int contentLength; // check if this request is for temp file if (requestedRes.startsWith(ForgeHelper.TMP_FILES_ACCESS)) { @@ -185,7 +186,7 @@ is = new FileInputStream(file); - mimeType = ForgeHelper.getContentType(file); + mimeType = Tools.getNameBasedMimeType(file); contentLength = (int)file.length(); @@ -229,9 +230,8 @@ /** * Method used to resolve portal name to which the download link aims. - * + * * @param link - * @return */ private static String resolvePortalName(String link) { return link.split(File.separator)[0]; |
From: <jbo...@li...> - 2006-05-03 08:35:31
|
Author: mla...@jb... Date: 2006-05-03 04:35:20 -0400 (Wed, 03 May 2006) New Revision: 4064 Removed: labs/jbosswebnp/trunk/dist/ Log: They will go to the web site |
From: <jbo...@li...> - 2006-05-03 08:33:57
|
Author: mla...@jb... Date: 2006-05-03 04:31:10 -0400 (Wed, 03 May 2006) New Revision: 4063 Added: labs/jbosswebnp/trunk/dist/ labs/jbosswebnp/trunk/dist/win/ labs/jbosswebnp/trunk/dist/win/gnuwin32.zip Log: Added dist tools Added: labs/jbosswebnp/trunk/dist/win/gnuwin32.zip =================================================================== (Binary files differ) Property changes on: labs/jbosswebnp/trunk/dist/win/gnuwin32.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2006-05-03 07:40:07
|
Author: mic...@jb... Date: 2006-05-03 03:39:58 -0400 (Wed, 03 May 2006) New Revision: 4062 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Working_Memory.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Working_Memory.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Working_Memory.xml 2006-05-03 07:21:17 UTC (rev 4061) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Working_Memory.xml 2006-05-03 07:39:58 UTC (rev 4062) @@ -40,7 +40,7 @@ working memory will no longer track that fact, and any rules that were dependent on that fact will not be activated. Note that it is possible to have rules that depend on the "non existence" of fact, in which case - retracting a fact may cause a rule to activate. </para> + retracting a fact may cause a rule to activate.</para> </section> <section> @@ -104,6 +104,20 @@ <section> <title>Stateless and Statefull Sessions</title> - <para></para> + <para>Rule engines that are based around algorithms like RETE are + technically statefull rule engines. That is, they work best when the RETE + network is longer lived, being notified of changes, and accumulating facts + - that is where they shine. </para> + + <para>However, many scenarious simply require a stateless mode where all + the facts (data) are supplied fresh to the rule engine and then the rules + are invoked. Drools is fine in these scenarious as well - in fact, the + RETE algorithm is still of benefit as often there will be scenarios in a + stateless session where rules actions cause other rules to fire, or where + there are large numbers of facts to match with rules. </para> + + <para>The JSR-94 api specifies statefull and stateless modes, but the + equivalent in the native API is to simply create a new working memory + instance, and then discard it when the session is finished.</para> </section> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-03 07:21:21
|
Author: mla...@jb... Date: 2006-05-03 03:21:17 -0400 (Wed, 03 May 2006) New Revision: 4061 Removed: labs/jbossweb/trunk/src/windows/native/jbcorelib/ labs/jbossweb/trunk/src/windows/native/jbcorplib/ labs/jbossweb/trunk/src/windows/native/jbcorulib/ Log: Remove obsolete ASP.NET version |
From: <jbo...@li...> - 2006-05-03 07:20:26
|
Author: mla...@jb... Date: 2006-05-03 03:20:20 -0400 (Wed, 03 May 2006) New Revision: 4060 Modified: labs/jbossweb/trunk/src/share/native/NMAKEmakefile labs/jbossweb/trunk/src/share/native/srclib/apr/NMAKEmakefile Log: Properly use mt.exe tool. Modified: labs/jbossweb/trunk/src/share/native/NMAKEmakefile =================================================================== --- labs/jbossweb/trunk/src/share/native/NMAKEmakefile 2006-05-03 07:19:37 UTC (rev 4059) +++ labs/jbossweb/trunk/src/share/native/NMAKEmakefile 2006-05-03 07:20:20 UTC (rev 4060) @@ -100,6 +100,7 @@ BUILDLIB = $(BUILDIR)\$(PROJECT).dll BUILDPDB = $(BUILDIR)\$(PROJECT).pdb BUILDRES = $(BUILDIR)\$(PROJECT).res +BUILDMAN = $(BUILDLIB).manifest all : $(BUILDIR) $(BUILDLIB) @@ -119,6 +120,8 @@ $(BUILDLIB): $(BUILDIR) $(OBJECTS) $(BUILDRES) $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDLIB) + IF EXIST $(BUILDMAN) \ + mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 clean: @$(CLEANTARGET) Modified: labs/jbossweb/trunk/src/share/native/srclib/apr/NMAKEmakefile =================================================================== --- labs/jbossweb/trunk/src/share/native/srclib/apr/NMAKEmakefile 2006-05-03 07:19:37 UTC (rev 4059) +++ labs/jbossweb/trunk/src/share/native/srclib/apr/NMAKEmakefile 2006-05-03 07:20:20 UTC (rev 4060) @@ -202,7 +202,8 @@ $(RC) $(RCFLAGS) /i "$(SRCDIR)/include" /d "APR_VERSION_ONLY" /fo $(BUILDRES) libapr.rc $(BUILDLIB): $(BUILDIR) $(SRCDIR)/include/apr.h $(OBJECTS) $(BUILDRES) $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) /pdb:$(BUILDPDB) /out:$(BUILDLIB) - mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 + IF EXIST $(BUILDMAN) \ + mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2 !ELSE $(BUILDLIB): $(BUILDIR) $(SRCDIR)/include/apr.h $(OBJECTS) $(LINK) $(LFLAGS) $(OBJECTS) /out:$(BUILDLIB) |
From: <jbo...@li...> - 2006-05-03 07:19:43
|
Author: mla...@jb... Date: 2006-05-03 03:19:37 -0400 (Wed, 03 May 2006) New Revision: 4059 Added: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/NMAKEmakefile Removed: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsp labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsw labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.sln labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.vcproj Modified: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jboss.rc Log: Use common nmake system instead dsp/sln Added: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/NMAKEmakefile =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/NMAKEmakefile 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/NMAKEmakefile 2006-05-03 07:19:37 UTC (rev 4059) @@ -0,0 +1,63 @@ +# Copyright 2001-2005 The Apache Software Foundation or its licensors, as +# applicable. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ==================================================================== +# +# NMAKEmakefile JBoss Service Make file. +# Usage: +# DEBUG=1 Build DEBUG version +# +# Originally contributed by Mladen Turk <mturk jboss.com> +# +# ==================================================================== +# + +TARGET = EXE +PROJECT = jbosssvc +!include <../../../../share/native/build/NMAKEcommon.inc> + +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +LFLAGS = $(LFLAGS) user32.lib + +PDBFLAGS = -Fo$(BUILDIR)\ -Fd$(BUILDIR)\$(PROJECT)-src +OBJECTS = \ + $(BUILDIR)\jboss.obj + +BUILDEXE = $(BUILDIR)\$(PROJECT).exe +BUILDPDB = $(BUILDIR)\$(PROJECT).pdb +BUILDRES = $(BUILDIR)\$(PROJECT).res +BUILDMAN = $(BUILDLIB).manifest + +all : $(BUILDIR) $(BUILDEXE) + +$(BUILDIR) : + @$(MAKETARGET) + +{$(SRCDIR)}.c{$(BUILDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $< + +$(BUILDRES): $(SRCDIR)/jboss.rc + $(RC) $(RCFLAGS) /fo $(BUILDRES) $(SRCDIR)/jboss.rc + +$(BUILDEXE): $(BUILDIR) $(OBJECTS) $(BUILDRES) + $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDEXE) + IF EXIST $(BUILDMAN) \ + mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);1 + +clean: + @$(CLEANTARGET) Modified: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jboss.rc =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jboss.rc 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jboss.rc 2006-05-03 07:19:37 UTC (rev 4059) @@ -5,9 +5,9 @@ * See terms of license at gnu.org. */ - #include <windows.h> +#include <windows.h> - #define PRODUCT_VER_STRING "1.0.0.0\0" +#define PRODUCT_VER_STRING "1.0.1.0\0" #define STR_COPYRIGHT "Copyright 2006 JBoss inc. " \ "or its licensors, as applicable." @@ -21,8 +21,8 @@ #define STR_VERISON "1.0.1.0" #define CSV_VERISON 1,0,1,0 -#define PRIVATE_BUILD 1 -#define PRERELEASE_BUILD 1 +#define PRIVATE_BUILD 0 +#define PRERELEASE_BUILD 0 #if PRIVATE_BUILD #define STR_PRIVATE "Initial Prerelease" Deleted: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsp =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsp 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsp 2006-05-03 07:19:37 UTC (rev 4059) @@ -1,75 +0,0 @@ -# Microsoft Developer Studio Project File - Name="jbosssvc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=JBOSSSVC - WIN32 RELEASE -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "jbosssvc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "jbosssvc.mak" CFG="JBOSSSVC - WIN32 RELEASE" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "jbosssvc - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX- /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x41a /d "NDEBUG" -# ADD RSC /l 0x41a /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# Begin Target - -# Name "jbosssvc - Win32 Release" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\jboss.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\jboss.rc -# End Source File -# End Group -# End Target -# End Project Deleted: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsw =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsw 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.dsw 2006-05-03 07:19:37 UTC (rev 4059) @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "jbosssvc"=.\jbosssvc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - Deleted: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.sln =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.sln 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.sln 2006-05-03 07:19:37 UTC (rev 4059) @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbosssvc", "jbosssvc.vcproj", "{E614E305-075F-4899-B482-A438E9557553}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E614E305-075F-4899-B482-A438E9557553}.Release|Win32.ActiveCfg = Release|Win32 - {E614E305-075F-4899-B482-A438E9557553}.Release|Win32.Build.0 = Release|Win32 - {E614E305-075F-4899-B482-A438E9557553}.Release|x64.ActiveCfg = Release|x64 - {E614E305-075F-4899-B482-A438E9557553}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.vcproj =================================================================== --- labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.vcproj 2006-05-03 06:51:20 UTC (rev 4058) +++ labs/jbossweb/trunk/src/windows/native/service/jbosssvc/jbosssvc.vcproj 2006-05-03 07:19:37 UTC (rev 4059) @@ -1,358 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="jbosssvc" - ProjectGUID="{E614E305-075F-4899-B482-A438E9557553}" - RootNamespace="jbosssvc" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - <Platform - Name="x64" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - ExceptionHandling="0" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|x64" - OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" - IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TargetEnvironment="3" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="17" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|x64" - OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" - IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TargetEnvironment="3" - /> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - ExceptionHandling="0" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="17" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\jboss.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - <File - RelativePath=".\jboss.rc" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> |
From: <jbo...@li...> - 2006-05-03 06:51:26
|
Author: mic...@jb... Date: 2006-05-03 02:51:20 -0400 (Wed, 03 May 2006) New Revision: 4058 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java Log: death to regex Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java 2006-05-03 05:51:24 UTC (rev 4057) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/ClassFieldInspector.java 2006-05-03 06:51:20 UTC (rev 4058) @@ -84,8 +84,8 @@ * Convert it to a form so we can load the bytes from the classpath. */ private String getResourcePath(Class clazz) { - return "/" + clazz.getName().replaceAll( "\\.", - "/" ) + ".class"; + return "/" + clazz.getName().replace( '.', + '/' ) + ".class"; } /** |
From: <jbo...@li...> - 2006-05-03 05:51:30
|
Author: mic...@jb... Date: 2006-05-03 01:51:24 -0400 (Wed, 03 May 2006) New Revision: 4057 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/MethodComparator.java Log: JBRULES-251 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/MethodComparator.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/MethodComparator.java 2006-05-03 04:31:35 UTC (rev 4056) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/asm/MethodComparator.java 2006-05-03 05:51:24 UTC (rev 4057) @@ -23,31 +23,44 @@ * This actually does the comparing. * Class1 and Class2 are class reader instances to the respective classes. method1 and method2 are looked up on the * respective classes and their contents compared. + * + * This is a convenience method. */ public boolean equivalent(String method1, ClassReader class1, String method2, ClassReader class2) { - Tracer visit1 = new Tracer(method1); - class1.accept( visit1, true ); - TraceMethodVisitor trace1 = visit1.getTrace(); - List list1 = (trace1.getText()); - - Tracer visit2 = new Tracer(method2); - class2.accept( visit2, true ); - TraceMethodVisitor trace2 = visit2.getTrace(); - List list2 = trace2.getText(); + List list1 = getMethodBytecode( method1, class1 ); + List list2 = getMethodBytecode( method2, class2 ); - if (list1.size() != list2.size()) return false; + return compareBytecode( list1, list2 ); + } + + /** + * This will return a series of bytecode instructions which can be used to compare one method with another. + * debug info like local var declarations and line numbers are ignored, so the focus is on the content. + */ + public List getMethodBytecode(String methodName, ClassReader classReader) { + Tracer visit = new Tracer(methodName); + classReader.accept( visit, true ); + TraceMethodVisitor trace = visit.getTrace(); + return trace.getText(); + } + + /** + * Compares 2 bytecode listings. + * Returns true if they are identical. + */ + public boolean compareBytecode(List b1, List b2) { + if (b1.size() != b2.size()) return false; - for (int i = 0; i < list1.size(); i++) { + for (int i = 0; i < b1.size(); i++) { if (! - (list1.get( i ).equals( list2.get( i ) )) + (b1.get( i ).equals( b2.get( i ) )) ) { return false; } } return true; - } static class Tracer implements ClassVisitor { |
Author: mic...@jb... Date: 2006-05-03 00:31:35 -0400 (Wed, 03 May 2006) New Revision: 4056 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/AndDescr.java labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/lang/RuleParserTest.java labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/eval_rule_test_more.drl Log: JBRULES-251 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/AndDescr.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/AndDescr.java 2006-05-03 04:28:38 UTC (rev 4055) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/AndDescr.java 2006-05-03 04:31:35 UTC (rev 4056) @@ -36,12 +36,12 @@ if ( this.descrs == Collections.EMPTY_LIST ) { this.descrs = new ArrayList( 1 ); } -//MN: No pattern combining ?? -// if ( patternDescr instanceof ColumnDescr ) { -// addColumn( (ColumnDescr) patternDescr ); -// } else { + + if ( patternDescr instanceof ColumnDescr ) { + addColumn( (ColumnDescr) patternDescr ); + } else { this.descrs.add( patternDescr ); -// } + } } /** Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/lang/RuleParserTest.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/lang/RuleParserTest.java 2006-05-03 04:28:38 UTC (rev 4055) +++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/lang/RuleParserTest.java 2006-05-03 04:31:35 UTC (rev 4056) @@ -388,7 +388,7 @@ /** Note this is only to be enabled if we agree to combine patterns from columns bound to the same var. * At present, not a valid test. Refer to AndDescr and AndDescrTest (Michael Neale). */ - public void XXXtestMultiBindings() throws Exception { + public void testMultiBindings() throws Exception { RuleDescr rule = parseResource( "multiple_bindings.drl" ).rule(); assertNotNull( rule ); assertEquals( "simple_rule", rule.getName() ); Modified: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/eval_rule_test_more.drl =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/eval_rule_test_more.drl 2006-05-03 04:28:38 UTC (rev 4055) +++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/eval_rule_test_more.drl 2006-05-03 04:31:35 UTC (rev 4056) @@ -12,4 +12,13 @@ eval(s.equals("foo") && s.startsWith("f")) then list.add( s ); +end + +rule "yet more" + when + s : String() + eval(s.equals("foo") && s.startsWith("f")) + eval(s.equals("foo") && s.startsWith("q")) + then + list.add( s ); end \ No newline at end of file |
From: <jbo...@li...> - 2006-05-03 01:11:25
|
Author: mar...@jb... Date: 2006-05-02 21:11:16 -0400 (Tue, 02 May 2006) New Revision: 4054 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java Log: -Made it worked with EvalConditionNodes Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java 2006-05-03 01:03:42 UTC (rev 4053) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java 2006-05-03 01:11:16 UTC (rev 4054) @@ -36,7 +36,7 @@ /** * Produces a graph in GraphViz DOT format. * - * @see http://www.research.att.com/sw/tools/graphviz/ + * @see http://www.research.att.com/sw/tools/graphviz/ * @see http://www.pixelglow.com/graphviz/ * * @author Andy Barnett |
From: <jbo...@li...> - 2006-05-03 01:03:55
|
Author: mar...@jb... Date: 2006-05-02 21:03:42 -0400 (Tue, 02 May 2006) New Revision: 4053 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java Log: -Made it worked with EvalConditionNodes Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java 2006-05-02 22:26:33 UTC (rev 4052) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooToJungVisitor.java 2006-05-03 01:03:42 UTC (rev 4053) @@ -315,20 +315,20 @@ } } - static class TestNodeVertex extends BaseNodeVertex { + static class EvalConditionNodeVertex extends BaseNodeVertex { private final EvalConditionNode node; - public TestNodeVertex(EvalConditionNode node) { + public EvalConditionNodeVertex(EvalConditionNode node) { super(); this.node = node; } public String getHtml() { - return "TestNode : " + this.node.getId(); + return "EvalConditionNode : " + this.node.getId(); } public String toString() { - return "TestNode"; + return "EvalConditionNode"; } } |
From: <jbo...@li...> - 2006-05-02 22:26:39
|
Author: KrisVerlaenen Date: 2006-05-02 18:26:33 -0400 (Tue, 02 May 2006) New Revision: 4052 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java Log: Removed system.out Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java 2006-05-02 20:12:03 UTC (rev 4051) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java 2006-05-02 22:26:33 UTC (rev 4052) @@ -18,7 +18,6 @@ public void setActivePage(IEditorPart activeEditor) { IActionBars bars = getActionBars(); - System.out.println(bars); if (activeEditor instanceof ITextEditor) { if (bars != null) { contributor.setActiveEditor(activeEditor); |
Author: noe...@jb... Date: 2006-05-02 16:12:03 -0400 (Tue, 02 May 2006) New Revision: 4051 Removed: labs/reportingservices/trunk/sample/era/test1/test1.jrxml labs/reportingservices/trunk/sample/era/test2/test2_2/test2_2.jrxml Modified: labs/reportingservices/trunk/.classpath labs/reportingservices/trunk/build.xml labs/reportingservices/trunk/lib/apache-commons/lib/commons-collections.jar labs/reportingservices/trunk/lib/apache-commons/lib/commons-httpclient.jar labs/reportingservices/trunk/lib/apache-commons/lib/commons-logging.jar labs/reportingservices/trunk/lib/apache-myfaces/myfaces-impl.jar labs/reportingservices/trunk/lib/jboss-remoting/jboss-remoting.jar labs/reportingservices/trunk/lib/jboss-serialization/jboss-serialization.jar labs/reportingservices/trunk/sample/era/test1.era labs/reportingservices/trunk/sample/era/test1/RotationReport1.jrxml labs/reportingservices/trunk/sample/era/test2.era labs/reportingservices/trunk/sample/era/test2/RotationReport2.jrxml labs/reportingservices/trunk/sample/era/test2/test2_2/RotationReport2_2.jrxml labs/reportingservices/trunk/src/main/org/jboss/reporting/api/ReportTaskFactory.java labs/reportingservices/trunk/src/main/org/jboss/reporting/api/ReportTaskImpl.java labs/reportingservices/trunk/src/main/org/jboss/reporting/api/schedule/Schedule.java labs/reportingservices/trunk/src/main/org/jboss/reporting/api/schedule/ScheduleNow.java labs/reportingservices/trunk/src/main/org/jboss/reporting/api/schedule/ScheduleOnce.java labs/reportingservices/trunk/src/main/org/jboss/reporting/api/schedule/SchedulePeriodic.java labs/reportingservices/trunk/src/main/org/jboss/reporting/server/deployer/DeployerJFXML.java labs/reportingservices/trunk/src/main/org/jboss/reporting/server/deployer/DeployerJRXML.java labs/reportingservices/trunk/src/main/org/jboss/reporting/server/metadata/ReportsMetaData.java labs/reportingservices/trunk/src/main/org/jboss/reporting/server/request/ReportRequestProcessor.java labs/reportingservices/trunk/src/main/org/jboss/reporting/server/scheduler/SchedulerService.java labs/reportingservices/trunk/src/tests/org/jboss/test/reporting/metadata/TestMarshallSchemaless.java labs/reportingservices/trunk/testsuite/build.xml Log: update jboss-4.0.4 and jasperreports-1.2.1 Modified: labs/reportingservices/trunk/.classpath =================================================================== --- labs/reportingservices/trunk/.classpath 2006-05-02 20:04:28 UTC (rev 4050) +++ labs/reportingservices/trunk/.classpath 2006-05-02 20:12:03 UTC (rev 4051) @@ -3,12 +3,6 @@ <classpathentry kind="src" path="src/main"/> <classpathentry kind="src" path="src/tests"/> <classpathentry kind="src" path="output/gen-src"/> - <classpathentry kind="src" path="/jmx"/> - <classpathentry kind="src" path="/common"/> - <classpathentry kind="src" path="/j2ee"/> - <classpathentry kind="src" path="/system"/> - <classpathentry kind="src" path="/server"/> - <classpathentry kind="src" path="/transaction"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-beanutils.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-codec-1.2.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-collections.jar"/> @@ -18,7 +12,6 @@ <classpathentry kind="lib" path="lib/apache-commons/lib/commons-httpclient.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-lang-1.0.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-logging.jar"/> - <classpathentry kind="lib" path="lib/apache-commons/lib/commons-logging-api.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-pool.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-validator-1.1.3.jar"/> <classpathentry kind="lib" path="lib/apache-commons/lib/commons-vfs.jar"/> @@ -26,7 +19,6 @@ <classpathentry kind="lib" path="lib/apache-myfaces/myfaces.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-extensions.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-impl.jar"/> - <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-jsf-api.jar"/> <classpathentry kind="lib" path="lib/jasperreports/jasperreports-0.6.8.jar"/> <classpathentry kind="lib" path="lib/jboss/javax.servlet.jar"/> <classpathentry kind="lib" path="lib/jboss-remoting/jboss-remoting.jar"/> @@ -38,10 +30,8 @@ <classpathentry kind="lib" path="lib/jboss/jboss.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss-common.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss-j2ee.jar"/> - <classpathentry kind="lib" path="lib/jboss/jboss-j2se.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss-jmx.jar"/> - <classpathentry kind="lib" path="lib/jboss/jboss-system.jar"/> - <classpathentry kind="lib" path="lib/jboss/jmx-adaptor-plugin.jar"/> + <classpathentry sourcepath="C:/__DGI__/impact_migration/jboss-4.0.4.CR2-src" kind="lib" path="lib/jboss/jboss-system.jar"/> <classpathentry kind="lib" path="lib/jboss/jnpserver.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-bea-module-jb4.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-ejb-module-jb4.jar"/> @@ -63,5 +53,12 @@ <classpathentry kind="lib" path="lib/jfreereport/pixie-0.8.4.jar"/> <classpathentry kind="lib" path="lib/jfreereport/poi-2.5.1-final-20040804.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-api.jar"/> + <classpathentry kind="lib" path="lib/jasperreports/itext-1.01.jar"/> + <classpathentry kind="lib" path="lib/jboss/jboss-xml-binding.jar"/> + <classpathentry kind="lib" path="lib/jboss/jmx-client.jar"/> + <classpathentry kind="lib" path="lib/jboss/jmx-invoker-adaptor-client.jar"/> + <classpathentry kind="lib" path="lib/apache-log4j/log4j.jar"/> + <classpathentry kind="lib" path="lib/jasperreports/jasperreports-1.2.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: labs/reportingservices/trunk/build.xml =================================================================== --- labs/reportingservices/trunk/build.xml 2006-05-02 20:04:28 UTC (rev 4050) +++ labs/reportingservices/trunk/build.xml 2006-05-02 20:12:03 UTC (rev 4051) @@ -11,34 +11,11 @@ <project default="most" name="ReportingServices"> - <!-- ================================================================== --> - <!-- Properties --> - <!-- ================================================================== --> - <property environment="env"/> - <!-- deploy dir from JBoss AS install --> - <property name="jboss.server" value="default"/> - <property name="jboss.dir" value="${env.JBOSS_HOME}"/> - <property name="jboss.conf.dir" value="${jboss.dir}/server/${jboss.server}" /> - <property name="jboss.deploy.dir" value="${jboss.conf.dir}/deploy" /> - <!-- ================================================================== --> <!-- Configuration --> <!-- ================================================================== --> - <target name="verify-env"> - - <!-- JBOSS_HOME --> - <condition property="jbosshome.available" value="true"> - <and> - <isset property="env.JBOSS_HOME"/> - <available file="${env.JBOSS_HOME}/server/${jboss.server}/deploy" type="dir"/> - </and> - </condition> - <fail unless="jbosshome.available" message="JBOSS_HOME property must be set"/> - <!-- /JBOSS_HOME --> - - </target> - <target name="configure" unless="configure.disable" depends="verify-env"> + <target name="configure" unless="configure.disable"> <!-- Module name(s) & version --> <property name="module.name" value="reporting"/> @@ -70,6 +47,11 @@ <property name="tests.src.dir" value="${tests.dir}"/> <property name="tests.compile.dir" value="${output.dir}/tests/classes"/> + <!-- deploy dir from JBoss AS install --> + <property name="jboss.dir" value="../jboss" /> + <property name="jboss.conf.dir" value="${jboss.dir}/server/default" /> + <property name="jboss.deploy.dir" value="${jboss.conf.dir}/deploy" /> + <!-- The combined library classpath --> <path id="library.classpath"> <pathelement location="${compile.dir}"/> @@ -194,11 +176,28 @@ <!-- FIXME: lib should be build upon the project lib and dhouldn't exist in src.webapp --> - <copy todir="${output.dir}/webapp"> - <fileset dir="${src.webapp.dir}"> - <include name="**/*"/> - </fileset> +<!-- <copy todir="${output.dir}/webapp"> + <fileset dir="${src.webapp.dir}"> + <include name="**/*"/> + </fileset> </copy> + <copy todir="${output.dir}/webapp/WEB-INF/lib"> + <fileset dir="${lib.dir}/apache-myfaces"> + <include name="*.jar"/> + </fileset> + </copy> + <copy todir="${output.dir}/webapp/WEB-INF/lib"> + <fileset dir="${lib.dir}/apache-commons/lib"> + <include name="commons-digester*.jar"/> + <include name="commons-collections.jar"/> + <include name="commons-beanutils.jar"/> + <include name="commons-el.jar"/> + <include name="commons-fileupload.jar"/> + <include name="commons-codec-1.2.jar"/> + <include name="commons-validator-1.1.3.jar"/> + </fileset> + </copy> + <mkdir dir="${output.dir}/webapp/WEB-INF/classes" /> <copy todir="${output.dir}/webapp/WEB-INF/classes"> <fileset dir="${compile.dir}"> @@ -214,7 +213,7 @@ <exclude name="WEB-INF/web.xml"/> </fileset> </war> - +--> <!-- Build reporting-services.sar --> <mkdir dir="${output.lib.dir}/reporting-services.sar"/> <copy todir="${output.lib.dir}/reporting-services.sar" filtering="no" overwrite="true"> @@ -230,6 +229,7 @@ <include name="commons-digester*.jar"/> <include name="commons-collections.jar"/> <include name="commons-beanutils.jar"/> + <!--include name="commons-el.jar"/--> <include name="commons-fileupload.jar"/> <include name="commons-codec-1.2.jar"/> <include name="commons-validator-1.1.3.jar"/> @@ -242,7 +242,6 @@ </fileset> <fileset dir="${lib.dir}/jasperreports"> <include name="*.jar"/> - <exclude name="itext*.jar"/> </fileset> <fileset dir="${lib.dir}/jfreereport"> <include name="*.jar"/> Modified: labs/reportingservices/trunk/lib/apache-commons/lib/commons-collections.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/lib/apache-commons/lib/commons-httpclient.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/lib/apache-commons/lib/commons-logging.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/lib/apache-myfaces/myfaces-impl.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/lib/jboss-remoting/jboss-remoting.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/lib/jboss-serialization/jboss-serialization.jar =================================================================== (Binary files differ) Modified: labs/reportingservices/trunk/sample/era/test1/RotationReport1.jrxml =================================================================== --- labs/reportingservices/trunk/sample/era/test1/RotationReport1.jrxml 2006-05-02 20:04:28 UTC (rev 4050) +++ labs/reportingservices/trunk/sample/era/test1/RotationReport1.jrxml 2006-05-02 20:12:03 UTC (rev 4051) @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Created using JasperAssistant (http://www.jasperassistant.com) --> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="RotationReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30"> Deleted: labs/reportingservices/trunk/sample/era/test1/test1.jrxml =================================================================== --- labs/reportingservices/trunk/sample/era/test1/test1.jrxml 2006-05-02 20:04:28 UTC (rev 4050) +++ labs/reportingservices/trunk/sample/era/test1/test1.jrxml 2006-05-02 20:12:03 UTC (rev 4051) @@ -1,1266 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- Created with iReport - A designer for JasperReports --> -<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> -<jasperReport - name="JBossTest" - columnCount="1" - printOrder="Vertical" - orientation="Portrait" - pageWidth="595" - pageHeight="842" - columnWidth="535" - columnSpacing="0" - leftMargin="30" - rightMargin="30" - topMargin="20" - bottomMargin="20" - whenNoDataType="NoPages" - isTitleNewPage="false" - isSummaryNewPage="false"> - <property name="ireport.scriptlethandling" value="2" /> - <queryString><![CDATA[select * from spip_auteurs]]></queryString> - <field name="id_auteur" class="java.lang.Long"/> - <field name="nom" class="java.lang.String"/> - <field name="bio" class="java.lang.String"/> - <field name="email" class="java.lang.String"/> - <field name="nom_site" class="java.lang.String"/> - <field name="url_site" class="java.lang.String"/> - <field name="login" class="java.lang.String"/> - <field name="pass" class="java.lang.String"/> - <field name="low_sec" class="java.lang.String"/> - <field name="statut" class="java.lang.String"/> - <field name="maj" class="java.sql.Timestamp"/> - <field name="pgp" class="java.lang.String"/> - <field name="htpass" class="java.lang.String"/> - <field name="en_ligne" class="java.sql.Timestamp"/> - <field name="imessage" class="java.lang.String"/> - <field name="messagerie" class="java.lang.String"/> - <field name="alea_actuel" class="java.lang.String"/> - <field name="alea_futur" class="java.lang.String"/> - <field name="prefs" class="java.lang.String"/> - <field name="cookie_oubli" class="java.lang.String"/> - <field name="source" class="java.lang.String"/> - <field name="lang" class="java.lang.String"/> - <field name="extra" class="java.lang.String"/> - <field name="idx" class="java.lang.String"/> - <variable name="test" class="java.lang.String" resetType="None" calculation="Nothing"> - <variableExpression><![CDATA["test"]]></variableExpression> - <initialValueExpression><![CDATA["test"]]></initialValueExpression> - </variable> - <group name="nom" isStartNewColumn="false" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" > - <groupExpression><![CDATA[$F{nom}]]></groupExpression> - <groupHeader> - <band height="25" isSplitAllowed="true" > - <rectangle radius="0" > - <reportElement - mode="Opaque" - x="0" - y="0" - width="535" - height="25" - forecolor="#8080FF" - backcolor="#000000" - key="rectangle" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <graphicElement stretchType="NoStretch" pen="None" fill="Solid" /> - </rectangle> - <staticText> - <reportElement - mode="Transparent" - x="3" - y="2" - width="96" - height="23" - forecolor="#FFFFFF" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="Times-Roman" pdfFontName="Times-Roman" size="16" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[nom]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="102" - y="2" - width="98" - height="23" - forecolor="#FFFFFF" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="Times-Roman" pdfFontName="Times-Roman" size="20" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{nom}]]></textFieldExpression> - </textField> - </band> - </groupHeader> - <groupFooter> - <band height="10" isSplitAllowed="true" > - <line direction="BottomUp"> - <reportElement - mode="Opaque" - x="1" - y="4" - width="534" - height="0" - forecolor="#000000" - backcolor="#FFFFFF" - key="line" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <graphicElement stretchType="NoStretch" pen="Thin" fill="Solid" /> - </line> - </band> - </groupFooter> - </group> - <background> - <band height="0" isSplitAllowed="true" > - </band> - </background> - <title> - <band height="50" isSplitAllowed="true" > - <staticText> - <reportElement - mode="Transparent" - x="61" - y="5" - width="412" - height="40" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="Times New Roman" pdfFontName="Times-Roman" size="30" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[Classic Report Template]]></text> - </staticText> - <line direction="TopDown"> - <reportElement - mode="Opaque" - x="0" - y="48" - width="534" - height="0" - forecolor="#000000" - backcolor="#FFFFFF" - key="line" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /> - </line> - <line direction="TopDown"> - <reportElement - mode="Opaque" - x="0" - y="3" - width="534" - height="0" - forecolor="#000000" - backcolor="#FFFFFF" - key="line" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /> - </line> - </band> - </title> - <pageHeader> - <band height="10" isSplitAllowed="true" > - </band> - </pageHeader> - <columnHeader> - <band height="0" isSplitAllowed="true" > - <line direction="BottomUp"> - <reportElement - mode="Opaque" - x="0" - y="0" - width="535" - height="0" - forecolor="#000000" - backcolor="#FFFFFF" - key="line" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <graphicElement stretchType="NoStretch" pen="Thin" fill="Solid" /> - </line> - </band> - </columnHeader> - <detail> - <band height="449" isSplitAllowed="true" > - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="2" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.Long"><![CDATA[$F{id_auteur}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="2" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[id_auteur]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="21" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{bio}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="21" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[bio]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="40" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{email}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="40" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[email]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="59" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{nom_site}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="59" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[nom_site]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="78" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{url_site}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="78" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[url_site]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="97" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{login}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="97" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[login]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="116" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{pass}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="116" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[pass]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="135" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{low_sec}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="135" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[low_sec]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="154" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{statut}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="154" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[statut]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="173" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{maj}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="173" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[maj]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="192" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{pgp}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="192" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[pgp]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="211" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{htpass}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="211" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[htpass]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="230" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{en_ligne}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="230" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[en_ligne]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="249" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{imessage}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="249" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[imessage]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="268" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{messagerie}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="268" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[messagerie]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="287" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{alea_actuel}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="287" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[alea_actuel]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="306" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{alea_futur}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="306" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[alea_futur]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="325" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{prefs}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="325" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[prefs]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="344" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{cookie_oubli}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="344" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[cookie_oubli]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="363" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{source}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="363" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[source]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="382" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{lang}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="382" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[lang]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="401" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{extra}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="401" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> - </textElement> - <text><![CDATA[extra]]></text> - </staticText> - <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement - mode="Transparent" - x="127" - y="420" - width="398" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="textField" - stretchType="NoStretch" - positionType="FixRelativeToTop" - isPrintRepeatedValues="true" - isRemoveLineWhenBlank="false" - isPrintInFirstWholeBand="false" - isPrintWhenDetailOverflows="false"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> - <font fontName="" pdfFontName="Helvetica" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> - </textElement> - <textFieldExpression class="java.lang.String"><![CDATA[$F{idx}]]></textFieldExpression> - </textField> - <staticText> - <reportElement - mode="Transparent" - x="0" - y="420" - width="23" - height="17" - forecolor="#000000" - backcolor="#FFFFFF" - key="staticText" - stretchType="NoStretch" - positionType="Float" - isPrintRepeatedValues="true" - isRe... [truncated message content] |
From: <jbo...@li...> - 2006-05-02 19:17:53
|
Author: mar...@jb... Date: 2006-05-02 15:17:43 -0400 (Tue, 02 May 2006) New Revision: 4049 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java Log: -Reverted PackageBulider as previous older code had been recommitted. Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2006-05-02 18:10:26 UTC (rev 4048) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2006-05-02 19:17:43 UTC (rev 4049) @@ -1,4 +1,5 @@ package org.drools.compiler; + /* * Copyright 2005 JBoss Inc * @@ -15,11 +16,10 @@ * limitations under the License. */ - - import java.io.IOException; import java.io.Reader; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -27,8 +27,8 @@ import org.apache.commons.jci.compilers.CompilationResult; import org.apache.commons.jci.compilers.JavaCompiler; import org.apache.commons.jci.compilers.JavaCompilerFactory; +import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.readers.MemoryResourceReader; -import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.drools.lang.descr.FunctionDescr; import org.drools.lang.descr.PackageDescr; @@ -45,15 +45,15 @@ import org.xml.sax.SAXException; public class PackageBuilder { - private JavaCompiler compiler; + private JavaCompiler compiler; - private Package pkg; + private Package pkg; - private List results; + private List results; - private PackageStore packageStoreWrapper; + private PackageStore packageStoreWrapper; - private MemoryResourceReader src; + private MemoryResourceReader src; private PackageBuilderConfiguration configuration; @@ -72,21 +72,20 @@ if ( configuration == null ) { configuration = new PackageBuilderConfiguration(); } - - this.compiler = JavaCompilerFactory.getInstance().createCompiler( configuration.getCompiler() ); - - this.configuration = configuration; - + + this.compiler = getCompiler( configuration.getCompiler() ); + + this.configuration = configuration; + this.src = new MemoryResourceReader(); this.results = new ArrayList(); this.pkg = pkg; - if ( pkg != null ) { this.packageStoreWrapper = new PackageStore( pkg.getPackageCompilationData() ); - } + } } /** @@ -95,20 +94,22 @@ * @throws DroolsParserException * @throws IOException */ - public void addPackageFromDrl(Reader reader) throws DroolsParserException, IOException { + public void addPackageFromDrl(Reader reader) throws DroolsParserException, + IOException { DrlParser parser = new DrlParser(); PackageDescr pkg = parser.parse( reader ); this.results.addAll( parser.getErrors() ); addPackage( pkg ); } - + /** * Load a rule package from XML source. * @param reader * @throws DroolsParserException * @throws IOException */ - public void addPackageFromXml(Reader reader) throws DroolsParserException, IOException { + public void addPackageFromXml(Reader reader) throws DroolsParserException, + IOException { XmlPackageReader xmlReader = new XmlPackageReader(); try { @@ -118,7 +119,7 @@ } addPackage( xmlReader.getPackageDescr() ); - } + } /** * Load a rule package from DRL source using the supplied DSL configuration. @@ -128,20 +129,22 @@ * @throws IOException */ public void addPackageFromDrl(Reader source, - Reader dsl) throws DroolsParserException, IOException { + Reader dsl) throws DroolsParserException, + IOException { DrlParser parser = new DrlParser(); - PackageDescr pkg = parser.parse( source, dsl ); + PackageDescr pkg = parser.parse( source, + dsl ); this.results.addAll( parser.getErrors() ); addPackage( pkg ); - } - + } + public void addPackage(PackageDescr packageDescr) { - if (packageDescr.getName() == null || "".equals(packageDescr.getName())) { - - throw new MissingPackageNameException("Missing package name for rule package."); + if ( packageDescr.getName() == null || "".equals( packageDescr.getName() ) ) { + + throw new MissingPackageNameException( "Missing package name for rule package." ); } - + if ( this.pkg != null ) { //mergePackage( packageDescr ) ; mergePackage( this.pkg, @@ -192,7 +195,7 @@ try { clazz = typeResolver.resolveType( className ); pkg.addGlobal( identifier, - clazz ); + clazz ); } catch ( ClassNotFoundException e ) { new GlobalError( identifier ); } @@ -203,9 +206,9 @@ String text, MemoryResourceReader src, ResourceStore dst) { - src.addFile( className.replace( '.', - '/' ) + ".java", - text.toCharArray() ); + src.add( className.replace( '.', + '/' ) + ".java", + text.getBytes() ); CompilationResult result = compiler.compile( new String[]{className}, src, dst, @@ -217,15 +220,16 @@ private void addFunction(FunctionDescr functionDescr) { FunctionBuilder buidler = new FunctionBuilder(); CompilationResult result = compile( this.pkg.getName() + "." + ucFirst( functionDescr.getName() ), - buidler.build( this.pkg, functionDescr ), + buidler.build( this.pkg, + functionDescr ), src, this.packageStoreWrapper ); - + if ( result.getErrors().length > 0 ) { this.results.add( new FunctionError( functionDescr, result.getErrors(), "Function Compilation error" ) ); - } + } } private void addRule(RuleDescr ruleDescr) { @@ -247,16 +251,17 @@ // Check if there is any code to compile. If so compile it. if ( builder.getRuleClass() != null ) { - compileRule( builder, - rule, + compileRule( builder, + rule, ruleDescr ); } - this.pkg.addRule( rule ); } - - public void compileRule(RuleBuilder builder, Rule rule, RuleDescr ruleDescr) { + + public void compileRule(RuleBuilder builder, + Rule rule, + RuleDescr ruleDescr) { // The compilation result is for th entire rule, so difficult to associate with any descr CompilationResult result = compile( this.pkg.getName() + "." + ruleDescr.getClassName(), builder.getRuleClass(), @@ -269,10 +274,10 @@ result.getErrors(), "Rule Compilation error" ) ); } else { - + for ( Iterator it = builder.getInvokers().keySet().iterator(); it.hasNext(); ) { String className = (String) it.next(); - + // Check if an invoker - returnvalue, predicate, eval or consequence has been associated // If so we add it to the PackageCompilationData as it will get wired up on compilation Object invoker = builder.getInvokerLookups().get( className ); @@ -281,14 +286,14 @@ invoker ); } String text = (String) builder.getInvokers().get( className ); - + //System.out.println( className + ":\n" + text ); - + result = compile( className, text, src, this.packageStoreWrapper ); - + if ( result.getErrors().length > 0 ) { PatternDescr descr = (PatternDescr) builder.getDescrLookups().get( className ); this.results.add( new RuleError( rule, @@ -296,8 +301,8 @@ result.getErrors(), "Rule Compilation error for Invoker" ) ); } - } - } + } + } } /** @@ -308,7 +313,7 @@ * Compiled packages are serializable. */ public Package getPackage() { - if (hasErrors()) { + if ( hasErrors() ) { this.pkg.setError( this.printErrors() ); } return this.pkg; @@ -334,12 +339,12 @@ StringBuffer buf = new StringBuffer(); for ( Iterator iter = this.results.iterator(); iter.hasNext(); ) { DroolsError err = (DroolsError) iter.next(); - buf.append(err.getMessage()); + buf.append( err.getMessage() ); buf.append( "\n" ); } return buf.toString(); } - + /** * Takes a given name and makes sure that its legal and doesn't already exist. If the file exists it increases counter appender untill it is unique. * @@ -353,7 +358,8 @@ String ext, ResourceReader src) { // replaces all non alphanumeric or $ chars with _ - String newName = "Rule_" + name.replaceAll( "[^\\w$]", "_" ); + String newName = "Rule_" + name.replaceAll( "[^\\w$]", + "_" ); // make sure the class name does not exist, if it does increase the counter int counter = -1; @@ -374,6 +380,16 @@ return newName; } + private JavaCompiler getCompiler(int compiler) { + switch ( compiler ) { + case PackageBuilderConfiguration.JANINO : + return JavaCompilerFactory.getInstance().createCompiler( "janino" ); + case PackageBuilderConfiguration.ECLIPSE : + default : + return JavaCompilerFactory.getInstance().createCompiler( "eclipse" ); + } + } + private String ucFirst(String name) { return name.toUpperCase().charAt( 0 ) + name.substring( 1 ); } @@ -381,9 +397,8 @@ public static class MissingPackageNameException extends IllegalArgumentException { public MissingPackageNameException(String message) { - super(message); + super( message ); } - + } - } \ No newline at end of file |
Author: dam...@jb... Date: 2006-05-02 14:07:46 -0400 (Tue, 02 May 2006) New Revision: 4047 Added: labs/shotoku/branches/qa/lib/taglibs/ labs/shotoku/branches/qa/lib/taglibs/jars/ labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar labs/shotoku/branches/qa/shotoku-admin/ labs/shotoku/branches/qa/shotoku-admin/maven.xml labs/shotoku/branches/qa/shotoku-admin/project.properties labs/shotoku/branches/qa/shotoku-admin/project.xml labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml labs/shotoku/branches/qa/shotoku-admin/src/ labs/shotoku/branches/qa/shotoku-admin/src/java/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java labs/shotoku/branches/qa/shotoku-admin/src/web/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedService.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedServiceGetter.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/AdministratedServiceImpl.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/DomToXmlTransformer.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/PropertiesElementValue.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/PropertiesMap.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/XmlTools.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/FilesFromRepoFilter.java labs/shotoku/branches/qa/shotoku-feeds/ labs/shotoku/branches/qa/shotoku-feeds/forge-feeds.iml labs/shotoku/branches/qa/shotoku-feeds/lib/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar labs/shotoku/branches/qa/shotoku-feeds/maven.xml labs/shotoku/branches/qa/shotoku-feeds/project.properties labs/shotoku/branches/qa/shotoku-feeds/project.xml labs/shotoku/branches/qa/shotoku-feeds/src/ labs/shotoku/branches/qa/shotoku-feeds/src/java/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/AtomFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedFactory.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FileBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/InformaBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfDateFormat.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RomeBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Rss2Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/TextEscaping.java labs/shotoku/branches/qa/shotoku-feeds/src/web/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/feeds-object.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-app.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/portlet.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/forge.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/portlet.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-web/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/src/app/META-INF/login-config.xml Removed: labs/shotoku/branches/qa/lib/taglibs/jars/ labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar labs/shotoku/branches/qa/shotoku-admin/maven.xml labs/shotoku/branches/qa/shotoku-admin/project.properties labs/shotoku/branches/qa/shotoku-admin/project.xml labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml labs/shotoku/branches/qa/shotoku-admin/src/ labs/shotoku/branches/qa/shotoku-admin/src/java/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java labs/shotoku/branches/qa/shotoku-admin/src/web/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/web/FilesFromRepoFilter.java labs/shotoku/branches/qa/shotoku-feeds/forge-feeds.iml labs/shotoku/branches/qa/shotoku-feeds/lib/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/ labs/shotoku/branches/qa/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar labs/shotoku/branches/qa/shotoku-feeds/maven.xml labs/shotoku/branches/qa/shotoku-feeds/project.properties labs/shotoku/branches/qa/shotoku-feeds/project.xml labs/shotoku/branches/qa/shotoku-feeds/src/ labs/shotoku/branches/qa/shotoku-feeds/src/java/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/ labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/AtomFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedFactory.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FileBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/InformaBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfDateFormat.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RdfFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/RomeBasedFeed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Rss2Feed.java labs/shotoku/branches/qa/shotoku-feeds/src/java/org/jboss/shotoku/feeds/TextEscaping.java labs/shotoku/branches/qa/shotoku-feeds/src/web/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/feeds-object.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-app.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/jboss-web.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/portlet.xml labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/ labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/forge.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/tld/portlet.tld labs/shotoku/branches/qa/shotoku-feeds/src/web/WEB-INF/web.xml labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/test/ Modified: labs/shotoku/branches/qa/project.properties labs/shotoku/branches/qa/shotoku-base/project.xml labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuService.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceLocal.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceLocal.java labs/shotoku/branches/qa/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java labs/shotoku/branches/qa/shotoku-web/shotoku-web.iml labs/shotoku/branches/qa/shotoku-web/src/web/WEB-INF/web.xml Log: MERGED: -r 3696:4046 https://svn.labs.jboss.com/labs/shotoku/trunk into qa for 1.1 continued testing. Copied: labs/shotoku/branches/qa/lib/taglibs (from rev 4046, labs/shotoku/trunk/lib/taglibs) Copied: labs/shotoku/branches/qa/lib/taglibs/jars (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars) Deleted: labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar =================================================================== (Binary files differ) Copied: labs/shotoku/branches/qa/lib/taglibs/jars/jstl.jar (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars/jstl.jar) Deleted: labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar =================================================================== (Binary files differ) Copied: labs/shotoku/branches/qa/lib/taglibs/jars/standard.jar (from rev 4046, labs/shotoku/trunk/lib/taglibs/jars/standard.jar) Modified: labs/shotoku/branches/qa/project.properties =================================================================== --- labs/shotoku/branches/qa/project.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/project.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -5,7 +5,7 @@ shotoku.sar.dir=shotoku.sar shotoku.subprojects.cms=base,files,jcr,svn -shotoku.subprojects=${shotoku.subprojects.cms},aop,test,web,portal +shotoku.subprojects=${shotoku.subprojects.cms},aop,test,web,portal,admin maven.final.name=${pom.artifactId} @@ -23,5 +23,8 @@ maven.jar.jboss-system=${shotoku.root.dir}lib/jboss/jars/jboss-system.jar maven.jar.jboss-common=${shotoku.root.dir}lib/jboss/jars/jboss-common.jar +maven.jar.standard=${shotoku.root.dir}lib/taglibs/jars/standard.jar +maven.jar.jstl=${shotoku.root.dir}lib/taglibs/jars/jstl.jar + maven.jar.shotoku-base=${shotoku.root.dir}shotoku-base/target/shotoku-base.jar maven.jar.shotoku-aop=${shotoku.root.dir}shotoku-aop/target/shotoku-aop.jar Copied: labs/shotoku/branches/qa/shotoku-admin (from rev 4046, labs/shotoku/trunk/shotoku-admin) Property changes on: labs/shotoku/branches/qa/shotoku-admin ___________________________________________________________________ Name: svn:ignore + target Deleted: labs/shotoku/branches/qa/shotoku-admin/maven.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/maven.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/maven.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,22 +0,0 @@ -<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> - <goal name="build"> - <attainGoal name="war" /> - </goal> - - <goal name="deploy"> - <ant:copy - file="target/shotoku-admin.war" - todir="${local.deploy.dir}" /> - </goal> - - <goal name="clean"> - <attainGoal name="prj-clean" /> - </goal> - - <!-- TODO remove --> - <goal name="all"> - <attainGoal name="clean" /> - <attainGoal name="build" /> - <attainGoal name="deploy" /> - </goal> -</project> Copied: labs/shotoku/branches/qa/shotoku-admin/maven.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/maven.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/project.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/project.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/project.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,4 +0,0 @@ -maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ - -maven.final.name=${pom.artifactId} - Copied: labs/shotoku/branches/qa/shotoku-admin/project.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/project.properties) Deleted: labs/shotoku/branches/qa/shotoku-admin/project.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/project.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/project.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,59 +0,0 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> -<project> - <pomVersion>3</pomVersion> - <extend>../project.xml</extend> - <id>shotoku-admin</id> - <name>Shotoku admin</name> - - <dependencies> - <dependency> - <groupId>shotoku</groupId> - <artifactId>shotoku-base</artifactId> - <jar>shotoku-base.jar</jar> - </dependency> - - <dependency> - <groupId>jboss</groupId> - <artifactId>javax.servlet</artifactId> - <version>1.0</version> - <jar>javax.servlet.jar</jar> - </dependency> - - <dependency> - <groupId>aslibs</groupId> - <artifactId>javax.servlet.jsp</artifactId> - <version>1.0</version> - <jar>javax.servlet.jsp.jar</jar> - </dependency> - - <dependency> - <groupId>taglibs</groupId> - <artifactId>jstl</artifactId> - <version>1.0</version> - <jar>jstl.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> - </dependency> - - <dependency> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - <version>1.0</version> - <jar>standard.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> - </dependency> - </dependencies> - - <build> - <sourceDirectory>src/java</sourceDirectory> - <resources> - <resource> - <directory>src/etc</directory> - <include>**/*</include> - </resource> - </resources> - </build> -</project> Copied: labs/shotoku/branches/qa/shotoku-admin/project.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/project.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml =================================================================== --- labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager"> - <output url="file://$MODULE_DIR$/target" /> - <exclude-output /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module" module-name="shotoku-base" /> - <orderEntry type="library" name="jsf" level="application" /> - <orderEntry type="library" name="jboss" level="application" /> - <orderEntryProperties /> - </component> -</module> - Copied: labs/shotoku/branches/qa/shotoku-admin/shotoku-admin.iml (from rev 4046, labs/shotoku/trunk/shotoku-admin/shotoku-admin.iml) Copied: labs/shotoku/branches/qa/shotoku-admin/src (from rev 4046, labs/shotoku/trunk/shotoku-admin/src) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web) Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,84 +0,0 @@ -package org.jboss.shotoku.web.admin; - -import org.jboss.shotoku.service.AdministratedServiceGetter; -import org.jboss.shotoku.service.AdministratedService; -import org.jboss.shotoku.tools.Tools; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletException; -import javax.servlet.ServletResponse; -import java.io.IOException; -import java.util.Calendar; -import java.util.Set; - -/** - * @author Adam Warski (ad...@as...) - */ -public class AdminServlet extends HttpServlet { - public static final String SERVICE_JSP = "/repo-access/services.jsp"; - - private AdministratedService getServiceWithId(String serviceId, - Set<AdministratedServiceGetter> asgs) { - for (AdministratedServiceGetter asg : asgs) { - AdministratedService as = asg.getService(); - if (as.getServiceId().equals(serviceId)) { - return as; - } - } - - return null; - } - - protected void service(HttpServletRequest request, - HttpServletResponse response) - throws ServletException, IOException { - Set<AdministratedServiceGetter> asgs = Tools.getService().getAdministratedServices(); - - String action = request.getParameter("action"); - String serviceId = request.getParameter("serviceId"); - - if ("stop".equals(action)) { - AdministratedService as = getServiceWithId(serviceId, asgs); - if (as != null) { - if (!as.getServiceRunnable()) { - request.setAttribute("status", "Service " + as.getServiceName() + - " is already stopped."); - } else { - as.stop(); - request.setAttribute("status", "Service " + as.getServiceName() + " stopped."); - } - } else { - request.setAttribute("status", "Service with id " + serviceId + " not found."); - } - } - - if ("start".equals(action)) { - AdministratedService as = getServiceWithId(serviceId, asgs); - if (as != null) { - if (as.getServiceRunnable()) { - request.setAttribute("status", "Service " + as.getServiceName() + - " is already started."); - } else { - try { - as.start(); - request.setAttribute("status", "Service " + as.getServiceName() + " started."); - } catch (Exception e) { - request.setAttribute("status", "Starting of service " + as.getServiceName() + - " caused an exception: " + e + ". Look in the log for details."); - e.printStackTrace(); - } - } - } else { - request.setAttribute("status", "Service with id " + serviceId + " not found."); - } - } - - response.setContentType("text/html"); - request.setAttribute("now", Calendar.getInstance().getTimeInMillis()); - request.setAttribute("asgs", asgs); - - request.getRequestDispatcher(SERVICE_JSP).forward(request, response); - } -} Copied: labs/shotoku/branches/qa/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/java/org/jboss/shotoku/web/admin/AdminServlet.java) Copied: labs/shotoku/branches/qa/shotoku-admin/src/web (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web) Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/jboss-web.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,9 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> - -<!DOCTYPE jboss-web - PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" - "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> - -<jboss-web> - <security-domain>java:/jaas/shotoku</security-domain> -</jboss-web> Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/jboss-web.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/jboss-web.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -1,54 +0,0 @@ -<?xml version="1.0"?> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee - http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> - <filter> - <filter-name>filesFromRepoFilter</filter-name> - <filter-class>org.jboss.shotoku.web.FilesFromRepoFilter</filter-class> - <init-param> - <param-name>repoAccessDir</param-name> - <param-value>repo-access</param-value> - </init-param> - <init-param> - <param-name>contentManagerPrefix</param-name> - <param-value>shotoku-admin</param-value> - </init-param> - </filter> - - <filter-mapping> - <filter-name>filesFromRepoFilter</filter-name> - <url-pattern>/repo-access/*</url-pattern> - <dispatcher>INCLUDE</dispatcher> - <dispatcher>FORWARD</dispatcher> - </filter-mapping> - - <servlet> - <servlet-name>Admin Servlet</servlet-name> - <servlet-class>org.jboss.shotoku.web.admin.AdminServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>Admin Servlet</servlet-name> - <url-pattern>/admin/*</url-pattern> - </servlet-mapping> - - <security-constraint> - <web-resource-collection> - <web-resource-name>All resources</web-resource-name> - <url-pattern>/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>ShotokuAdmin</role-name> - </auth-constraint> - </security-constraint> - - <security-role> - <role-name>ShotokuAdmin</role-name> - </security-role> - - <login-config> - <auth-method>BASIC</auth-method> - </login-config> -</web-app> Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/WEB-INF/web.xml (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/WEB-INF/web.xml) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/roles.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1 +0,0 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/roles.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/roles.properties) Deleted: labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties =================================================================== --- labs/shotoku/trunk/shotoku-admin/src/web/users.properties 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties 2006-05-02 18:07:46 UTC (rev 4047) @@ -1 +0,0 @@ -ShotokuAdmin=ShotokuAdmin \ No newline at end of file Copied: labs/shotoku/branches/qa/shotoku-admin/src/web/users.properties (from rev 4046, labs/shotoku/trunk/shotoku-admin/src/web/users.properties) Modified: labs/shotoku/branches/qa/shotoku-base/project.xml =================================================================== --- labs/shotoku/branches/qa/shotoku-base/project.xml 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-base/project.xml 2006-05-02 18:07:46 UTC (rev 4047) @@ -5,6 +5,22 @@ <id>shotoku-base</id> <name>Shotoku base</name> +<dependencies> + <dependency> + <groupId>jboss</groupId> + <artifactId>javax.servlet</artifactId> + <version>1.0</version> + <jar>javax.servlet.jar</jar> + </dependency> + + <dependency> + <groupId>aslibs</groupId> + <artifactId>javax.servlet.jsp</artifactId> + <version>1.0</version> + <jar>javax.servlet.jsp.jar</jar> + </dependency> +</dependencies> + <build> <sourceDirectory>src/java</sourceDirectory> <resources> Modified: labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2006-05-02 18:05:13 UTC (rev 4046) +++ labs/shotoku/branches/qa/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2006-05-02 18:07:46 UTC (rev 4047) @@ -23,13 +23,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.PropertiesConfiguration; @@ -53,674 +47,756 @@ * @author Damon Sicore (da...@si...) */ public abstract class ContentManager { - /** - * Prefix of this content manager. - */ - private String prefix; + /** + * Prefix of this content manager. + */ + private String prefix; - /** - * Id of a corresponding repository. - */ - private String id; + /** + * Id of a corresponding repository. + */ + private String id; - /** - * A map of initialized velocity engines, The key is a string representation - * of parameters with which an engine was initialized. - */ - private static Map<String, VelocityEngine> engines; + /** + * A map of initialized velocity engines, The key is a string representation + * of parameters with which an engine was initialized. + */ + private static Map<String, VelocityEngine> engines; - /** - * Gets a root directory that is represented by this content manager. - * - * @return A directory that is the root directory of this content manager. - * @throws RepositoryException - */ - public abstract Directory getRootDirectory() throws RepositoryException; + /** + * Gets a root directory that is represented by this content manager. + * + * @return A directory that is the root directory of this content manager. + * @throws RepositoryException + */ + public abstract Directory getRootDirectory() throws RepositoryException; - /** - * Gets the most recent version of a node which can be found under the given - * path (to get nodes from subdirectories, use <code>/</code> to separate - * them). - * - * @param path - * Path for which to get the node. - * @return A node corresponding to the given path. - * @throws ResourceDoesNotExist - * @throws RepositoryException - */ - public abstract Node getNode(String path) throws ResourceDoesNotExist, - RepositoryException; + /** + * Gets the most recent version of a node which can be found under the given + * path (to get nodes from subdirectories, use <code>/</code> to separate + * them). + * + * @param path + * Path for which to get the node. + * @return A node corresponding to the given path. + * @throws ResourceDoesNotExist + * @throws RepositoryException + */ + public abstract Node getNode(String path) throws ResourceDoesNotExist, + RepositoryException; - /** - * Gets a directory which can be found under the given path (to get nodes - * from subdirectories, use <code>/</code> to separate them). - * - * @param path - * Path for which to get the directory. - * @return A directory corresponding to the given path. - * @throws ResourceDoesNotExist - * @throws RepositoryException - */ - public abstract Directory getDirectory(String path) - throws ResourceDoesNotExist, RepositoryException; + /** + * Gets a directory which can be found under the given path (to get nodes + * from subdirectories, use <code>/</code> to separate them). + * + * @param path + * Path for which to get the directory. + * @return A directory corresponding to the given path. + * @throws ResourceDoesNotExist + * @throws RepositoryException + */ + public abstract Directory getDirectory(String path) + throws ResourceDoesNotExist, RepositoryException; - /** - * Performs the given search in this content manager. - * - * @param search - * Search to perform. - * @return A node list that is the result of the search. - */ - public NodeList search(Search search) throws ResourceDoesNotExist { - return search.perform(this); - } + /** + * Performs the given search in this content manager. + * + * @param search + * Search to perform. + * @return A node list that is the result of the search. + */ + public NodeList search(Search search) throws ResourceDoesNotExist { + return search.perform(this); + } - /** - * Gets the id of this repository. - * - * @return Id of this repository. - */ - public String getId() { - return id; - } + /** + * Gets the id of this repository. + * + * @return Id of this repository. + */ + public String getId() { + return id; + } - /** - * Gets the prefix of this content manager. - * - * @return Prefix of this content manager. - */ - public String getPrefix() { - return prefix; - } + /** + * Gets the prefix of this content manager. + * + * @return Prefix of this content manager. + */ + public String getPrefix() { + return prefix; + } - /** - * Saves the given resources at one time. Recommended if you have multiple - * resources to save. - * - * @param resources - * Resources to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public abstract void save(Collection<Resource> resources, String logMessage) - throws SaveException, RepositoryException; + /** + * Saves the given resources at one time. Recommended if you have multiple + * resources to save. + * + * @param resources + * Resources to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public abstract void save(Collection<Resource> resources, String logMessage) + throws SaveException, RepositoryException; - /** - * Deletes the given resources at one time. Recommended if you have multiple - * resources to delete. - * - * @param resources - * Resources to delete. - * @throws DeleteException - * @throws RepositoryException - */ - public abstract void delete(Collection<Resource> resources) - throws DeleteException, RepositoryException; + /** + * Deletes the given resources at one time. Recommended if you have multiple + * resources to delete. + * + * @param resources + * Resources to delete. + * @throws DeleteException + * @throws RepositoryException + */ + public abstract void delete(Collection<Resource> resources) + throws DeleteException, RepositoryException; - /** - * Deletes the given resource. Equivalent to resource.delete(). - * - * @param resource - * Resources to delete. - * @throws DeleteException - * @throws RepositoryException - */ - public void delete(Resource resource) throws DeleteException, - RepositoryException { - List<Resource> toDelete = new ArrayList<Resource>(); - toDelete.add(resource); - delete(toDelete); - } + /** + * Deletes the given resource. Equivalent to resource.delete(). + * + * @param resource + * Resources to delete. + * @throws DeleteException + * @throws RepositoryException + */ + public void delete(Resource resource) throws DeleteException, + RepositoryException { + List<Resource> toDelete = new ArrayList<Resource>(); + toDelete.add(resource); + delete(toDelete); + } - /** - * Saves the given resource. Equivalent to <code>res.save(String)</code>. - * - * @param res - * First resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res, String logMessage) throws SaveException, - RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res); - save(toSave, logMessage); - } + /** + * Saves the given resource. Equivalent to <code>res.save(String)</code>. + * + * @param res + * First resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res, String logMessage) throws SaveException, + RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Recommended if you have multiple - * resources to save. - * - * @param logMessage - * Log message to save with. - * @param resources - * Any number of resources - * @throws RepositoryException - * @throws SaveException - */ - public void save(String logMessage, Resource... resources) - throws RepositoryException, SaveException { - List<Resource> toSave = new ArrayList<Resource>(); + /** + * Saves the given resources at one time. Recommended if you have multiple + * resources to save. + * + * @param logMessage + * Log message to save with. + * @param resources + * Any number of resources + * @throws RepositoryException + * @throws SaveException + */ + public void save(String logMessage, Resource... resources) + throws RepositoryException, SaveException { + List<Resource> toSave = new ArrayList<Resource>(); - for (Resource resource : resources) { - toSave.add(resource); - } + for (Resource resource : resources) { + toSave.add(resource); + } - save(toSave, logMessage); - } + save(toSave, logMessage); + } - /** - * Deletes the given resources at one time. Recommended if you have multiple - * resources to delete. - * - * @param resources - * Any number of resources to delete - * @throws DeleteException - * @throws RepositoryException - */ - public void delete(Resource... resources) throws DeleteException, - RepositoryException { - List<Resource> toDelete = new ArrayList<Resource>(); + /** + * Deletes the given resources at one time. Recommended if you have multiple + * resources to delete. + * + * @param resources + * Any number of resources to delete + * @throws DeleteException + * @throws RepositoryException + */ + public void delete(Resource... resources) throws DeleteException, + RepositoryException { + List<Resource> toDelete = new ArrayList<Resource>(); - for (Resource resource : resources) { - toDelete.add(resource); - } + for (Resource resource : resources) { + toDelete.add(resource); + } - delete(toDelete); - } + delete(toDelete); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the two given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, String logMessage) - throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the two given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, String logMessage) + throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the three given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - String logMessage) throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the three given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + String logMessage) throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the four given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param res4 - * Fourth resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - Resource res4, String logMessage) throws SaveException, - RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - toSave.add(res4); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the four given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param res4 + * Fourth resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + Resource res4, String logMessage) throws SaveException, + RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + toSave.add(res4); + save(toSave, logMessage); + } - /** - * Saves the given resources at one time. Equivalent to - * <code>save(Collection, String)</code>, where the collection is filled - * with the five given resources. - * - * @param res1 - * First resource to save. - * @param res2 - * Second resource to save. - * @param res3 - * Third resource to save. - * @param res4 - * Fourth resource to save. - * @param res5 - * Fifth resource to save. - * @param logMessage - * Log message to save with. - * @throws SaveException - * @throws RepositoryException - */ - public void save(Resource res1, Resource res2, Resource res3, - Resource res4, Resource res5, String logMessage) - throws SaveException, RepositoryException { - List<Resource> toSave = new ArrayList<Resource>(); - toSave.add(res1); - toSave.add(res2); - toSave.add(res3); - toSave.add(res4); - toSave.add(res5); - save(toSave, logMessage); - } + /** + * Saves the given resources at one time. Equivalent to + * <code>save(Collection, String)</code>, where the collection is filled + * with the five given resources. + * + * @param res1 + * First resource to save. + * @param res2 + * Second resource to save. + * @param res3 + * Third resource to save. + * @param res4 + * Fourth resource to save. + * @param res5 + * Fifth resource to save. + * @param logMessage + * Log message to save with. + * @throws SaveException + * @throws RepositoryException + */ + public void save(Resource res1, Resource res2, Resource res3, + Resource res4, Resource res5, String logMessage) + throws SaveException, RepositoryException { + List<Resource> toSave = new ArrayList<Resource>(); + toSave.add(res1); + toSave.add(res2); + toSave.add(res3); + toSave.add(res4); + toSave.add(res5); + save(toSave, logMessage); + } - /** - * Gets a velocity engine, initialized with default properties, as defined - * in velocity.properties in the shotoku-base jar. Additionaly, the shotoku - * resource loader will be set to read templates from this content manager - * (if shotoku resource loader is defined to be used). - * - * @return A velocity engine initialized with default properties. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine() throws Exception { - return getVelocityEngine(true); - } + /** + * Gets a velocity engine, initialized with default properties, as defined + * in velocity.properties in the shotoku-base jar. Additionaly, the shotoku + * resource loader will be set to read templates from this content manager + * (if shotoku resource loader is defined to be used). + * + * @return A velocity engine initialized with default properties. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine() throws Exception { + return getVelocityEngine(true); + } - /** - * Gets a velocity engine, initialized with default properties, as defined - * in velocity.properties in the shotoku-base jar. - * - * @param addIdPrefix - * True iff id/ prefix properties should be added to the - * properties. - * @return A velocity engine initialized with default properties. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine(boolean addIdPrefix) - throws Exception { - return getVelocityEngine(new HashMap<Object, Object>(), addIdPrefix); - } + /** + * Gets a velocity engine, initialized with default properties, as defined + * in velocity.properties in the shotoku-base jar. + * + * @param addIdPrefix + * True iff id/ prefix properties should be added to the + * properties. + * @return A velocity engine initialized with default properties. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine(boolean addIdPrefix) + throws Exception { + return getVelocityEngine(new HashMap<Object, Object>(), addIdPrefix); + } - /** - * Gets a velocity engine, initialized with default properties, overwritten - * by the given propeties. - * - * @param overProps - * Properties which will be added to velocity configuration. - * @return An initialized velocity engine. - * @throws Exception - * In case of a velocity exception/ properties reading - * exception. - */ - public VelocityEngine getVelocityEngine( - Map<? extends Object, ? extends Object> overProps, - boolean addIdPrefix) throws Exception { - String representation = ""; - for (Object key : overProps.keySet()) { - representation += key + "=" + overProps.get(key) + ","; - } + /** + * Gets a velocity engine, initialized with default properties, overwritten + * by the given propeties. + * + * @param overProps + * Properties which will be added to velocity configuration. + * @return An initialized velocity engine. + * @throws Exception + * In case of a velocity exception/ properties reading + * exception. + */ + public VelocityEngine getVelocityEngine( + Map<? extends Object, ? extends Object> overProps, + boolean addIdPrefix) throws Exception { + String representation = ""; + for (Object key : overProps.keySet()) { + representation += key + "=" + overProps.get(key) + ","; + } - representation += ";" + prefix + ";" + id + ";"; - representation += addIdPrefix; + representation += ";" + prefix + ";" + id + ";"; + representation += addIdPrefix; - VelocityEngine ve = engines.get(representation); - if (ve == null) { - ve = new VelocityEngine(); - Properties props = new Properties(); - props.load(ContentManager.class - .getResourceAsStream(Constants.VELOCITY_PROPERTIES_FILE)); - props.putAll(overProps); + VelocityEngine ve = engines.get(representation); + if (ve == null) { + ve = new VelocityEngine(); + Properties props = new Properties(); + props.load(ContentManager.class + .getResourceAsStream(Constants.VELOCITY_PROPERTIES_FILE)); + props.putAll(overProps); - if (addIdPrefix) { - props.put(Constants.VELOCITY_RL_PREFIX, prefix); - props.put(Constants.VELOCITY_RL_ID, id); - } + if (addIdPrefix) { + props.put(Constants.VELOCITY_RL_PREFIX, prefix); + props.put(Constants.VELOCITY_RL_ID, id); + } - ve.init(props); + ve.init(props); - engines.put(representation, ve); - } + engines.put(representation, ve); + } - return ve; - } + return ve; + } - /** - * Standard constructor. - * - * @param id - * Id of this content manager. - * @param prefix - * Prefix of this content manager, as stated in properties. - * @throws RepositoryException - */ - protected ContentManager(String id, String prefix) - throws RepositoryException { - this.id = id; - this.prefix = Tools.normalizeSlashes(prefix, true); - } + /** + * Standard constructor. + * + * @param id + * Id of this content manager. + * @param prefix + * Prefix of this content manager, as stated in properties. + * @throws RepositoryException + */ + protected ContentManager(String id, String prefix) + throws RepositoryException { + this.id = id; + this.prefix = Tools.normalizeSlashes(prefix, true); + } - /* - * Content manager loading. - */ + /* + * Content manager loading. + */ - private static final Logger log; + private static final Logger log; - /** - * Id of the default content manager. May be overriden by a setting in the - * xml configuration file. - */ - private static String defaultId; + /** + * Id of the default content manager. May be overriden by a setting in the + * xml configuration file. + */ + private static String defaultId; - /** - * Size of the transfer buffer. - */ - private static int transferBufferSize; + /** + * Size of the transfer buffer. + */ + private static int transferBufferSize; - /** - * Default interval of the Shotoku service. - */ - private static int defaultServiceInterval; + /** + * Default interval of the Shotoku service. + */ + private static int defaultServiceInterval; - /** - * <code>contentManagers</code> - map (content manager id -> content - * manager constructor). - */ - private static Map<String, Pair<Constructor, Configuration>> contentManagers; + /** + * <code>contentManagers</code> - map (content manager id -> content + * manager constructor). + */ + private static Map<String, Pair<Constructor, Configuration>> contentManagers; - /** - * <code>props</code> - Shotoku properties, as read from the configuration - * file. - */ - private static PropertiesConfiguration props; + /** + * A set of content manager implementation classes names, which are + * already initialized. + */ + private static Set<String> initializedContentManagers; - /** - * <code>setupDone</code> - a marker to execute setup only once, even if - * the user does it many times by mistake. - */ - private static boolean setupDone; + /** + * A set of content manager ids, which are already initialized. + */ + private static Set<String> initializedIds; - static { - // Setup was not yet executed for sure. - setupDone = false; + /** + * A map content manager implementation class name -> a set of + * ids which use the given implementation. + */ + private static Map<String, Set<String>> implementationsIds; - // When this class is loaded, always reading configuration first. - try { - props = new PropertiesConfiguration(); + /** + * <code>props</code> - Shotoku properties, as read from the configuration + * file. + */ + private static PropertiesConfiguration props; - props.load(ContentManager.class - .getResourceAsStream(Constants.PROPERTIES_FILE)); - } catch (Exception e) { - throw new RuntimeException( - "Error while loading content manager configuration: ", e); - } + /** + * <code>setupDone</code> - a marker to execute setup only once, even if + * the user does it many times by mistake. + */ + private static boolean setupDone; - // Setuping the logger. - if (isEmbedded()) { - BasicConfigurator.configure(); - } + static { + // Setup was not yet executed for sure. + setupDone = false; - log = Logger.getLogger(ContentManager.class); - } + // When this class is loaded, always reading configuration first. + try { + props = new PropertiesConfiguration(); - /** - * Checks if Shotoku is configured to run in embedded mode or not. - * - * @return True iff Shotoku is configured to run in embedded mode. - */ - public static boolean isEmbedded() { - return Tools.isTrue(getProperty(Constants.PROPERTIES_EMBEDDED)); - } + props.load(ContentManager.class + .getResourceAsStream(Constants.PROPERTIES_FILE)); + } catch (Exception e) { + throw new RuntimeException( + "Error while loading content manager configuration: ", e); + } - /** - * Setups the content managers before first used. In embedded mode, should - * be always called once, before any usage of Shotoku classes. In app server - * mode, should be never called by the user. - */ - public static void setup() { - synchronized (ContentManager.class) { - if (setupDone) - return; + // Setuping the logger. + if (isEmbedded()) { + BasicConfigurator.configure(); + } - // Preventing setup to be executed twice. - setupDone = true; - } + log = Logger.getLogger(ContentManager.class); + } - engines = Collections - .synchronizedMap(new HashMap<String, VelocityEngine>()); + /** + * Checks if Shotoku is configured to run in embedded mode or not. + * + * @return True iff Shotoku is configured to run in embedded mode. + */ + public static boolean isEmbedded() { + return Tools.isTrue(getProperty(Constants.PROPERTIES_EMBEDDED)); + } - contentManagers = new HashMap<String, Pair<Constructor, Configuration>>(); + /** + * Setups the content managers before first used. In embedded mode, should + * be always called once, before any usage of Shotoku classes. In app server + * mode, should be never called by the user. + */ + public static void setup() { + synchronized (ContentManager.class) { + if (setupDone) + return; - // Reading the default properties. - defaultId = props.getString(Constants.PROPERTIES_ID_DEFAULT, - Constants.DEFAULT_ID); - transferBufferSize = props.getInt( - Constants.PROPERTIES_TRANSFER_BUF_SIZE, - Constants.DEFAULT_TRANSFER_BUF_SIZE); - defaultServiceInterval = props.getInt( - Constants.PROPERTIES_SERVICE_INTERVAL, - Constants.DEFAULT_SERVICE_INTERVAL); + // Preventing setup to be executed twice. + setupDone = true; + } - // Getting ids of defined content managers. - String[] ids = props.getStringArray(Constants.PROPERTIES_IDS); + engines = Collections + .synchronizedMap(new HashMap<String, VelocityEngine>()); - for (String id : ids) { - try { - Configuration conf = props.subset(Tools.concatenateProperties( - Constants.PROPERTIES_PREFIX, id)); + contentManagers = new HashMap<String, Pair<Constructor, Configuration>>(); + initializedContentManagers = new HashSet<String>(); + initializedIds = new HashSet<String>(); + implementationsIds = new HashMap<String, Set<String>>(); - String implementation = conf - .getString(Constants.PROPERTIES_IMPL_SUFFIX); - Class implClass = Class.forName(implementation); + // Reading the default properties. + defaultId = props.getString(Constants.PROPERTIES_ID_DEFAULT, + Constants.DEFAULT_ID); + transferBufferSize = props.getInt( + Constants.PROPERTIES_TRANSFER_BUF_SIZE, + Constants.DEFAULT_TRANSFER_BUF_SIZE); + defaultServiceInterval = props.getInt( + Constants.PROPERTIES_SERVICE_INTERVAL, + Constants.DEFAULT_SERVICE_INTERVAL); - contentManagers.put(id, new Pair<Constructor, Configuration>( - implClass.getConstructor(String.class, String.class, - Configuration.class), conf)); + // Getting ids of defined content managers. + String[] ids = props.getStringArray(Constants.PROPERTIES_IDS); - // Executing the setup function. - try { - Method setupMethod = implClass.getMethod( - Constants.SETUP_FUNCTION, String.class, - Configuration.class); + for (String id : ids) { + try { + Configuration conf = props.subset(Tools.concatenateProperties( + Constants.PROPERTIES_PREFIX, id)); - setupMethod.invoke(implClass, id, conf); - } catch (NoSuchMethodException e) { - // No setup - doing nothing. - } + String implementation = conf + .getString(Constants.PRO... [truncated message content] |
From: <jbo...@li...> - 2006-05-02 18:05:22
|
Author: adamw Date: 2006-05-02 14:05:13 -0400 (Tue, 02 May 2006) New Revision: 4046 Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java Log: Tools extension Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java =================================================================== --- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2006-05-02 17:04:22 UTC (rev 4045) +++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2006-05-02 18:05:13 UTC (rev 4046) @@ -330,4 +330,8 @@ public static String getNameBasedMimeType(String name) { return mimeTypes.getContentType(name.toLowerCase()); } + + public static String getNameBasedMimeType(File file) { + return mimeTypes.getContentType(file); + } } Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2006-05-02 17:04:22 UTC (rev 4045) +++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2006-05-02 18:05:13 UTC (rev 4046) @@ -159,7 +159,7 @@ for (String id : repositories.keySet()) { sb.append(id).append(" "); } - + return sb.append(".").toString(); } |