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-02 17:04:28
|
Author: unibrew Date: 2006-05-02 13:04:22 -0400 (Tue, 02 May 2006) New Revision: 4045 Added: labs/jbosslabs/trunk/portal-extensions/binaries/maven-repo-addons/jboss/jars/ejb3-persistence.jar Log: [JBLAB-655] Adding missing ejb3 library. Added: labs/jbosslabs/trunk/portal-extensions/binaries/maven-repo-addons/jboss/jars/ejb3-persistence.jar =================================================================== (Binary files differ) Property changes on: labs/jbosslabs/trunk/portal-extensions/binaries/maven-repo-addons/jboss/jars/ejb3-persistence.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2006-05-02 16:25:52
|
Author: adamw Date: 2006-05-02 12:25:47 -0400 (Tue, 02 May 2006) New Revision: 4044 Added: labs/jbosslabs/trunk/portal-extensions/svn-hooks/blog-check.sh labs/jbosslabs/trunk/portal-extensions/svn-hooks/pre-commit labs/jbosslabs/trunk/portal-extensions/svn-hooks/xml-check.sh Log: http://jira.jboss.com/jira/browse/JBLAB-654 Content checking hooks Added: labs/jbosslabs/trunk/portal-extensions/svn-hooks/blog-check.sh =================================================================== --- labs/jbosslabs/trunk/portal-extensions/svn-hooks/blog-check.sh 2006-05-02 16:22:57 UTC (rev 4043) +++ labs/jbosslabs/trunk/portal-extensions/svn-hooks/blog-check.sh 2006-05-02 16:25:47 UTC (rev 4044) @@ -0,0 +1,33 @@ +#!/bin/bash + +# CHECKS IF EVERY BLOG ENTRY COMMITED CONTAINS THE NECESSARY PROPERTIES + +REPOS="$1" +TXN="$2" + +OPTS="-t $TXN" +#OPTS="--revision $2" + +SVNLOOK=svnlook +type= +for token in `$SVNLOOK changed $OPTS $REPOS` +do + if [ -z "$type" ] + then + type=$token + else + # Only checking a file if it wasn't deleted and is an .xml file + if [ "$type" != "D" -a -n "`echo $token | grep ".*/members/.*/blog/.*\.\(htm\|html\)"`" ] + then + $SVNLOOK proplist $OPTS $REPOS $token | grep "^[[:space:]]*title$" || { + echo "The title property for a blog entry is not set. Aborting commit." >&2 + exit 1 + } + fi + + # Resetting type to get the type for the next file + type= + fi +done + +exit 0 Property changes on: labs/jbosslabs/trunk/portal-extensions/svn-hooks/blog-check.sh ___________________________________________________________________ Name: svn:executable + * Added: labs/jbosslabs/trunk/portal-extensions/svn-hooks/pre-commit =================================================================== --- labs/jbosslabs/trunk/portal-extensions/svn-hooks/pre-commit 2006-05-02 16:22:57 UTC (rev 4043) +++ labs/jbosslabs/trunk/portal-extensions/svn-hooks/pre-commit 2006-05-02 16:25:47 UTC (rev 4044) @@ -0,0 +1,15 @@ +#!/bin/sh + +# PRE-COMMIT HOOK + +REPOS="$1" +TXN="$2" + +HOOK_PATH=/usr/svn/repo1/hooks +export PATH=/usr/local/bin:/usr/bin + +$HOOK_PATH/xml-check.sh $REPOS $TXN || exit 1 +$HOOK_PATH/blog-check.sh $REPOS $TXN || exit 1 + +# All checks passed, so allow the commit. +exit 0 Property changes on: labs/jbosslabs/trunk/portal-extensions/svn-hooks/pre-commit ___________________________________________________________________ Name: svn:executable + * Added: labs/jbosslabs/trunk/portal-extensions/svn-hooks/xml-check.sh =================================================================== --- labs/jbosslabs/trunk/portal-extensions/svn-hooks/xml-check.sh 2006-05-02 16:22:57 UTC (rev 4043) +++ labs/jbosslabs/trunk/portal-extensions/svn-hooks/xml-check.sh 2006-05-02 16:25:47 UTC (rev 4044) @@ -0,0 +1,33 @@ +#!/bin/bash + +# CHECKS THAT ALL XMLs THAT ARE TO BE COMMITED ARE PARSEABLE + +REPOS="$1" +TXN="$2" + +OPTS="-t $TXN" +#OPTS="--revision $2" + +SVNLOOK=svnlook +type= +for token in `$SVNLOOK changed $OPTS $REPOS` +do + if [ -z "$type" ] + then + type=$token + else + # Only checking a file if it wasn't deleted and is an .xml file + if [ "$type" != "D" -a -n "`echo $token | grep .*\.xml`" ] + then + $SVNLOOK cat $OPTS $REPOS $token | xmllint - >/dev/null || { + echo "Error parsing XML; aborting commit." >&2 + exit 1 + } + fi + + # Resetting type to get the type for the next file + type= + fi +done + +exit 0 Property changes on: labs/jbosslabs/trunk/portal-extensions/svn-hooks/xml-check.sh ___________________________________________________________________ Name: svn:executable + * |
From: <jbo...@li...> - 2006-05-02 16:23:05
|
Author: adamw Date: 2006-05-02 12:22:57 -0400 (Tue, 02 May 2006) New Revision: 4043 Added: labs/jbosslabs/trunk/portal-extensions/svn-hooks/ Log: http://jira.jboss.com/jira/browse/JBLAB-654 Adding a directory for hooks |
From: <jbo...@li...> - 2006-05-02 15:59:56
|
Author: KrisVerlaenen Date: 2006-05-02 11:59:52 -0400 (Tue, 02 May 2006) New Revision: 4042 Added: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java Modified: labs/jbossrules/trunk/drools-ide/plugin.xml Log: made DRLRuleEditor2 propagate actions to DRLRuleEditor Modified: labs/jbossrules/trunk/drools-ide/plugin.xml =================================================================== --- labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-02 14:21:08 UTC (rev 4041) +++ labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-02 15:59:52 UTC (rev 4042) @@ -49,7 +49,7 @@ point="org.eclipse.ui.editors"> <editor class="org.drools.ide.editors.DRLRuleEditor2" - contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor" + contributorClass="org.drools.ide.editors.DRLRuleEditorActionContributor" extensions="drl,jbrule,drools,rule" icon="icons/drools.gif" id="org.eclipse.ui.editors.text.DRLEditor" Added: 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 14:21:08 UTC (rev 4041) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DRLRuleEditorActionContributor.java 2006-05-02 15:59:52 UTC (rev 4042) @@ -0,0 +1,29 @@ +package org.drools.ide.editors; + +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.editors.text.TextEditorActionContributor; +import org.eclipse.ui.part.MultiPageEditorActionBarContributor; +import org.eclipse.ui.texteditor.ITextEditor; + +public class DRLRuleEditorActionContributor extends MultiPageEditorActionBarContributor { + + private TextEditorActionContributor contributor = new TextEditorActionContributor(); + + public void init(IActionBars bars, IWorkbenchPage page) { + contributor.init(bars); + super.init(bars, page); + } + + public void setActivePage(IEditorPart activeEditor) { + IActionBars bars = getActionBars(); + System.out.println(bars); + if (activeEditor instanceof ITextEditor) { + if (bars != null) { + contributor.setActiveEditor(activeEditor); + } + } + } + +} |
From: <jbo...@li...> - 2006-05-02 14:21:16
|
Author: mla...@jb... Date: 2006-05-02 10:21:08 -0400 (Tue, 02 May 2006) New Revision: 4041 Modified: labs/jbossweb/trunk/src/share/native/build/buildworld.sh Log: Remove zlib dependency, and use 32-bit build for solaris Modified: labs/jbossweb/trunk/src/share/native/build/buildworld.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildworld.sh 2006-05-02 12:47:36 UTC (rev 4040) +++ labs/jbossweb/trunk/src/share/native/build/buildworld.sh 2006-05-02 14:21:08 UTC (rev 4041) @@ -22,10 +22,10 @@ case ${TCNATIVE_BUILD} in sparc*) - ./Configure --prefix=${TCNATIVE_BIN} --openssldir=${TCNATIVE_BIN}/ssl threads zlib no-krb5 no-rc5 no-mdc2 no-idea no-ec shared solaris64-sparcv9-gcc + ./Configure --prefix=${TCNATIVE_BIN} --openssldir=${TCNATIVE_BIN}/ssl threads no-zlib no-zlib-dynamic no-gmp no-krb5 no-rc5 no-mdc2 no-idea no-ec shared solaris-sparcv9-gcc ;; *) - ./config --prefix=${TCNATIVE_BIN} --openssldir=${TCNATIVE_BIN}/ssl threads zlib no-krb5 no-rc5 no-mdc2 no-idea no-ec shared + ./config --prefix=${TCNATIVE_BIN} --openssldir=${TCNATIVE_BIN}/ssl threads no-zlib no-zlib-dynamic no-gmp no-krb5 no-rc5 no-mdc2 no-idea no-ec shared ;; esac make depend |
From: <jbo...@li...> - 2006-05-02 12:47:42
|
Author: mar...@jb... Date: 2006-05-02 08:47:36 -0400 (Tue, 02 May 2006) New Revision: 4040 Added: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java Removed: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java Log: JBRULES-246 NPE on retract() -Added fixed unit test that recreated the error in core -line 148 in EvalConditionNode the logic is wrong. I've changed it to: if ( tuple.getLinkedTuples() != null ) { The idea is we only want to attempt to retract the tuple if we know its in the nodes memory and has propagated children - othwerwise we know that previous assert evaluations were false. 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-02 12:35:52 UTC (rev 4039) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java 2006-05-02 12:47:36 UTC (rev 4040) @@ -145,7 +145,7 @@ LinkedList memory = (LinkedList) workingMemory.getNodeMemory( this ); // checks if the tuple is attach to tuple - if ( (tuple.getNext() != null && tuple.getPrevious() != null) || memory.getFirst() == tuple ) { + if ( tuple.getLinkedTuples() != null ) { memory.remove( tuple ); propagateRetractTuple( tuple, Copied: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java (from rev 4024, labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java) =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalConditionNodeTest.java 2006-05-02 12:47:36 UTC (rev 4040) @@ -0,0 +1,374 @@ +package org.drools.reteoo; +/* + * Copyright 2005 JBoss Inc + * + * 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. + */ + + + + + +import java.util.List; + +import org.drools.DroolsTestCase; +import org.drools.FactException; +import org.drools.common.PropagationContextImpl; +import org.drools.spi.PropagationContext; +import org.drools.util.LinkedList; + +public class EvalConditionNodeTest extends DroolsTestCase { + private PropagationContext context; + private WorkingMemoryImpl workingMemory; + + public EvalConditionNodeTest(String name) { + super( name ); + } + + public void setUp() { + this.context = new PropagationContextImpl( 0, + PropagationContext.ASSERTION, + null, + null ); + + this.workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); + } + + public void testAttach() throws Exception { + MockTupleSource source = new MockTupleSource( 12 ); + + EvalConditionNode node = new EvalConditionNode( 18, + source, + new MockEvalCondition( true ) ); + + assertEquals( 18, + node.getId() ); + + assertLength( 0, + source.getTupleSinks() ); + + node.attach(); + + assertLength( 1, + source.getTupleSinks() ); + + assertSame( node, + source.getTupleSinks().get( 0 ) ); + } + + public void testMemory() { + WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); + + MockTupleSource source = new MockTupleSource( 12 ); + + EvalConditionNode node = new EvalConditionNode( 18, + source, + new MockEvalCondition( true ) ); + + LinkedList memory = (LinkedList) workingMemory.getNodeMemory( node ); + + assertNotNull( memory ); + } + + /** + * If a eval allows an incoming Object, then the Object MUST be + * propagated. This tests that the memory is updated + * + * @throws FactException + */ + public void testAllowed() throws FactException { + + // Create a test node that always returns true + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( true ) ); + + 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, + this.context, + this.workingMemory ); + + // Check memory was populated + LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); + + assertEquals( 1, + memory.size() ); + assertEquals( tuple, + 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() ); + } + + /** + * If a Condition does not allow an incoming Object, then the object MUST + * NOT be propagated. + * + * @throws FactException + */ + public void testNotAllowed() throws FactException { + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( false ) ); + + 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, + this.context, + this.workingMemory ); + + // make sure no assertions were propagated + assertEquals( 0, + sink.getAsserted().size() ); + + } + + public void testRetractNotAllowed() throws Exception { + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( false ) ); + + 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, + this.context, + this.workingMemory ); + + node.retractTuple( tuple, + context, + workingMemory ); + + // make sure no assertions were propagated + assertEquals( 0, + sink.getRetracted().size() ); + } + + public void testRetractAllowed() throws Exception { + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( true ) ); + + 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 pass and propagate + 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 ); + + // to stimulate JBRULES-246 we retract the second tuple1 first. + node.retractTuple( tuple1, + context, + workingMemory ); + + List list = sink.getRetracted(); + + // make sure no assertions were propagated + assertEquals( 1, + sink.getRetracted().size() ); + + ReteTuple retractedTuple0 = ( ReteTuple ) ( ( Object[] ) list.get( 0 ) )[0]; + assertNull( retractedTuple0.getLinkedTuples() ); + + node.retractTuple( tuple0, + context, + workingMemory ); + + // make sure no assertions were propagated + assertEquals( 2, + sink.getRetracted().size() ); + + + ReteTuple retractedTuple1 = ( ReteTuple ) ( ( Object[] ) list.get( 1) )[0]; + assertNull( retractedTuple1.getLinkedTuples() ); + + assertNotSame( retractedTuple0, retractedTuple1); + } + + public void testModifyNotAllowed() throws Exception { + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( false ) ); + + 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, + this.context, + this.workingMemory ); + + node.modifyTuple( tuple, + context, + workingMemory ); + + // make sure no assertions were propagated + assertEquals( 0, + sink.getRetracted().size() ); + assertEquals( 0, + sink.getModified().size() ); + assertEquals( 0, + sink.getAsserted().size() ); + } + + public void testModifyAllowed() throws Exception { + // Create a test node that always returns false + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( true ) ); + + 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, + this.context, + this.workingMemory ); + + node.modifyTuple( tuple, + context, + workingMemory ); + + // make sure no assertions were propagated + assertEquals( 1, + sink.getModified().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 + // as a joinnode does not store the resulting tuples + WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); + + // Creat the object source so we can detect the alphaNode telling it to + // propate its contents + MockTupleSource source = new MockTupleSource( 1 ); + + /* Create a test node that always returns true */ + EvalConditionNode node = new EvalConditionNode( 1, + new MockTupleSource( 15 ), + new MockEvalCondition( true ) ); + + // Add the first tuple sink and assert a tuple and object + // The sink has no memory + MockTupleSink sink1 = new MockTupleSink( 2 ); + node.addTupleSink( sink1 ); + + FactHandleImpl f0 = new FactHandleImpl( 0 ); + workingMemory.putObject( f0, + "string0" ); + + ReteTuple tuple1 = new ReteTuple( f0 ); + + node.assertTuple( tuple1, + this.context, + workingMemory ); + + assertLength( 1, + sink1.getAsserted() ); + + // Add the new sink, this should be updated from the re-processed + // joinnode memory + MockTupleSink sink2 = new MockTupleSink( 3 ); + node.addTupleSink( sink2 ); + assertLength( 0, + sink2.getAsserted() ); + + node.updateNewNode( workingMemory, + this.context ); + + assertLength( 1, + sink2.getAsserted() ); + } +} \ No newline at end of file Deleted: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java 2006-05-02 12:35:52 UTC (rev 4039) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/EvalNodeTest.java 2006-05-02 12:47:36 UTC (rev 4040) @@ -1,340 +0,0 @@ -package org.drools.reteoo; -/* - * Copyright 2005 JBoss Inc - * - * 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. - */ - - - - - -import org.drools.DroolsTestCase; -import org.drools.FactException; -import org.drools.common.PropagationContextImpl; -import org.drools.spi.PropagationContext; -import org.drools.util.LinkedList; - -public class EvalNodeTest extends DroolsTestCase { - private PropagationContext context; - private WorkingMemoryImpl workingMemory; - - public EvalNodeTest(String name) { - super( name ); - } - - public void setUp() { - this.context = new PropagationContextImpl( 0, - PropagationContext.ASSERTION, - null, - null ); - - this.workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); - } - - public void testAttach() throws Exception { - MockTupleSource source = new MockTupleSource( 12 ); - - EvalConditionNode node = new EvalConditionNode( 18, - source, - new MockEvalCondition( true ) ); - - assertEquals( 18, - node.getId() ); - - assertLength( 0, - source.getTupleSinks() ); - - node.attach(); - - assertLength( 1, - source.getTupleSinks() ); - - assertSame( node, - source.getTupleSinks().get( 0 ) ); - } - - public void testMemory() { - WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); - - MockTupleSource source = new MockTupleSource( 12 ); - - EvalConditionNode node = new EvalConditionNode( 18, - source, - new MockEvalCondition( true ) ); - - LinkedList memory = (LinkedList) workingMemory.getNodeMemory( node ); - - assertNotNull( memory ); - } - - /** - * If a eval allows an incoming Object, then the Object MUST be - * propagated. This tests that the memory is updated - * - * @throws FactException - */ - public void testAllowed() throws FactException { - - // Create a test node that always returns true - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); - - 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, - this.context, - this.workingMemory ); - - // Check memory was populated - LinkedList memory = (LinkedList) this.workingMemory.getNodeMemory( node ); - - assertEquals( 1, - memory.size() ); - assertEquals( tuple, - 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() ); - } - - /** - * If a Condition does not allow an incoming Object, then the object MUST - * NOT be propagated. - * - * @throws FactException - */ - public void testNotAllowed() throws FactException { - // Create a test node that always returns false - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); - - 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, - this.context, - this.workingMemory ); - - // make sure no assertions were propagated - assertEquals( 0, - sink.getAsserted().size() ); - - } - - public void testRetractNotAllowed() throws Exception { - // Create a test node that always returns false - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); - - 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, - this.context, - this.workingMemory ); - - node.retractTuple( tuple, - context, - workingMemory ); - - // make sure no assertions were propagated - assertEquals( 0, - sink.getRetracted().size() ); - } - - public void testRetractAllowed() throws Exception { - // Create a test node that always returns false - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); - - 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, - this.context, - this.workingMemory ); - - node.retractTuple( tuple, - context, - workingMemory ); - - // make sure no assertions were propagated - assertEquals( 1, - sink.getRetracted().size() ); - } - - public void testModifyNotAllowed() throws Exception { - // Create a test node that always returns false - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( false ) ); - - 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, - this.context, - this.workingMemory ); - - node.modifyTuple( tuple, - context, - workingMemory ); - - // make sure no assertions were propagated - assertEquals( 0, - sink.getRetracted().size() ); - assertEquals( 0, - sink.getModified().size() ); - assertEquals( 0, - sink.getAsserted().size() ); - } - - public void testModifyAllowed() throws Exception { - // Create a test node that always returns false - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); - - 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, - this.context, - this.workingMemory ); - - node.modifyTuple( tuple, - context, - workingMemory ); - - // make sure no assertions were propagated - assertEquals( 1, - sink.getModified().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 - // as a joinnode does not store the resulting tuples - WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl() ); - - // Creat the object source so we can detect the alphaNode telling it to - // propate its contents - MockTupleSource source = new MockTupleSource( 1 ); - - /* Create a test node that always returns true */ - EvalConditionNode node = new EvalConditionNode( 1, - new MockTupleSource( 15 ), - new MockEvalCondition( true ) ); - - // Add the first tuple sink and assert a tuple and object - // The sink has no memory - MockTupleSink sink1 = new MockTupleSink( 2 ); - node.addTupleSink( sink1 ); - - FactHandleImpl f0 = new FactHandleImpl( 0 ); - workingMemory.putObject( f0, - "string0" ); - - ReteTuple tuple1 = new ReteTuple( f0 ); - - node.assertTuple( tuple1, - this.context, - workingMemory ); - - assertLength( 1, - sink1.getAsserted() ); - - // Add the new sink, this should be updated from the re-processed - // joinnode memory - MockTupleSink sink2 = new MockTupleSink( 3 ); - node.addTupleSink( sink2 ); - assertLength( 0, - sink2.getAsserted() ); - - node.updateNewNode( workingMemory, - this.context ); - - assertLength( 1, - sink2.getAsserted() ); - } -} \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 12:36:06
|
Author: bagerman Date: 2006-05-02 08:35:52 -0400 (Tue, 02 May 2006) New Revision: 4039 Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractRuleBase.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/util/BaseTableReverseOrderIterator.java Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/LeapsTest.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactHandleImpl.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactTable.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/Handle.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/HandleFactory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsTuple.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleBaseImpl.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleHandle.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/TokenEvaluator.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/WorkingMemoryImpl.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/util/BaseTableIterator.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/util/ConstrainedFactTableIterator.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/util/Table.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/util/TokenStack.java Log: 1. Modify Leaps locking strategy to follow RETEoo 2. Iterate facts for not and exists in reverse order 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 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -1,5 +1,4 @@ package org.drools.compiler; - /* * Copyright 2005 JBoss Inc * @@ -16,10 +15,11 @@ * 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,20 +72,21 @@ if ( configuration == null ) { configuration = new PackageBuilderConfiguration(); } - - this.compiler = getCompiler( configuration.getCompiler() ); - - this.configuration = configuration; - + + this.compiler = JavaCompilerFactory.getInstance().createCompiler( 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() ); - } + } } /** @@ -94,22 +95,20 @@ * @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 { @@ -119,7 +118,7 @@ } addPackage( xmlReader.getPackageDescr() ); - } + } /** * Load a rule package from DRL source using the supplied DSL configuration. @@ -129,22 +128,20 @@ * @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, @@ -195,7 +192,7 @@ try { clazz = typeResolver.resolveType( className ); pkg.addGlobal( identifier, - clazz ); + clazz ); } catch ( ClassNotFoundException e ) { new GlobalError( identifier ); } @@ -206,9 +203,9 @@ String text, MemoryResourceReader src, ResourceStore dst) { - src.add( className.replace( '.', - '/' ) + ".java", - text.getBytes() ); + src.addFile( className.replace( '.', + '/' ) + ".java", + text.toCharArray() ); CompilationResult result = compiler.compile( new String[]{className}, src, dst, @@ -220,16 +217,15 @@ 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) { @@ -251,17 +247,16 @@ // 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(), @@ -274,10 +269,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 ); @@ -286,14 +281,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, @@ -301,8 +296,8 @@ result.getErrors(), "Rule Compilation error for Invoker" ) ); } - } - } + } + } } /** @@ -313,7 +308,7 @@ * Compiled packages are serializable. */ public Package getPackage() { - if ( hasErrors() ) { + if (hasErrors()) { this.pkg.setError( this.printErrors() ); } return this.pkg; @@ -339,12 +334,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. * @@ -358,8 +353,7 @@ 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; @@ -380,16 +374,6 @@ 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 ); } @@ -397,8 +381,9 @@ public static class MissingPackageNameException extends IllegalArgumentException { public MissingPackageNameException(String message) { - super( message ); + super(message); } - + } + } \ No newline at end of file Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/LeapsTest.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/LeapsTest.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/LeapsTest.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -22,10 +22,8 @@ import java.util.List; import org.drools.Cheese; -import org.drools.FactHandle; import org.drools.QueryResults; import org.drools.RuleBase; -import org.drools.Sensor; import org.drools.WorkingMemory; import org.drools.compiler.PackageBuilder; import org.drools.rule.Package; @@ -128,7 +126,4 @@ public void testLogicalAssertions2() throws Exception { // Not working in leaps } - - public void testEmptyColumn() throws Exception { - } } Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractRuleBase.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractRuleBase.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractRuleBase.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -0,0 +1,354 @@ +package org.drools.common; + +/* + * Copyright 2005 JBoss Inc + * + * 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. + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; + +import org.drools.FactException; +import org.drools.PackageIntegrationException; +import org.drools.RuleBase; +import org.drools.RuleIntegrationException; +import org.drools.WorkingMemory; +import org.drools.rule.CompositePackageClassLoader; +import org.drools.rule.InvalidPatternException; +import org.drools.rule.Package; +import org.drools.rule.PackageCompilationData; +import org.drools.rule.Rule; +import org.drools.spi.FactHandleFactory; + +/** + * Implementation of <code>RuleBase</code>. + * + * @author <a href="mailto:bo...@we...">bob mcwhirter</a> + * @author <a href="mailto:mar...@jb...">Mark Proctor</a> + * + * @version $Id: RuleBaseImpl.java,v 1.5 2005/08/14 22:44:12 mproctor Exp $ + */ +abstract public class AbstractRuleBase + implements + RuleBase, + Externalizable { + // ------------------------------------------------------------ + // Instance members + // ------------------------------------------------------------ + + private Map pkgs; + + private transient CompositePackageClassLoader packageClassLoader; + + /** The fact handle factory. */ + private FactHandleFactory factHandleFactory; + + private Map globals; + + // @todo: replace this with a weak HashSet + /** + * WeakHashMap to keep references of WorkingMemories but allow them to be + * garbage collected + */ + private transient Map workingMemories; + + /** Special value when adding to the underlying map. */ + private static final Object PRESENT = new Object(); + + // ------------------------------------------------------------ + // Constructors + // ------------------------------------------------------------ + + /** + * Construct. + * + * @param rete + * The rete network. + */ + public AbstractRuleBase(FactHandleFactory factHandleFactory) { + this.factHandleFactory = factHandleFactory; + + this.packageClassLoader = new CompositePackageClassLoader( Thread.currentThread().getContextClassLoader() ); + this.pkgs = new HashMap(); + this.globals = new HashMap(); + this.workingMemories = new WeakHashMap(); + } + + /** + * Handles the write serialization of the Package. Patterns in Rules may + * reference generated data which cannot be serialized by default methods. + * The Package uses PackageCompilationData to hold a reference to the + * generated bytecode. The generated bytecode must be restored before any + * Rules. + * + */ + public void writeExternal(ObjectOutput stream) throws IOException { + stream.writeObject( this.pkgs ); + + // Rules must be restored by an ObjectInputStream that can resolve using a given ClassLoader to handle seaprately by storing as + // a byte[] + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutput out = new ObjectOutputStream( bos ); + out.writeObject( this.factHandleFactory ); + out.writeObject( this.globals ); + + stream.writeObject( bos.toByteArray() ); + } + /** + * Handles the read serialization of the Package. Patterns in Rules may + * reference generated data which cannot be serialized by default methods. + * The Package uses PackageCompilationData to hold a reference to the + * generated bytecode; which must be restored before any Rules. A custom + * ObjectInputStream, able to resolve classes against the bytecode in the + * PackageCompilationData, is used to restore the Rules. + * + */ + public void readExternal( ObjectInput stream ) throws IOException, + ClassNotFoundException { + // PackageCompilationData must be restored before Rules as it has the + // ClassLoader needed to resolve the generated code references in Rules + this.pkgs = (Map) stream.readObject( ); + + this.packageClassLoader = new CompositePackageClassLoader( Thread.currentThread( ) + .getContextClassLoader( ) ); + for (Iterator it = this.pkgs.values( ).iterator( ); it.hasNext( );) { + this.packageClassLoader.addClassLoader( ( (Package) it.next( ) ).getPackageCompilationData( ) + .getClassLoader( ) ); + } + + // Return the rules stored as a byte[] + byte[] bytes = (byte[]) stream.readObject( ); + + // Use a custom ObjectInputStream that can resolve against a given + // classLoader + ObjectInputStreamWithLoader streamWithLoader = new ObjectInputStreamWithLoader( new ByteArrayInputStream( bytes ), + this.packageClassLoader ); + + this.factHandleFactory = (FactHandleFactory) streamWithLoader.readObject( ); + this.globals = (Map) streamWithLoader.readObject( ); + + this.workingMemories = new WeakHashMap( ); + } + + // ------------------------------------------------------------ + // Instance methods + // ------------------------------------------------------------ + + /** + * @see RuleBase + */ + public WorkingMemory newWorkingMemory() { + return newWorkingMemory( true ); + } + + /** + * @see RuleBase + */ + abstract public WorkingMemory newWorkingMemory(boolean keepReference); + + public void disposeWorkingMemory(WorkingMemory workingMemory) { + this.workingMemories.remove( workingMemory ); + } + + /** + * @see RuleBase + */ + public FactHandleFactory getFactHandleFactory() { + return this.factHandleFactory; + } + + public FactHandleFactory newFactHandleFactory() { + return this.factHandleFactory.newInstance(); + } + + public Package[] getPackages() { + return (Package[]) this.pkgs.values().toArray( new Package[this.pkgs.size()] ); + } + + public Map getGlobals() { + return this.globals; + } + + /** + * Add a <code>Package</code> to the network. Iterates through the + * <code>Package</code> adding Each individual <code>Rule</code> to the + * network. Before update network each referenced <code>WorkingMemory</code> + * is locked. + * + * @param pkg + * The package to add. + * @throws PackageIntegrationException + * + * @throws RuleIntegrationException + * if an error prevents complete construction of the network for + * the <code>Rule</code>. + * @throws FactException + * @throws InvalidPatternException + */ + public void addPackage(Package newPkg) throws PackageIntegrationException { + newPkg.checkValidity(); + Package pkg = (Package) this.pkgs.get( newPkg.getName() ); + + // Iterate each workingMemory and lock it + // This is so we don't update the Rete network during propagation + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + workingMemory.getLock().lock(); + } + + if ( pkg != null ) { + mergePackage( pkg, + newPkg ); + } else { + this.pkgs.put( newPkg.getName(), + newPkg ); + } + + Map newGlobals = newPkg.getGlobals(); + + // Check that the global data is valid, we cannot change the type + // of an already declared global variable + for ( Iterator it = newGlobals.keySet().iterator(); it.hasNext(); ) { + String identifier = (String) it.next(); + Class type = (Class) newGlobals.get( identifier ); + if ( this.globals.containsKey( identifier ) && !this.globals.get( identifier ).equals( type ) ) { + throw new PackageIntegrationException( pkg ); + } + } + this.globals.putAll( newGlobals ); + + Rule[] rules = newPkg.getRules(); + + for ( int i = 0; i < rules.length; ++i ) { + addRule( rules[i] ); + } + + this.packageClassLoader.addClassLoader( newPkg.getPackageCompilationData().getClassLoader() ); + + // Iterate each workingMemory and attempt to fire any rules, that were activated as a result + // of the new rule addition. Unlock after fireAllRules(); + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + + workingMemory.fireAllRules(); + workingMemory.getLock().unlock(); + } + } + + private void mergePackage(Package pkg, + Package newPkg) throws PackageIntegrationException { + Map globals = pkg.getGlobals(); + List imports = pkg.getImports(); + + // First update the binary files + // @todo: this probably has issues if you add classes in the incorrect order - functions, rules, invokers. + PackageCompilationData compilationData = pkg.getPackageCompilationData(); + PackageCompilationData newCompilationData = newPkg.getPackageCompilationData(); + String[] files = newCompilationData.list(); + for ( int i = 0, length = files.length; i < length; i++ ) { + compilationData.write( files[i], + newCompilationData.read( files[i] ) ); + } + + // Merge imports + imports.addAll( newPkg.getImports() ); + + // Add invokers + compilationData.putAllInvokers( newCompilationData.getInvokers() ); + + // Add globals + for ( Iterator it = globals.keySet().iterator(); it.hasNext(); ) { + String identifier = (String) it.next(); + Class type = (Class) globals.get( identifier ); + if ( globals.containsKey( identifier ) && !globals.get( identifier ).equals( type ) ) { + throw new PackageIntegrationException( "Unable to merge new Package", + newPkg ); + } + } + } + + protected void addRule(Rule rule) throws InvalidPatternException { + if ( !rule.isValid() ) { + throw new IllegalArgumentException( "The rule called " + rule.getName() + " is not valid. Check for compile errors reported." ); + } + } + + public void removePackage(String packageName) { + Package pkg = (Package) this.pkgs.get( packageName ); + // Iterate each workingMemory and lock it + // This is so we don't update the Rete network during propagation + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + workingMemory.getLock().lock(); + } + + Rule[] rules = pkg.getRules(); + + for ( int i = 0; i < rules.length; ++i ) { + removeRule( rules[i] ); + } + + this.packageClassLoader.removeClassLoader( pkg.getPackageCompilationData().getClassLoader() ); + + pkg.clear(); + + // Iterate and unlock + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + workingMemory.getLock().unlock(); + } + } + + public void removeRule(String packageName, + String ruleName) { + Package pkg = (Package) this.pkgs.get( packageName ); + Rule rule = pkg.getRule( ruleName ); + // Iterate each workingMemory and lock it + // This is so we don't update the Rete network during propagation + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + workingMemory.getLock().lock(); + } + removeRule( rule ); + pkg.removeRule( rule ); + + // Iterate and unlock + for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) it.next(); + workingMemory.getLock().unlock(); + } + } + + abstract protected void removeRule(Rule rule); + + protected void addWorkingMemory( WorkingMemory workingMemory, boolean keepReference ) { + if (keepReference) { + this.workingMemories.put( workingMemory, PRESENT ); + } + } + public Set getWorkingMemories() { + return this.workingMemories.keySet(); + } +} Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/common/AbstractWorkingMemory.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -47,6 +47,8 @@ import org.drools.util.IdentityMap; import org.drools.util.PrimitiveLongMap; import org.drools.util.PrimitiveLongStack; +import org.drools.util.concurrent.locks.Lock; +import org.drools.util.concurrent.locks.ReentrantLock; /** * Implementation of <code>WorkingMemory</code>. @@ -55,43 +57,45 @@ * @author <a href="mailto:si...@re...">Simon Harris </a> * @author <a href="mailto:bag...@gm...">Alexander Bagerman </a> */ -abstract public class AbstractWorkingMemory - implements - WorkingMemory, - InternalWorkingMemoryActions, - EventSupport, - PropertyChangeListener { +abstract public class AbstractWorkingMemory implements WorkingMemory, + InternalWorkingMemoryActions, EventSupport, PropertyChangeListener { // ------------------------------------------------------------ // Constants // ------------------------------------------------------------ - private static final Class[] ADD_REMOVE_PROPERTY_CHANGE_LISTENER_ARG_TYPES = new Class[]{PropertyChangeListener.class}; + private static final Class[] ADD_REMOVE_PROPERTY_CHANGE_LISTENER_ARG_TYPES = new Class[] { PropertyChangeListener.class }; // ------------------------------------------------------------ // Instance members // ------------------------------------------------------------ /** The arguments used when adding/removing a property change listener. */ - protected final Object[] addRemovePropertyChangeListenerArgs = new Object[]{this}; + protected final Object[] addRemovePropertyChangeListenerArgs = new Object[] { this }; /** Global values which are associated with this memory. */ - private final Map globals = new HashMap(); + private final Map globals = new HashMap( ); /** Object-to-handle mapping. */ - protected final Map identityMap = new IdentityMap(); - protected final Map equalsMap = new HashMap(); + protected final Map identityMap = new IdentityMap( ); + protected final Map equalsMap = new HashMap( ); + protected final PrimitiveLongMap justified = new PrimitiveLongMap( 8, 32 ); - private final PrimitiveLongStack factHandlePool = new PrimitiveLongStack(); + private final PrimitiveLongStack factHandlePool = new PrimitiveLongStack( ); + protected static final String STATED = "STATED"; + protected static final String JUSTIFIED = "JUSTIFIED"; + protected static final String NEW = "NEW"; + protected static final FactStatus STATUS_NEW = new FactStatus( NEW, - 0 ); + 0 ); /** The eventSupport */ protected final WorkingMemoryEventSupport workingMemoryEventSupport = new WorkingMemoryEventSupport( this ); + protected final AgendaEventSupport agendaEventSupport = new AgendaEventSupport( this ); /** The <code>RuleBase</code> with which this memory is associated. */ @@ -100,12 +104,14 @@ protected final FactHandleFactory handleFactory; /** Rule-firing agenda. */ - // protected final Agenda agenda; + // protected final Agenda agenda; /** Flag to determine if a rule is currently being fired. */ protected boolean firing; protected long propagationIdCounter; + private ReentrantLock lock = new ReentrantLock( ); + public AbstractWorkingMemory(RuleBase ruleBase, FactHandleFactory handleFactory) { this.ruleBase = ruleBase; @@ -421,6 +427,10 @@ } } + public Lock getLock() { + return this.lock; + } + protected static class FactStatus { private int counter; private String status; Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactHandleImpl.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactHandleImpl.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactHandleImpl.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -15,11 +15,9 @@ * limitations under the License. */ -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.Set; import org.drools.FactHandle; import org.drools.common.InternalFactHandle; @@ -33,62 +31,56 @@ public class FactHandleImpl extends Handle implements InternalFactHandle { - private Set activatedTuples = null; + private List activatedTuples = null; - private List notTuples = null; + private List notTuples = null; - private List existsTuples = null; + private List existsTuples = null; /** * actual object that is asserted to the system no getters just a direct * access to speed things up */ - public FactHandleImpl(long id, - Object object) { - super( id, - object ); + public FactHandleImpl(long id, Object object) { + super( id, object ); } - protected final void addActivatedTuple(LeapsTuple tuple) { - if ( this.activatedTuples == null ) { - this.activatedTuples = new HashSet(); + protected void addActivatedTuple( LeapsTuple tuple ) { + if (this.activatedTuples == null) { + this.activatedTuples = new LinkedList( ); } this.activatedTuples.add( tuple ); } - protected final void addNotTuple(LeapsTuple tuple, - int index) { - if ( this.notTuples == null ) { - this.notTuples = new LinkedList(); + protected void addNotTuple( LeapsTuple tuple, int index ) { + if (this.notTuples == null) { + this.notTuples = new LinkedList( ); } - this.notTuples.add( new FactHandleTupleAssembly( tuple, - index ) ); + this.notTuples.add( new FactHandleTupleAssembly( tuple, index ) ); } - protected final void addExistsTuple(LeapsTuple tuple, - int index) { - if ( this.existsTuples == null ) { - this.existsTuples = new LinkedList(); + protected void addExistsTuple( LeapsTuple tuple, int index ) { + if (this.existsTuples == null) { + this.existsTuples = new LinkedList( ); } - this.existsTuples.add( new FactHandleTupleAssembly( tuple, - index ) ); + this.existsTuples.add( new FactHandleTupleAssembly( tuple, index ) ); } - protected final Iterator getActivatedTuples() { + protected Iterator getActivatedTuples() { if ( this.activatedTuples != null ) { return this.activatedTuples.iterator(); } return null; } - protected final Iterator getNotTupleAssemblies() { + protected Iterator getNotTupleAssemblies() { if ( this.notTuples != null ) { return this.notTuples.iterator(); } return null; } - protected final Iterator getExistsTupleAssemblies() { + protected Iterator getExistsTupleAssemblies() { if ( this.existsTuples != null ) { return this.existsTuples.iterator(); } Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactTable.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactTable.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/FactTable.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -15,9 +15,8 @@ * limitations under the License. */ -import java.util.HashSet; import java.util.Iterator; -import java.util.Set; +import java.util.LinkedList; import org.drools.common.PropagationContextImpl; import org.drools.leaps.util.Table; @@ -47,7 +46,7 @@ * Tuples that are either already on agenda or are very close (missing * exists or have not facts matching) */ - private final Set tuples; + private final LinkedList tuples; /** * initializes base LeapsTable with appropriate Comparator and positive and @@ -59,7 +58,7 @@ public FactTable(ConflictResolver conflictResolver) { super( conflictResolver.getFactConflictResolver() ); this.rules = new RuleTable( conflictResolver.getRuleConflictResolver() ); - this.tuples = new HashSet(); + this.tuples = new LinkedList(); } /** @@ -165,15 +164,11 @@ return ret.toString(); } - Iterator getTuplesIterator() { + protected Iterator getTuplesIterator() { return this.tuples.iterator(); } - boolean addTuple(LeapsTuple tuple) { - return this.tuples.add( tuple ); + protected void addTuple(LeapsTuple tuple) { + this.tuples.add( tuple ); } - - void removeTuple(LeapsTuple tuple) { - this.tuples.remove( tuple ); - } } \ No newline at end of file Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/Handle.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/Handle.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/Handle.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -26,9 +26,7 @@ * @author Alexander Bagerman * */ -public class Handle - implements - Serializable { +public class Handle implements Serializable { private static final long serialVersionUID = 1L; // object to handle Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/HandleFactory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/HandleFactory.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/HandleFactory.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -22,14 +22,12 @@ * @author Alexander Bagerman * */ -class HandleFactory - implements - FactHandleFactory { +class HandleFactory implements FactHandleFactory { private static final long serialVersionUID = 8510623248591449450L; private long counter; - HandleFactory() { + protected HandleFactory() { this.counter = 0L; } @@ -49,9 +47,8 @@ * @param object * @return leaps handle */ - public final FactHandle newFactHandle(Object object) { - return new FactHandleImpl( this.getNextId(), - object ); + public final FactHandle newFactHandle( Object object ) { + return new FactHandleImpl( this.getNextId( ), object ); } /** Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsTuple.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsTuple.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/LeapsTuple.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -20,12 +20,10 @@ import org.drools.FactHandle; import org.drools.common.InternalFactHandle; -import org.drools.common.LogicalDependency; import org.drools.rule.Declaration; import org.drools.spi.Activation; import org.drools.spi.PropagationContext; import org.drools.spi.Tuple; -import org.drools.util.LinkedList; /** * Leaps Tuple implementation @@ -49,8 +47,6 @@ private final LeapsRule leapsRule; - private LinkedList justified; - /** * agendaItem parts */ @@ -83,7 +79,7 @@ * * @return rule */ - LeapsRule getLeapsRule() { + protected LeapsRule getLeapsRule() { return this.leapsRule; } @@ -141,11 +137,11 @@ * * @return indicator if agendaItem was null'ed */ - boolean isActivationNull() { + protected boolean isActivationNull() { return this.activation == null; } - Activation getActivation() { + protected Activation getActivation() { return this.activation; } @@ -184,7 +180,7 @@ * * @return */ - boolean isReadyForActivation() { + protected boolean isReadyForActivation() { return this.readyForActivation; } @@ -214,31 +210,32 @@ return buffer.toString(); } - void setBlockingNotFactHandle(FactHandleImpl factHandle, + protected void setBlockingNotFactHandle(FactHandleImpl factHandle, int index) { this.readyForActivation = false; this.blockingNotFactHandles[index] = factHandle; } - boolean isBlockingNotFactHandle(int index ) { + protected boolean isBlockingNotFactHandle(int index ) { return this.blockingNotFactHandles[index] != null; } - void removeBlockingNotFactHandle(int index) { + + protected void removeBlockingNotFactHandle(int index) { this.blockingNotFactHandles[index] = null; this.setReadyForActivation(); } - void setExistsFactHandle(FactHandleImpl factHandle, + protected void setExistsFactHandle(FactHandleImpl factHandle, int index) { this.existsFactHandles[index] = factHandle; this.setReadyForActivation(); } - boolean isExistsFactHandle(int index) { + protected boolean isExistsFactHandle(int index) { return this.existsFactHandles[index] != null; } - void removeExistsFactHandle(int index) { + protected void removeExistsFactHandle(int index) { this.existsFactHandles[index] = null; this.setReadyForActivation(); } @@ -265,22 +262,10 @@ } } - PropagationContext getContext() { + protected PropagationContext getContext() { return this.context; } - public void addLogicalDependency(LogicalDependency node) { - if ( this.justified == null ) { - this.justified = new LinkedList(); - } - - this.justified.add( node ); - } - - public LinkedList getLogicalDependencies() { - return this.justified; - } - protected void setContext( PropagationContext context ) { this.context = context; } Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleBaseImpl.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleBaseImpl.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleBaseImpl.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -16,21 +16,18 @@ */ import java.io.IOException; -import java.io.ObjectInputStream; +import java.io.ObjectInput; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.WeakHashMap; import org.drools.FactException; import org.drools.PackageIntegrationException; import org.drools.RuleBase; import org.drools.WorkingMemory; +import org.drools.common.AbstractRuleBase; import org.drools.rule.InvalidPatternException; -import org.drools.rule.Package; -import org.drools.rule.PackageCompilationData; import org.drools.rule.Rule; import org.drools.spi.FactHandleFactory; @@ -41,32 +38,12 @@ * @author Alexander Bagerman * */ -public class RuleBaseImpl - implements - RuleBase { - private static final long serialVersionUID = 1487738104393155409L; +public class RuleBaseImpl extends AbstractRuleBase { + private static final long serialVersionUID = 1487738104393155409L; - private transient Map leapsRules; + private Map leapsRules; /** - * The fact handle factory. - */ - private final FactHandleFactory factHandleFactory; - - private transient Map globalDeclarations; - - private final Map rulesPackages; - - /** - * WeakHashMap to keep references of WorkingMemories but allow them to be - * garbage collected - */ - private transient Map workingMemories; - - /** Special value when adding to the underlying map. */ - private static final Object PRESENT = new Object(); - - /** * Construct. * * @param rete @@ -92,12 +69,7 @@ * @throws Exception */ public RuleBaseImpl(FactHandleFactory factHandleFactory) { - // casting to make sure that it's leaps handle factory - this.factHandleFactory = (HandleFactory) factHandleFactory; - this.globalDeclarations = new HashMap(); - this.workingMemories = new WeakHashMap(); - - this.rulesPackages = new HashMap(); + super (factHandleFactory); this.leapsRules = new HashMap(); } @@ -111,130 +83,19 @@ /** * @see RuleBase */ - public WorkingMemory newWorkingMemory(boolean keepReference) { + public WorkingMemory newWorkingMemory( boolean keepReference ) { WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( this ); // add all rules added so far - for ( Iterator it = this.leapsRules.values().iterator(); it.hasNext(); ) { - workingMemory.addLeapsRules( (List) it.next() ); + for (Iterator it = this.leapsRules.values( ).iterator( ); it.hasNext( );) { + workingMemory.addLeapsRules( (List) it.next( ) ); } // - if ( keepReference ) { - this.workingMemories.put( workingMemory, - RuleBaseImpl.PRESENT ); - } + super.addWorkingMemory( workingMemory, keepReference ); + return workingMemory; } - void disposeWorkingMemory(WorkingMemory workingMemory) { - this.workingMemories.remove( workingMemory ); - } - /** - * @see RuleBase - */ - public FactHandleFactory getFactHandleFactory() { - return this.factHandleFactory; - } - - /** - * returns NEW fact handle factory because each working memory needs the new - * one - * - * @see RuleBase - */ - public FactHandleFactory newFactHandleFactory() { - return this.factHandleFactory.newInstance(); - } - - /** - * @see RuleBase - */ - - public Package[] getPackages() { - return (Package[]) this.rulesPackages.values().toArray( new Package[this.rulesPackages.size()] ); - } - - public Map getGlobalDeclarations() { - return this.globalDeclarations; - } - - /** - * Add a <code>Package</code> to the network. Iterates through the - * <code>Package</code> adding Each individual <code>Rule</code> to the - * network. - * - * @param rulesPackage - * The rule-set to add. - * @throws PackageIntegrationException - * - * @throws FactException - * @throws InvalidPatternException - */ - public void addPackage(Package newPackage) throws PackageIntegrationException { - newPackage.checkValidity(); - Package pkg = (Package) this.rulesPackages.get( newPackage.getName() ); - if ( pkg != null ) { - mergePackage( pkg, - newPackage ); - } else { - this.rulesPackages.put( newPackage.getName(), - newPackage ); - } - - Map newGlobals = newPackage.getGlobals(); - - // Check that the global data is valid, we cannot change the type - // of an already declared global variable - for ( Iterator it = newGlobals.keySet().iterator(); it.hasNext(); ) { - String identifier = (String) it.next(); - Class type = (Class) newGlobals.get( identifier ); - if ( this.globalDeclarations.containsKey( identifier ) && !this.globalDeclarations.get( identifier ).equals( type ) ) { - throw new PackageIntegrationException( pkg ); - } - } - this.globalDeclarations.putAll( newGlobals ); - - Rule[] rules = newPackage.getRules(); - - for ( int i = 0; i < rules.length; ++i ) { - addRule( rules[i] ); - } - } - - public void mergePackage(Package existingPackage, - Package newPackage) throws PackageIntegrationException { - Map globals = existingPackage.getGlobals(); - List imports = existingPackage.getImports(); - - // First update the binary files - // @todo: this probably has issues if you add classes in the incorrect - // order - functions, rules, invokers. - PackageCompilationData compilationData = existingPackage.getPackageCompilationData(); - PackageCompilationData newCompilationData = newPackage.getPackageCompilationData(); - String[] files = newCompilationData.list(); - for ( int i = 0, length = files.length; i < length; i++ ) { - compilationData.write( files[i], - newCompilationData.read( files[i] ) ); - } - - // Merge imports - imports.addAll( newPackage.getImports() ); - - // Add invokers - compilationData.putAllInvokers( newCompilationData.getInvokers() ); - - // Add globals - for ( Iterator it = globals.keySet().iterator(); it.hasNext(); ) { - String identifier = (String) it.next(); - Class type = (Class) globals.get( identifier ); - if ( globals.containsKey( identifier ) && !globals.get( identifier ).equals( type ) ) { - throw new PackageIntegrationException( "Unable to merge new Package", - newPackage ); - } - } - } - - /** * Creates leaps rule wrappers and propagate rule to the working memories * * @param rule @@ -243,57 +104,46 @@ */ public void addRule(Rule rule) throws FactException, InvalidPatternException { - if ( !rule.isValid() ) { - throw new IllegalArgumentException( "The rule called " + rule.getName() + " is not valid. Check for compile errors reported." ); - } + super.addRule(rule); + List rules = Builder.processRule( rule ); this.leapsRules.put( rule, rules ); - for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + for ( Iterator it = this.getWorkingMemories().iterator(); it.hasNext(); ) { ((WorkingMemoryImpl) it.next()).addLeapsRules( rules ); } // Iterate each workingMemory and attempt to fire any rules, that were // activated as a result of the new rule addition - for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + for ( Iterator it = this.getWorkingMemories().iterator(); it.hasNext(); ) { WorkingMemoryImpl workingMemory = (WorkingMemoryImpl) it.next(); workingMemory.fireAllRules(); } } public void removeRule(Rule rule) { - for ( Iterator it = this.workingMemories.keySet().iterator(); it.hasNext(); ) { + for ( Iterator it = this.getWorkingMemories().iterator(); it.hasNext(); ) { ((WorkingMemoryImpl) it.next()).removeRule( (List) this.leapsRules.remove( rule ) ); } } - public Set getWorkingMemories() { - return this.workingMemories.keySet(); - } - /** - * This is to allow the RuleBase to be serializable. + * Handles the read serialization of the Package. Patterns in Rules may reference generated data which cannot be serialized by default methods. + * The Package uses PackageCompilationData to hold a reference to the generated bytecode; which must be restored before any Rules. + * A custom ObjectInputStream, able to resolve classes against the bytecode in the PackageCompilationData, is used to restore the Rules. + * */ - private void readObject(ObjectInputStream is) throws ClassNotFoundException, - IOException, - Exception { - //always perform the default de-serialization first - is.defaultReadObject(); + public void readExternal(ObjectInput stream) throws IOException, + ClassNotFoundException { + super.readExternal(stream); - this.leapsRules = new HashMap(); - this.globalDeclarations = new HashMap(); - this.workingMemories = new WeakHashMap(); + for (int i = 0; i < this.getPackages( ).length; i++) { + Rule[] rules = this.getPackages( )[i].getRules(); - Package[] packages = this.getPackages(); - this.rulesPackages.clear(); - for ( int i = 0; i < packages.length; i++ ) { - this.addPackage( packages[i] ); - Rule[] rules = packages[i].getRules(); - - for ( int k = 0; k < rules.length; k++ ) { - addRule( rules[k] ); + for ( int j = 0; j < rules.length; ++j ) { + addRule( rules[j] ); } } } Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleHandle.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleHandle.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/RuleHandle.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -28,11 +28,8 @@ // ce position for which handle is created private final int dominantPosition; - public RuleHandle(long id, - LeapsRule rule, - int dominantPosition) { - super( id, - rule ); + public RuleHandle(long id, LeapsRule rule, int dominantPosition) { + super( id, rule ); this.dominantPosition = dominantPosition; } @@ -67,14 +64,16 @@ /** * @see java.lang.Object */ - public boolean equals(Object that) { - return super.equals( that ) && (this.getDominantPosition() == ((RuleHandle) that).getDominantPosition()); + public boolean equals( Object that ) { + return super.equals( that ) + && ( this.getDominantPosition( ) == ( (RuleHandle) that ).getDominantPosition( ) ); } /** * @see java.lang.Object */ public String toString() { - return "R-" + this.getId() + " \"" + this.getLeapsRule().toString() + "\" [pos - " + this.dominantPosition + "]"; + return "R-" + this.getId( ) + " \"" + this.getLeapsRule( ).toString( ) + + "\" [pos - " + this.dominantPosition + "]"; } -} \ No newline at end of file +} Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/TokenEvaluator.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/TokenEvaluator.java 2006-05-02 09:42:31 UTC (rev 4038) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/leaps/TokenEvaluator.java 2006-05-02 12:35:52 UTC (rev 4039) @@ -181,37 +181,33 @@ * @return * @throws Exception */ - final static boolean processAfterAllPositiveConstraintOk(LeapsTuple tuple, + final static boolean processAfterAllPositiveConstraintOk( LeapsTuple tuple, LeapsRule leapsRule, - WorkingMemoryImpl workingMemory) { - if ( leapsRule.containsEvalConditions() && !TokenEvaluator.evaluateEvalConditions( leapsRule, - tuple, - workingMemory ) ) { + WorkingMemoryImpl workingMemory ) { + if (leapsRule.containsEvalConditions( ) + && !TokenEvaluator.evaluateEvalConditions( leapsRule, tuple, workingMemory )) { return false; } - if ( leapsRule.containsExistsColumns() ) { - TokenEvaluator.evaluateExistsConditions( tuple, - leapsRule, - workingMemory ); + if (leapsRule.containsExistsColumns( )) { + TokenEvaluator.evaluateExistsConditions( tuple, leapsRule, workingMemory ); } - if ( leapsRule.containsNotColumns() ) { - TokenEvaluator.evaluateNotConditions( tuple, - leapsRule, - workingMemory ); + if (leapsRule.containsNotColumns( )) { + TokenEvaluator.evaluateNotConditions( tuple, leapsRule, workingMemory ); } // put tuple onto fact tables that might affect activation status // via exists or not conditions - Class[] classes = leapsRule.getExistsNotColumnsClasses(); - for ( int i = 0, length = classes.length; i < length; i++ ) { + Class[] classes = leapsRule.getExistsNotColumnsClasses( ); + for (int i = 0, length = classes.length; i < length; i++) { workingMemory.getFactTable( classes[i] ).addTuple( tuple ); } // - if ( tuple.isReadyForActivation() ) { + if (tuple.isReadyForActivation( )) { // let agenda to do its work ... [truncated message content] |
From: <jbo...@li...> - 2006-05-02 09:42:50
|
Author: aron.gombas Date: 2006-05-02 05:42:31 -0400 (Tue, 02 May 2006) New Revision: 4038 Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/cc_monitoring_ja.properties labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_ja.properties labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sf_monitoring_ja.properties labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_ja.properties labs/kosmos/trunk/web-portlet/WEB-INF/classes/kosmos-taglib_ja.properties Modified: labs/kosmos/trunk/build/build.xml labs/kosmos/trunk/web-portlet/WEB-INF/portlet.xml Log: "ja" res bundles added Modified: labs/kosmos/trunk/build/build.xml =================================================================== --- labs/kosmos/trunk/build/build.xml 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/build/build.xml 2006-05-02 09:42:31 UTC (rev 4038) @@ -77,6 +77,8 @@ <native2ascii encoding="ISO-8859-1" src="${taglib.i18n.dir}" dest="${dist-bin.classes.dir}" includes="**/kosmos-taglib_fr.properties"/> <native2ascii encoding="ISO-8859-2" src="${i18n.dir}" dest="${dist-bin.classes.dir}/hu/midori/kosmos/${module.name}" includes="**/*monitoring_hu.properties"/> <native2ascii encoding="ISO-8859-2" src="${taglib.i18n.dir}" dest="${dist-bin.classes.dir}" includes="**/kosmos-taglib_hu.properties"/> + <native2ascii encoding="ISO-8859-2" src="${i18n.dir}" dest="${dist-bin.classes.dir}/hu/midori/kosmos/${module.name}" includes="**/*monitoring_ja.properties"/> + <native2ascii encoding="ISO-8859-2" src="${taglib.i18n.dir}" dest="${dist-bin.classes.dir}" includes="**/kosmos-taglib_ja.properties"/> <native2ascii encoding="ISO-8859-2" src="${i18n.dir}" dest="${dist-bin.classes.dir}/hu/midori/kosmos/${module.name}" includes="**/*monitoring_pl.properties"/> <native2ascii encoding="ISO-8859-2" src="${taglib.i18n.dir}" dest="${dist-bin.classes.dir}" includes="**/kosmos-taglib_pl.properties"/> <!-- copy other binary files --> Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/cc_monitoring_ja.properties =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/cc_monitoring_ja.properties 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/cc/cc_monitoring_ja.properties 2006-05-02 09:42:31 UTC (rev 4038) @@ -0,0 +1,37 @@ +# $Id$ + +portlet.title=CruiseControl \u76e3\u8996 +portlet.help=\u3053\u306e\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306f\u3001<a href="http://cruisecontrol.sourceforge.net">CruiseControl</a> \u306b\u3088\u3063\u3066\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u7d99\u7d9a\u7684\u306a\u7d71\u5408\u30d3\u30eb\u30c9\u3092\u76e3\u8996\u3057\u307e\u3059\u3002<br/>\u6a5f\u80fd\u3084\u8a2d\u5b9a\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f \u30de\u30cb\u30e5\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 + +ccproject.name=Project +ccproject.lastBuildLabel=\u30d3\u30eb\u30c9 \u30e9\u30d9\u30eb +ccproject.modifications=\u4fee\u6b63 +ccproject.status=\u30b9\u30c6\u30fc\u30bf\u30b9 +ccproject.successRate=\u30c6\u30b9\u30c8\u6210\u529f\u7387 +ccproject.testDetails=\u30c6\u30b9\u30c8\u8a73\u7d30 +ccproject.timestamp=\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7 +ccproject.lastBuildAge=\u6700\u7d42\u30d3\u30eb\u30c9\u304b\u3089\u7d4c\u904e\u6642\u9593 + +ccproject.buildTime=\u30d3\u30eb\u30c9\u6642\u9593 +ccproject.testsSucceded=\u30c6\u30b9\u30c8\u6210\u529f +ccproject.failures=\u5931\u6557 +ccproject.errors=\u30a8\u30e9\u30fc +ccproject.tests=\u30c6\u30b9\u30c8 \u30c8\u30fc\u30bf\u30eb +ccproject.testsPerCategory=\u30c6\u30b9\u30c8\u6210\u529f\u7387 + +legend.title=\u8aac\u660e\u6587 +legend.success=\u30d3\u30eb\u30c9\u3068\u30c6\u30b9\u30c8\u304c\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +legend.warning=\u554f\u984c\u3068\u30a8\u30e9\u30fc\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u30d3\u30eb\u30c9\u3068\u30c6\u30b9\u30c8\u304c\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +legend.error=\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +legend.buildSuccess=\u30d3\u30eb\u30c9\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +legend.buildError=\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +legend.testSuccess=\u30c6\u30b9\u30c8\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +legend.testWarning=\u30c6\u30b9\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +legend.testError=\u30c6\u30b9\u30c8\u306b\u30a8\u30e9\u30fc\u304c\u3042\u308a\u307e\u3059\u3002 + +lastupdate=\u6700\u7d42\u66f4\u65b0\u65e5 + +action.refresh=\u6700\u65b0\u3092\u8868\u793a +action.back=\u623b\u308b +action.show=\u8868\u793a +action.showAll=\u5168\u3066\u3092\u8868\u793a Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_ja.properties =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_ja.properties 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/jira/jira_monitoring_ja.properties 2006-05-02 09:42:31 UTC (rev 4038) @@ -0,0 +1,42 @@ +# $Id$ + +portlet.title=JIRA \u76e3\u8996 +portlet.help=\u3053\u306e\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306f\u3001<a href="http://www.atlassian.com/software/jira">JIRA</a> \u5185\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u76e3\u8996\u3057\u307e\u3059\u3002<br/>\u6a5f\u80fd\u3084\u8a2d\u5b9a\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f \u30de\u30cb\u30e5\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 + +jiraproject.name=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 +jiraproject.projectDetails=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u8a73\u7d30 +jiraproject.key=\u30ad\u30fc +jiraproject.lead=\u62c5\u5f53\u8005 +jiraproject.assignees=\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u305f\u4eba +jiraproject.assigneeDetails=\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u305f\u4eba\u306e\u8a73\u7d30 +jiraproject.issueDetails=\u554f\u984c\u70b9\u306e\u8a73\u7d30 + +jiraproject.description=\u958b\u8a2d +jiraproject.projectUrl=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30b5\u30a4\u30c8 +jiraproject.issuesByStatus=\u30b9\u30c6\u30fc\u30bf\u30b9\u5225 \u554f\u984c\u70b9 + +jiraproject.openIssues=\u30aa\u30fc\u30d7\u30f3 +jiraproject.codingInProgressIssues=\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d +jiraproject.reopenedIssues=\u518d\u30aa\u30fc\u30d7\u30f3 +jiraproject.resolvedIssues=\u89e3\u6c7a\u6e08 +jiraproject.closedIssues=\u30af\u30ed\u30fc\u30ba\u6e08 + +jiraproject.openIssuesByPriority=\u512a\u5148\u5ea6\u5225 \u30aa\u30fc\u30d7\u30f3\u4e2d\u306e\u554f\u984c\u70b9 +jiraproject.openIssuesByAssignee=\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u305f\u4eba\u5225 \u30aa\u30fc\u30d7\u30f3\u4e2d\u306e\u554f\u984c\u70b9 + +jiraproject.blockerOpenIssues=Blocker +jiraproject.criticalOpenIssues=Critical +jiraproject.majorOpenIssues=Major +jiraproject.minorOpenIssues=Minor +jiraproject.trivialOpenIssues=Trivial +jiraproject.optionalOpenIssues=Optional + +legend.title=\u8aac\u660e +legend.warning=\u30aa\u30fc\u30d7\u30f3\u4e2d\u306e\u554f\u984c\u70b9\u304c\u591a\u3059\u304e\u307e\u3059\u3002 + +lastupdate=\u6700\u7d42\u66f4\u65b0\u65e5 + +action.refresh=\u6700\u65b0\u3092\u8868\u793a +action.back=\u623b\u308b +action.show=\u8868\u793a +action.showAll=\u5168\u3066\u3092\u8868\u793a Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sf_monitoring_ja.properties =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sf_monitoring_ja.properties 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/sf/sf_monitoring_ja.properties 2006-05-02 09:42:31 UTC (rev 4038) @@ -0,0 +1,18 @@ +# $Id$ + +portlet.title=SourceForge \u76e3\u8996 +portlet.help=\u3053\u306e\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306f\u3001<a href="http://www.sourceforge.net">SourceForge</a> \u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u76e3\u8996\u3057\u307e\u3059\u3002<br/>\u6a5f\u80fd\u3084\u8a2d\u5b9a\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f \u30de\u30cb\u30e5\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 + +sfRelease.packageName=\u30d1\u30c3\u30b1\u30fc\u30b8 +sfRelease.version=\u30d0\u30fc\u30b8\u30e7\u30f3 +sfRelease.date=\u65e5\u4ed8 +sfRelease.age=\u7d4c\u904e\u6642\u9593 + +legend.title=\u8aac\u660e +legend.new=\u65b0\u3057\u3044\u30ea\u30ea\u30fc\u30b9\u3067\u3059. +legend.old=\u30a2\u30af\u30c6\u30a3\u30d6\u3067\u306f\u306a\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 + +lastupdate=\u6700\u7d42\u66f4\u65b0\u65e5 + +action.refresh=\u6700\u65b0\u3092\u8868\u793a +action.back=\u623b\u308b Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_ja.properties =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_ja.properties 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/classes/hu/midori/kosmos/portlet/svn/svn_monitoring_ja.properties 2006-05-02 09:42:31 UTC (rev 4038) @@ -0,0 +1,44 @@ +# $Id$ + +portlet.title=Subversion \u76e3\u8996 +portlet.help=\u3053\u306e\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306f\u3001 <a href="http://subversion.tigris.org/">Subversion</a> \u7ba1\u7406\u4e0b\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u76e3\u8996\u3057\u307e\u3059\u3002<br/>\u6a5f\u80fd\u3084\u8a2d\u5b9a\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f \u30de\u30cb\u30e5\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 + +svnrepository.location=\u30ea\u30dd\u30b8\u30c8\u30ea\u914d\u7f6e +svnrepository.repositoryDetails=\u30ea\u30dd\u30b8\u30c8\u30ea \u8a73\u7d30 +svnrepository.revision=\u30ea\u30d3\u30b8\u30e7\u30f3 +svnrepository.revisionDetails=\u30ea\u30d3\u30b8\u30e7\u30f3 \u8a73\u7d30 +svnrepository.committerDetails=\u30b3\u30df\u30c3\u30c8\u8005 \u8a73\u7d30 +svnrepository.activityLast7Days=\u76f4\u8fd1\uff17\u65e5\u9593\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3 +svnrepository.activityDetails=\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u8a73\u7d30 +svnrepository.latestTouchDate=\u76f4\u8fd1\u306e\u66f4\u65b0 +svnrepository.latestTouchAge=\u76f4\u8fd1\u306e\u66f4\u65b0\u304b\u3089\u306e\u7d4c\u904e\u6642\u9593 + +svnrepository.dirs=\u30d5\u30a9\u30eb\u30c0 +svnrepository.files=\u30d5\u30a1\u30a4\u30eb +svnrepository.totalRepositoryEntries=\u5168 \u30ea\u30dd\u30b8\u30c8\u30ea\u30a8\u30f3\u30c8\u30ea +svnrepository.totalFileSize=\u5408\u8a08\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba +svnrepository.repositoryEntryHistory=\u30ea\u30dd\u30b8\u30c8\u30ea\u30a8\u30f3\u30c8\u30ea \u5c65\u6b74 +svnrepository.filesByFileType=\u30d5\u30a1\u30a4\u30eb\u7a2e\u5225 + +svnrepository.mostActiveCommitters=\u6700\u3082\u4f5c\u696d\u3057\u305f\u30b3\u30df\u30c3\u30c8\u8005 +svnrepository.mostActiveFiles=\u6700\u3082\u4f7f\u7528\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb + +svnrepository.commitsTotal=\u5168\u30b3\u30df\u30c3\u30c8 +svnrepository.commitsToday=\u4eca\u65e5\u306e\u30b3\u30df\u30c3\u30c8 +svnrepository.commitsLast7Days=\u76f4\u8fd1\uff17\u65e5\u9593\u306e\u30b3\u30df\u30c3\u30c8 +svnrepository.commitsLast31Days=\u76f4\u8fd1\uff13\uff11\u65e5\u9593\u306e\u30b3\u30df\u30c3\u30c8 +svnrepository.committersTotal=\u5168\u30b3\u30df\u30c3\u30c8\u8005 +svnrepository.committersToday=\u4eca\u65e5\u306e\u30b3\u30df\u30c3\u30c8\u8005 +svnrepository.committersLast7Days=\u76f4\u8fd1\uff17\u65e5\u9593\u306e\u30b3\u30df\u30c3\u30c8\u8005 +svnrepository.committersLast31Days=\u76f4\u8fd1\uff13\uff11\u65e5\u9593\u306e\u30b3\u30df\u30c3\u30c8\u8005 +svnrepository.commitHistory=\u30b3\u30df\u30c3\u30c8\u5c65\u6b74 + +legend.title=\u8aac\u660e +legend.old=\u30a2\u30af\u30c6\u30a3\u30d6\u3067\u306f\u306a\u3044\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u3059\u3002 + +lastupdate=\u6700\u7d42\u66f4\u65b0\u65e5 + +action.refresh=\u6700\u65b0\u306e\u8868\u793a +action.back=\u623b\u308b +action.show=\u8868\u793a +action.showAll=\u5168\u3066\u3092\u8868\u793a Added: labs/kosmos/trunk/web-portlet/WEB-INF/classes/kosmos-taglib_ja.properties =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/classes/kosmos-taglib_ja.properties 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/classes/kosmos-taglib_ja.properties 2006-05-02 09:42:31 UTC (rev 4038) @@ -0,0 +1,8 @@ +# $Id$ + +age.minutes=\u5206 +age.hours=\u6642 +age.days=\u65e5 +age.weeks=\u9031 +age.months=\u6708 +age.years=\u5e74 Modified: labs/kosmos/trunk/web-portlet/WEB-INF/portlet.xml =================================================================== --- labs/kosmos/trunk/web-portlet/WEB-INF/portlet.xml 2006-05-02 09:31:30 UTC (rev 4037) +++ labs/kosmos/trunk/web-portlet/WEB-INF/portlet.xml 2006-05-02 09:42:31 UTC (rev 4038) @@ -29,6 +29,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.cc.cc_monitoring</resource-bundle> <portlet-info> @@ -63,6 +64,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.cc.cc_monitoring</resource-bundle> <portlet-info> @@ -97,6 +99,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle> <portlet-info> @@ -132,6 +135,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle> <portlet-info> @@ -167,6 +171,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle> <portlet-info> @@ -199,6 +204,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle> <portlet-info> @@ -236,6 +242,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle> <portlet-info> @@ -268,6 +275,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle> <portlet-info> @@ -300,6 +308,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle> <portlet-info> @@ -334,6 +343,7 @@ <supported-locale>en</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>hu</supported-locale> + <supported-locale>ja</supported-locale> <supported-locale>pl</supported-locale> <resource-bundle>hu.midori.kosmos.portlet.svn.svn_monitoring</resource-bundle> <portlet-info> |
From: <jbo...@li...> - 2006-05-02 09:31:36
|
Author: mic...@jb... Date: 2006-05-02 05:31:30 -0400 (Tue, 02 May 2006) New Revision: 4037 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: autoboxing Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-05-02 09:14:42 UTC (rev 4036) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-05-02 09:31:30 UTC (rev 4037) @@ -870,5 +870,17 @@ <para>Grouping is similar to using parentheses in algebra, it makes the order of operations explicit.</para> </section> + </section> + + <section> + <title>A note on autoboxing and primitive types</title> + <para> + Java 5 supports autoboxing and unboxing between primitives of appropraite types. This makes for very convenience and easier to read code. However, as drools runs in J2SE 1.4 as well, we can't rely on this. Thus we have to autobox at times. Fields that are referred to are autoboxed in the corresponding object type automatically (if they are already an object, then there is no change). However, it is important to note that they are not "unboxed" automatically. Thus if you bind to a field that is an "int" in your object model, it will behave like an Object in the rule (ie predicates, return value constraints and the RHS). + </para> + <para> + As a general rule, if possible, make your fields object types (at least until java 5), or at least think of your fields as object types even if they are not to start with). Another special note, is that for return value constraints, the return value snippet of code must return an Object (not a primitive). + Now, I bet you can't wait for Java 5 to be the minimum ! + </para> + </section> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 09:14:48
|
Author: mic...@jb... Date: 2006-05-02 05:14:42 -0400 (Tue, 02 May 2006) New Revision: 4036 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-02 09:03:53 UTC (rev 4035) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-02 09:14:42 UTC (rev 4036) @@ -2,9 +2,17 @@ <section> <title>Getting the examples</title> - <para>Some examples are included as "integration tests" in the Drools source code. On top of these, you can download the drools-examples module. This module is always having more samples added to it by users. A simple way to try it out is to use the Rule Workbench (Eclipse 3.2 + the plugin), and load up the drools-examples project (it has an eclipse project already setup). The rules all have example classes that execute the rules.</para> + <para>Some examples are included as "integration tests" in the Drools source + code. On top of these, you can download the drools-examples module. This + module is always having more samples added to it by users. The example + project in eclipse requires that you have the plugin instilled: load up the + drools-examples project (it has an eclipse project already setup). The rules + all have example classes that execute the rules. If you want to try the + examples in another project (or another IDE) then you will need to setup the + dependencies by hand of course.</para> - <para>The examples can be found at http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/ (you can browse online, or use a subversion client and download the project into Eclipse</para> - - + <para>The examples can be found at + http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/ (you + can browse online, or use a subversion client and download the project into + Eclipse</para> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 09:04:06
|
Author: mic...@jb... Date: 2006-05-02 05:03:53 -0400 (Tue, 02 May 2006) New Revision: 4035 Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml Removed: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-State_Example.xml Modified: labs/jbossrules/trunk/documentation/manual/en/master.xml Log: more goodness Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-02 08:03:25 UTC (rev 4034) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml 2006-05-02 09:03:53 UTC (rev 4035) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<section> + <title>Getting the examples</title> + + <para>Some examples are included as "integration tests" in the Drools source code. On top of these, you can download the drools-examples module. This module is always having more samples added to it by users. A simple way to try it out is to use the Rule Workbench (Eclipse 3.2 + the plugin), and load up the drools-examples project (it has an eclipse project already setup). The rules all have example classes that execute the rules.</para> + + <para>The examples can be found at http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/ (you can browse online, or use a subversion client and download the project into Eclipse</para> + + +</section> \ No newline at end of file Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-Examples.xml ___________________________________________________________________ Name: svn:eol-style + native Deleted: labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-State_Example.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-State_Example.xml 2006-05-02 08:03:25 UTC (rev 4034) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Examples/Section-State_Example.xml 2006-05-02 09:03:53 UTC (rev 4035) @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<section> - <title>State Example</title> - - <para>uuuere</para> - - -</section> \ No newline at end of file Modified: labs/jbossrules/trunk/documentation/manual/en/master.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/master.xml 2006-05-02 08:03:25 UTC (rev 4034) +++ labs/jbossrules/trunk/documentation/manual/en/master.xml 2006-05-02 09:03:53 UTC (rev 4035) @@ -5,7 +5,7 @@ <subtitle>Drools Documentation</subtitle> - <releaseinfo>3.0-RC-2</releaseinfo> + <releaseinfo>3.0</releaseinfo> <author> <firstname>Mark</firstname> @@ -133,7 +133,7 @@ <chapter> <title>Examples</title> - <xi:include href="Chapter-Examples/Section-State_Example.xml" /> + <xi:include href="Chapter-Examples/Section-Examples.xml" /> </chapter> <chapter> |
From: <jbo...@li...> - 2006-05-02 08:03:32
|
Author: mic...@jb... Date: 2006-05-02 04:03:25 -0400 (Tue, 02 May 2006) New Revision: 4034 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml 2006-05-02 07:34:20 UTC (rev 4033) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml 2006-05-02 08:03:25 UTC (rev 4034) @@ -20,7 +20,7 @@ <para>Alternatively, you can download the binary distribution, and include the relevant jars in your projects classpath.</para> - <para /> + <para></para> <section> <title>Dependencies and jars</title> @@ -77,6 +77,11 @@ provides runtime compiling capability, "POI" which provides the spreadsheet parsing ability, and "antlr" which provides the parsing for the rule language itself.</para> + + <para>NOTE: if you are using Drools in J2EE or servlet containers and you + come across classpath issues with "JDT", then you can switch to the janino + compiler. Set the system property "drools.compiler": For example: + -Ddrools.compiler=JANINO.</para> </section> <section> @@ -93,169 +98,151 @@ environments.</para> </section> - <section> - <title>Installing IDE (Rule Workbench)</title> - <para>The rule workbench (for Eclipse) requires that you have eclipse 3.2 or greater. You can install it either by downloading the plugin or, or using the update site.</para> + <title>Installing IDE (Rule Workbench)</title> - <section> - <title>Installing from zip file</title> - <para> - To install from the zip file, download and unzip the file. Inside the zip you will see a plugin directory, and the plugin jar itself. You place the plugin jar into your eclipse applications plugin directory, and restart eclipse. - </para> - </section> + <para>The rule workbench (for Eclipse) requires that you have eclipse 3.2 + or greater. You can install it either by downloading the plugin or, or + using the update site.</para> - <section> - <title>Installing from the update site</title> - <para>Using the update site is a handy way to install the plug in, and keep it up to date (the eclipse platform will check for updates as needed). It gives you a good chance of staying up to date with improvements, fixes etc.</para> - <para>Some firewalls may cause trouble with using update sites in eclipse, if you have issues, then install it manually from the plugin. Also, if you have previously installed the plug in manually, you will need to manually remove it from your plug in directory.</para> + <section> + <title>Installing from zip file</title> - <para>Step 1. Use the eclipse help menu to fine the feature installer. - <screenshot> - <screeninfo>Access the software updates menu</screeninfo> + <para>To install from the zip file, download and unzip the file. Inside + the zip you will see a plugin directory, and the plugin jar itself. You + place the plugin jar into your eclipse applications plugin directory, + and restart eclipse.</para> + </section> - <mediaobject> - <imageobject> - <imagedata fileref="help_menu.png" /> - </imageobject> - </mediaobject> - </screenshot> + <section> + <title>Installing from the update site</title> - - </para> + <para>Using the update site is a handy way to install the plug in, and + keep it up to date (the eclipse platform will check for updates as + needed). It gives you a good chance of staying up to date with + improvements, fixes etc.</para> - <para>Step 2: Choose the option for installing a new feature (obviously in future, if you want to check for updates, you use the other option !). - <screenshot> - <screeninfo>Search for new features</screeninfo> + <para>Some firewalls may cause trouble with using update sites in + eclipse, if you have issues, then install it manually from the plugin. + Also, if you have previously installed the plug in manually, you will + need to manually remove it from your plug in directory.</para> - <mediaobject> - <imageobject> - <imagedata fileref="search_new_features.png" /> - </imageobject> - </mediaobject> - </screenshot> + <para>Step 1. Use the eclipse help menu to fine the feature installer. + <screenshot> + <screeninfo>Access the software updates menu</screeninfo> - </para> + <mediaobject> + <imageobject> + <imagedata fileref="help_menu.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <para>Step 3: This screen will show what update sites are already configured for your Eclipse instance. - <screenshot> - <screeninfo>Update sites</screeninfo> + <para>Step 2: Choose the option for installing a new feature (obviously + in future, if you want to check for updates, you use the other option + !). <screenshot> + <screeninfo>Search for new features</screeninfo> - <mediaobject> - <imageobject> - <imagedata fileref="update_sites_existing.png" /> - </imageobject> - </mediaobject> - </screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="search_new_features.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - </para> + <para>Step 3: This screen will show what update sites are already + configured for your Eclipse instance. <screenshot> + <screeninfo>Update sites</screeninfo> - <para>Step 4: This screen is where you enter in the remote site details. You give it a name eg "JBoss Rules" and the url. + <mediaobject> + <imageobject> + <imagedata fileref="update_sites_existing.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <programlisting>URL: http://anonsvn.labs.jboss.com/labs/jbossrules/updates/drools-ide-update/</programlisting> + <para>Step 4: This screen is where you enter in the remote site details. + You give it a name eg "JBoss Rules" and the url. <programlisting>URL: http://anonsvn.labs.jboss.com/labs/jbossrules/updates/drools-ide-update/</programlisting> + <screenshot> + <screeninfo>New remote site</screeninfo> - <screenshot> - <screeninfo>New remote site</screeninfo> + <mediaobject> + <imageobject> + <imagedata fileref="new_remote_site.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <mediaobject> - <imageobject> - <imagedata fileref="new_remote_site.png" /> - </imageobject> - </mediaobject> - </screenshot> + <para>Step 5: Select the new update site you just added. Eclipse will + remember this for when it checks for updates automatically in the + future. <screenshot> + <screeninfo>Choose the newly added update site</screeninfo> - </para> + <mediaobject> + <imageobject> + <imagedata fileref="update_sites.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <para>Step 5: Select the new update site you just added. Eclipse will remember this for when it checks for updates automatically in the future. + <para>Step 6: You should see the available features (Drools IDE) + retrieved from the update site. <screenshot> + <screeninfo>Available features</screeninfo> - <screenshot> - <screeninfo>Choose the newly added update site</screeninfo> + <mediaobject> + <imageobject> + <imagedata fileref="search_results.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <mediaobject> - <imageobject> - <imagedata fileref="update_sites.png" /> - </imageobject> - </mediaobject> - </screenshot> + <para>Step 7: The licence agreement. Choose the option to accept the + licence agreement. Once this happens, the workbench will start + downloading. Might be an opportune time to go have a coffee. <screenshot> + <screeninfo>Licence</screeninfo> - </para> + <mediaobject> + <imageobject> + <imagedata fileref="licence.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <para>Step 6: You should see the available features (Drools IDE) retrieved from the update site. + <para>Step 8: Confirm that this is the feature you want. <screenshot> + <screeninfo>Confirmation</screeninfo> - <screenshot> - <screeninfo>Available features</screeninfo> + <mediaobject> + <imageobject> + <imagedata fileref="confirm.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <mediaobject> - <imageobject> - <imagedata fileref="search_results.png" /> - </imageobject> - </mediaobject> - </screenshot> + <para>Step 9: Press Accept to accept the fact that the feature is not + digitally signed. No one signs their features, its a silly default + screen in Eclipse. <screenshot> + <screeninfo>Verify</screeninfo> - </para> + <mediaobject> + <imageobject> + <imagedata fileref="digital_sign.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <para>Step 7: The licence agreement. Choose the option to accept the licence agreement. Once this happens, the workbench will start downloading. Might be an opportune time to go have a coffee. + <para>Step 10: The workbench will need to restart now for the feature to + take effect. <screenshot> + <screeninfo>Restart the workbench</screeninfo> - <screenshot> - <screeninfo>Licence</screeninfo> + <mediaobject> + <imageobject> + <imagedata fileref="restart.png" /> + </imageobject> + </mediaobject> + </screenshot></para> - <mediaobject> - <imageobject> - <imagedata fileref="licence.png" /> - </imageobject> - </mediaobject> - </screenshot> - - </para> - - <para>Step 8: Confirm that this is the feature you want. - - <screenshot> - <screeninfo>Confirmation</screeninfo> - - <mediaobject> - <imageobject> - <imagedata fileref="confirm.png" /> - </imageobject> - </mediaobject> - </screenshot> - - </para> - - <para>Step 9: Press Accept to accept the fact that the feature is not digitally signed. No one signs their features, its a silly default screen in Eclipse. - - <screenshot> - <screeninfo>Verify</screeninfo> - - <mediaobject> - <imageobject> - <imagedata fileref="digital_sign.png" /> - </imageobject> - </mediaobject> - </screenshot> - - </para> - - <para>Step 10: The workbench will need to restart now for the feature to take effect. - - <screenshot> - <screeninfo>Restart the workbench</screeninfo> - - <mediaobject> - <imageobject> - <imagedata fileref="restart.png" /> - </imageobject> - </mediaobject> - </screenshot> - - </para> - - - <para>Now go have another coffee, and then take a look at the chapter on the Rule Workbench for what you can do with it.</para> - - - - </section> + <para>Now go have another coffee, and then take a look at the chapter on + the Rule Workbench for what you can do with it.</para> + </section> </section> - </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 07:34:27
|
Author: mic...@jb... Date: 2006-05-02 03:34:20 -0400 (Tue, 02 May 2006) New Revision: 4033 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Agenda.xml Log: more goodness Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Agenda.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Agenda.xml 2006-05-02 06:13:36 UTC (rev 4032) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-Agenda.xml 2006-05-02 07:34:20 UTC (rev 4033) @@ -2,24 +2,71 @@ <section> <title>Agenda</title> - <para>The agenda is a RETE feature. It is an area where rules + matching - facts are kept before they are fired.</para> + <para>The agenda is a RETE feature. It is an area in memory where rules + + matching facts are kept before they are fired.</para> + <para>The engine operates in a "2 phase" mode: 1) working memory actions + (this is where most of the work takes place) and 2) agenda evaluation (where + rule actions are fired). It is important to note that this process is + recursive, in that a rule firing may cause working memory actions to occur. + When working memory actions are taking place, no rules are being fired. + </para> + + <para>The items that are placed on the agenda are called "activations" which + are a rule plus matched facts (facts that at that point in time allow the + rule to fire).</para> + + <para>The fileAllRules() method causes the agenda to be evaluated, and + eventually the activations "fired". The process recurses until the agenda is + clear, in which case control returns to the calling application.</para> + + <para>Working memory actions are assertion of new, modification of exsiting + and retraction of facts.These are all triggered from the RHS of a rule, or + in java code.</para> + <section> <title>Conflict Resultion</title> - <para></para> + <para>Conflict resolution is required when there are mutliple rules on the + agenda. As firing a rule may have side effects on working memory, the rule + engine needs to know in what order the rules should fire (for instance, + firing ruleA may cause ruleB to be removed from the agenda).</para> + + <para>Drools employes a variety of strategies here. The most visible one + is "salience" or priority, in which case a user can specify that a certain + rule has a higher priority (by giving it a higher number) then other + rules. In that case, the higher salience rule will always be + preferred.</para> + + <para>As a general rule, it is a good idea not to count on the rules + firing in any particular order, and try and author the rules without + worrying about a "flow". </para> + + <para>The conflict resolution strategies emplyed by drools are: Salience, + FIFO (first in, first out), Total Recency and Load order.</para> + + <para>If salience does not provide a resolution, the FIFO is used (items + that are in the agenda longer are preferred). Failing that totally recency + of the activation (how new the facts are) is used before reverting to the + arbitrary load order (which is nominally the order in which the rules were + declared).</para> </section> <section> <title>Agenda Groups</title> - <para></para> + <para>Agenda groups are a way to partition rules (activations, actually) + on the agenda. At any one time, only one group has "focus" which means + that the activations for rules in that group will only take effect (you + can also have rules "auto focus" which means the focus for its agenda + group it taken when that rules conditions are true).</para> </section> <section> <title>Filters</title> - <para></para> + <para>Filters are optional implementations of a the filter interface which + are used to allow/or deny an activation from firing (what you filter on, + is entirely up to the implementation).</para> </section> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 06:13:41
|
Author: mla...@jb... Date: 2006-05-02 02:13:36 -0400 (Tue, 02 May 2006) New Revision: 4032 Modified: labs/jbossweb/trunk/src/share/native/build/buildworld.sh Log: make depend must be before make Modified: labs/jbossweb/trunk/src/share/native/build/buildworld.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildworld.sh 2006-05-02 05:52:44 UTC (rev 4031) +++ labs/jbossweb/trunk/src/share/native/build/buildworld.sh 2006-05-02 06:13:36 UTC (rev 4032) @@ -28,8 +28,8 @@ ./config --prefix=${TCNATIVE_BIN} --openssldir=${TCNATIVE_BIN}/ssl threads zlib no-krb5 no-rc5 no-mdc2 no-idea no-ec shared ;; esac + make depend make - make depend make install_sw cd .. cd apr-${APRVER} |
From: <jbo...@li...> - 2006-05-02 05:59:58
|
Author: mic...@jb... Date: 2006-05-02 01:52:44 -0400 (Tue, 02 May 2006) New Revision: 4031 Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/confirm.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/digital_sign.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/help_menu.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/licence.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/new_remote_site.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/restart.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_new_features.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_results.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites_existing.png Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml Log: stuff on installing IDEs for folks who forget how to breathe. Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml 2006-05-02 04:40:55 UTC (rev 4030) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Install.xml 2006-05-02 05:52:44 UTC (rev 4031) @@ -93,6 +93,169 @@ environments.</para> </section> - <literallayout> -</literallayout> + + <section> + <title>Installing IDE (Rule Workbench)</title> + <para>The rule workbench (for Eclipse) requires that you have eclipse 3.2 or greater. You can install it either by downloading the plugin or, or using the update site.</para> + + <section> + <title>Installing from zip file</title> + <para> + To install from the zip file, download and unzip the file. Inside the zip you will see a plugin directory, and the plugin jar itself. You place the plugin jar into your eclipse applications plugin directory, and restart eclipse. + </para> + </section> + + <section> + <title>Installing from the update site</title> + <para>Using the update site is a handy way to install the plug in, and keep it up to date (the eclipse platform will check for updates as needed). It gives you a good chance of staying up to date with improvements, fixes etc.</para> + <para>Some firewalls may cause trouble with using update sites in eclipse, if you have issues, then install it manually from the plugin. Also, if you have previously installed the plug in manually, you will need to manually remove it from your plug in directory.</para> + + <para>Step 1. Use the eclipse help menu to fine the feature installer. + <screenshot> + <screeninfo>Access the software updates menu</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="help_menu.png" /> + </imageobject> + </mediaobject> + </screenshot> + + + </para> + + <para>Step 2: Choose the option for installing a new feature (obviously in future, if you want to check for updates, you use the other option !). + <screenshot> + <screeninfo>Search for new features</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="search_new_features.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 3: This screen will show what update sites are already configured for your Eclipse instance. + <screenshot> + <screeninfo>Update sites</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="update_sites_existing.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 4: This screen is where you enter in the remote site details. You give it a name eg "JBoss Rules" and the url. + + <programlisting>URL: http://anonsvn.labs.jboss.com/labs/jbossrules/updates/drools-ide-update/</programlisting> + + <screenshot> + <screeninfo>New remote site</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="new_remote_site.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 5: Select the new update site you just added. Eclipse will remember this for when it checks for updates automatically in the future. + + <screenshot> + <screeninfo>Choose the newly added update site</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="update_sites.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 6: You should see the available features (Drools IDE) retrieved from the update site. + + <screenshot> + <screeninfo>Available features</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="search_results.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 7: The licence agreement. Choose the option to accept the licence agreement. Once this happens, the workbench will start downloading. Might be an opportune time to go have a coffee. + + <screenshot> + <screeninfo>Licence</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="licence.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 8: Confirm that this is the feature you want. + + <screenshot> + <screeninfo>Confirmation</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="confirm.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 9: Press Accept to accept the fact that the feature is not digitally signed. No one signs their features, its a silly default screen in Eclipse. + + <screenshot> + <screeninfo>Verify</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="digital_sign.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + <para>Step 10: The workbench will need to restart now for the feature to take effect. + + <screenshot> + <screeninfo>Restart the workbench</screeninfo> + + <mediaobject> + <imageobject> + <imagedata fileref="restart.png" /> + </imageobject> + </mediaobject> + </screenshot> + + </para> + + + <para>Now go have another coffee, and then take a look at the chapter on the Rule Workbench for what you can do with it.</para> + + + + </section> + </section> + </section> \ No newline at end of file Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/confirm.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/confirm.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/digital_sign.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/digital_sign.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/help_menu.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/help_menu.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/licence.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/licence.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/new_remote_site.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/new_remote_site.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/restart.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/restart.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_new_features.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_new_features.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_results.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/search_results.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites_existing.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/update_sites_existing.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2006-05-02 04:41:05
|
Author: mic...@jb... Date: 2006-05-02 00:40:55 -0400 (Tue, 02 May 2006) New Revision: 4030 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml 2006-05-02 03:10:39 UTC (rev 4029) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml 2006-05-02 04:40:55 UTC (rev 4030) @@ -20,6 +20,9 @@ on Eclipse, and integrators are free to use their tools of choice, as always !</para> + <para>Note you can get the plug in either as a zip to download, or from an + update site (refer to the chapter on installation).</para> + <figure> <title>Overview</title> @@ -564,5 +567,13 @@ <para>Rulesets of 4,000 rules or greater should set the permanent generation to atleast 128Mb.</para> + + <para>(note that this may also apply to compiling large numbers of rules + in general - as there is generally one or more classes per rule).</para> + + <para>As an alternative to the above, you may put rules in a file with the + ".rule" extension, and the background builder will not try to compile them + with each change, which may provide performance improvements if your IDE + becomes sluggish with very large numbers of rules.</para> </section> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-02 03:10:46
|
Author: mic...@jb... Date: 2006-05-01 23:10:39 -0400 (Mon, 01 May 2006) New Revision: 4029 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Eclipse.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Eclipse.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Eclipse.xml 2006-05-02 01:44:46 UTC (rev 4028) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Eclipse.xml 2006-05-02 03:10:39 UTC (rev 4029) @@ -136,6 +136,13 @@ <para>The drools-ide project was checked out out using subversion and is ready for exporting.</para> + <para>NOTE: there is also an update site for the plug in. For developers + who want to update the update site (ha) you will need to open the feature + project, and the site project. They are kept in SVN, but in + /jbossrules/update instead of /trunk. They are plain vanilla eclipse + feature and site projects, so refreshing them should be self explanatory + should you need to do it.</para> + <screenshot> <screeninfo>Select Export on the drools-ide project</screeninfo> |
From: <jbo...@li...> - 2006-05-02 01:44:52
|
Author: mar...@jb... Date: 2006-05-01 21:44:46 -0400 (Mon, 01 May 2006) New Revision: 4028 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/wizard/project/NewDroolsProjectWizard.java Log: -reverted content to previous dir structure Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/wizard/project/NewDroolsProjectWizard.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/wizard/project/NewDroolsProjectWizard.java 2006-05-02 01:31:07 UTC (rev 4027) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/wizard/project/NewDroolsProjectWizard.java 2006-05-02 01:44:46 UTC (rev 4028) @@ -210,8 +210,8 @@ private void addSourceFolders(IJavaProject project, IProgressMonitor monitor) throws JavaModelException, CoreException { List list = new ArrayList(); list.addAll(Arrays.asList(project.getRawClasspath())); - addSourceFolder(project, list, "src/main/java", monitor); - addSourceFolder(project, list, "src/main/rules", monitor); + addSourceFolder(project, list, "src/java", monitor); + addSourceFolder(project, list, "src/rules", monitor); project.setRawClasspath((IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]), null); } |
From: <jbo...@li...> - 2006-05-02 01:31:15
|
Author: mic...@jb... Date: 2006-05-01 21:31:07 -0400 (Mon, 01 May 2006) New Revision: 4027 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.svg Log: JBRULES-227 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-05-02 00:56:59 UTC (rev 4026) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-05-02 01:31:07 UTC (rev 4027) @@ -80,20 +80,20 @@ is executed when the rule fires.</para> <para>There are a few convenience methods you can use to modify working - memory: </para> + memory:</para> <para>"modify(obj);" will tell the engine that an object has changed (one that has been bound to something on the LHS) and rules may need to be - reconsidered. </para> + reconsidered.</para> <para>"assert(new Something());" will place a new object of your creation - in working memory. </para> + in working memory.</para> <para>"assertLogical(new Something());" is similar to assert, but the object will be automatically retracted when there are no more facts to - support the truth of the currently firing rule. </para> + support the truth of the currently firing rule.</para> - <para>"retract(obj);" removes an object from working memory. </para> + <para>"retract(obj);" removes an object from working memory.</para> <para>These convenience methods are basically macros that provide short cuts to the KnowldgeHelper instance (refer to the KnowledgeHelper @@ -300,8 +300,8 @@ </indexterm>Field Constraints. Valid operators are dependent on the field type. Generally they are self explanatory based on the type of data: for instance, for date fields, "<" means "before" and so on. - "Matches" is only applicable to string fields, and "contains" is only - applicable to Collection type fields.</para> + "Matches" is only applicable to string fields, "contains" and + "excludes" is only applicable to Collection type fields.</para> </section> <section> @@ -486,7 +486,7 @@ <para><literal>'contains' </literal>is a special operator that can be used to check if a field's <indexterm> <primary>Collection</primary> - </indexterm>Collection contains a String literal.</para> + </indexterm>Collection contains an object.</para> <example> <title>Literal Cosntraints with Collections</title> @@ -494,6 +494,21 @@ <programlisting>CheeseCounter( cheeses contains "stilton" )</programlisting> </example> </simplesect> + + <simplesect> + <title>Excludes Operator</title> + + <para><literal>'excludes' </literal>is a special operator that can + be used to check if a field's <indexterm> + <primary>Collection</primary> + </indexterm>Collection does not contains an object.</para> + + <example> + <title>Literal Cosntraints with Collections</title> + + <programlisting>CheeseCounter( cheeses excludes "cheddar" )</programlisting> + </example> + </simplesect> </section> <section> Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.png =================================================================== (Binary files differ) Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.svg =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.svg 2006-05-02 00:56:59 UTC (rev 4026) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/operator.svg 2006-05-02 01:31:07 UTC (rev 4027) @@ -1,18 +1,17 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 operator.svg Page-1 --> -<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="3.49458in" - height="0.244444in" viewBox="0 0 251.61 17.6" xml:space="preserve" color-interpolation-filters="sRGB" class="st6"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="3.49457in" + height="0.188644in" viewBox="0 0 251.609 13.5824" xml:space="preserve" color-interpolation-filters="sRGB" class="st5"> <v:documentProperties v:langID="1033" v:metric="true" v:viewMarkup="false"/> <style type="text/css"> <![CDATA[ .st1 {fill:#e8eef7;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st2 {fill:#000000;font-family:Arial;font-size:0.666664em} - .st3 {font-size:1em} - .st4 {marker-end:url(#mrkr2-17);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} - .st5 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.08695652173913} - .st6 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + .st2 {fill:#000000;font-family:Arial;font-size:0.583328em} + .st3 {marker-end:url(#mrkr2-13);stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24} + .st4 {fill:#4677bf;fill-opacity:1;stroke:#4677bf;stroke-opacity:1;stroke-width:0.086956377384407} + .st5 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} ]]> </style> @@ -20,26 +19,25 @@ <g id="lend2"> <path d="M 1 1 L 0 0 L 1 -1 L 1 1 " style="stroke:none"/> </g> - <marker id="mrkr2-17" class="st5" v:arrowType="2" v:arrowSize="2" v:setback="11.5" refX="-11.5" orient="auto" + <marker id="mrkr2-13" class="st4" v:arrowType="2" v:arrowSize="2" v:setback="0" refX="-0" orient="auto" markerUnits="strokeWidth"> - <use xlink:href="#lend2" transform="scale(-11.5,-11.5) "/> + <use xlink:href="#lend2" transform="scale(-11.500019090944,-11.500019090944) "/> </marker> </defs> <g v:mID="0" v:index="1" v:groupContext="foregroundPage"> <title>Page-1</title> - <v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50394" - v:shadowOffsetY="-8.50394"/> + <v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50392" + v:shadowOffsetY="-8.50392"/> <v:layer v:name="Connector" v:index="0"/> <v:layer v:name="Flowchart" v:index="1"/> - <g id="shape68-1" v:mID="68" v:groupContext="shape" v:layerMember="0;1" transform="translate(0.24,-3.06772)"> + <g id="shape1-1" v:mID="1" v:groupContext="shape" v:layerMember="0;1" transform="translate(0.24228,-0.894998)"> <title>On-page reference.210</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <path d="M0 11.87 A5.73228 5.73228 0 0 1 11.46 11.87 A5.73228 5.73228 0 1 1 0 11.87 Z" class="st1"/> + <path d="M0 7.69 A5.73227 5.73227 0 0 1 11.46 7.69 A5.73227 5.73227 0 1 1 0 7.69 Z" class="st1"/> </g> - <g id="shape69-3" v:mID="69" v:groupContext="shape" v:layerMember="1" transform="translate(31.7864,-2.24882)"> + <g id="shape2-3" v:mID="2" v:groupContext="shape" v:layerMember="1" transform="translate(22.6793,-0.24)"> <title>Process.211</title> <desc>'<' | '<=' | '>' | '>=' | '==' | '!=' | ‘matches’ | ‘contains’</desc> <v:custProps> @@ -50,27 +48,25 @@ <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <v:textRect cx="91.3035" cy="11.0488" width="182.61" height="13.1024"/> - <rect x="0" y="4.49764" width="182.607" height="13.1024" rx="2.83465" ry="2.83465" class="st1"/> - <text x="3.6" y="13.45" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>'<' | '<=' | '>' | '>=' | '==' | '!='<tspan - class="st3" v:langID="2057"> | </tspan><tspan class="st3" v:langID="2057">‘matches’ </tspan><tspan - class="st3" v:langID="2057">| </tspan><tspan class="st3" v:langID="2057">‘contains’</tspan></text> </g> - <g id="shape70-10" v:mID="70" v:groupContext="shape" v:layerMember="0;1" transform="translate(239.905,-3.06772)"> + <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5196"/> + <v:textRect cx="97.7952" cy="7.03115" width="195.6" height="13.1024"/> + <path d="M0 10.75 A3.03627 2.83471 -180 0 0 3.04 13.58 L192.55 13.58 A3.03627 2.83471 -180 0 0 195.59 10.75 L195.59 3.31 + A3.03627 2.83471 -180 0 0 192.55 0.48 L3.04 0.48 A3.03627 2.83471 -180 0 0 -0 3.31 L0 10.75 Z" class="st1"/> + <text x="2.84" y="9.13" class="st2" v:langID="1033"><v:paragraph v:horizAlign="1"/><v:tabList/>'<' | '<=' | '>' | '>=' | '==' | '!=' | ‘matches’ | ‘contains’ | ‘excludes’</text> </g> + <g id="shape3-6" v:mID="3" v:groupContext="shape" v:layerMember="0;1" transform="translate(239.907,-0.894998)"> <title>On-page reference.212</title> <v:userDefs> <v:ud v:nameU="visVersion" v:val="VT0(11):26"/> </v:userDefs> - <v:textBlock v:margins="rect(2,2,2,2)" v:tabSpace="42.5197"/> - <path d="M0 11.87 A5.73228 5.73228 0 0 1 11.46 11.87 A5.73228 5.73228 0 1 1 0 11.87 Z" class="st1"/> + <path d="M0 7.69 A5.73227 5.73227 0 0 1 11.46 7.69 A5.73227 5.73227 0 1 1 0 7.69 Z" class="st1"/> </g> - <g id="shape71-12" v:mID="71" v:groupContext="shape" v:layerMember="0" transform="translate(11.7046,-1.71339)"> + <g id="shape4-8" v:mID="4" v:groupContext="shape" v:layerMember="0" transform="translate(11.7069,-6.7946)"> <title>Dynamic connector.213</title> - <path d="M0 10.51 L17.32 10.51" class="st4"/> + <path d="M0 13.58 L9.46 13.58 L10.97 13.58" class="st3"/> </g> - <g id="shape72-18" v:mID="72" v:groupContext="shape" v:layerMember="0" transform="translate(214.393,-1.71339)"> + <g id="shape5-14" v:mID="5" v:groupContext="shape" v:layerMember="0" transform="translate(218.27,-6.7946)"> <title>Dynamic connector.214</title> - <path d="M0 10.51 L22.75 10.51" class="st4"/> + <path d="M0 13.58 L19.29 13.58 L21.63 13.58" class="st3"/> </g> </g> </svg> |
Author: soh...@jb... Date: 2006-05-01 19:41:42 -0400 (Mon, 01 May 2006) New Revision: 4025 Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java 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/view/ViewCategory.java 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.taglib.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/common/common.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml 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/viewtopic_body.xhtml Log: some code cleanup Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java 2006-05-01 23:41:42 UTC (rev 4025) @@ -21,8 +21,11 @@ */ package org.jboss.portlet.forums.ui; +//core java classes import java.util.Map; +import java.util.Iterator; + //logging related import org.apache.log4j.Logger; @@ -40,31 +43,7 @@ public class JSFUtil { private static Logger log = Logger.getLogger(JSFUtil.class); - - /** - * - * @author sshah - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ - public static String handleException(Exception e) - { - String genericNavState = Constants.ERROR; - String msg = e.toString(); - FacesMessage message = new FacesMessage( - FacesMessage.SEVERITY_ERROR,//severity - msg,//summary - msg//detail - ); - FacesContext.getCurrentInstance().addMessage(Constants.ERROR,message); - //spit the stack trace - log.error(JSFUtil.class.getName(),e); - - return genericNavState; - } - /** * * @author sshah @@ -154,4 +133,49 @@ parent.getChildren().remove(component); } } + + /** + * + * @author sshah + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ + public static String handleException(Exception e) + { + String genericNavState = Constants.ERROR; + String msg = e.toString(); + FacesMessage message = new FacesMessage( + FacesMessage.SEVERITY_ERROR,//severity + msg,//summary + msg//detail + ); + FacesContext.getCurrentInstance().addMessage(Constants.ERROR,message); + + //spit the stack trace + log.error(JSFUtil.class.getName(),e); + + return genericNavState; + } + + /** + * + * @return + */ + public static String getErrorMsg() + { + String errorMsg = null; + + Iterator msgs = FacesContext.getCurrentInstance().getMessages(Constants.ERROR); + if(msgs!=null) + { + if(msgs.hasNext()) + { + FacesMessage message = (FacesMessage)msgs.next(); + errorMsg = message.getDetail(); + } + } + + return errorMsg; + } } 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-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java 2006-05-01 23:41:42 UTC (rev 4025) @@ -384,7 +384,7 @@ } catch(Exception e) { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } return navState; } @@ -406,7 +406,7 @@ } catch(Exception e) { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } return navState; } @@ -440,7 +440,7 @@ } catch(Exception e) { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } return navState; } @@ -461,7 +461,7 @@ } catch(Exception e) { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } return navState; } @@ -471,15 +471,15 @@ * @return */ public String preview() - { + { String navState = null; try - { + { this.isPreview = true; } catch(Exception e) { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } return navState; } @@ -561,11 +561,12 @@ { //handle proper validation error with a proper message...not just a generic message.. //just use generic error page for the proof of concept - navState = JSFUtil.handleException(e); + //set the custom exception such that e.toString() results in the proper message + JSFUtil.handleException(e); } else { - navState = JSFUtil.handleException(e); + JSFUtil.handleException(e); } } finally Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java 2006-05-01 23:41:42 UTC (rev 4025) @@ -135,7 +135,7 @@ * this generates the category and its corresponding forums */ private void execute() throws Exception - { + { //try to extract categoryId int categoryId = -1; String c = ForumUtil.getParameter(Constants.p_categoryId); 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-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-01 23:41:42 UTC (rev 4025) @@ -24,14 +24,7 @@ </locale-config> </application> - <!-- generic navigation rules, irrespective of the (from-view-id) --> - <navigation-rule> - <navigation-case> - <from-outcome>error</from-outcome> - <to-view-id>/views/errors/error_body.xhtml</to-view-id> - </navigation-case> - </navigation-rule> - + <!-- configuration for the shared EmptyController --> <managed-bean> <managed-bean-name>shared</managed-bean-name> @@ -67,15 +60,15 @@ <key>posting</key> <value>/views/topics/posting_body.jsf</value> </map-entry> - <map-entry> - <key>profile</key> - <value>/views/profile/viewprofile_body.jsf</value> - </map-entry> - <map-entry> - <key>message</key> - <value>/views/user/usermessage_body.jsf</value> - </map-entry> - </map-entries> + <map-entry> + <key>profile</key> + <value>/views/profile/viewprofile_body.jsf</value> + </map-entry> + <map-entry> + <key>message</key> + <value>/views/profile/usermessage_body.jsf</value> + </map-entry> + </map-entries> </managed-property> </managed-bean> @@ -131,48 +124,56 @@ </navigation-case> </navigation-rule> <navigation-rule> - <from-view-id>/views/topics/posting_body.xhtml.jsp</from-view-id> + <from-view-id>/views/topics/posting_body.xhtml</from-view-id> <!-- straight jsf calls --> <navigation-case> <from-outcome>addOption</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml.jsp</to-view-id> + <to-view-id>/views/topics/posting_body.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>updateOption</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml.jsp</to-view-id> + <to-view-id>/views/topics/posting_body.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>updateAttachment</from-outcome> - <to-view-id>/views/topics/posting_body.xhtml.jsp</to-view-id> + <to-view-id>/views/topics/posting_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/forums/viewforum_body.xhtml.jsp</to-view-id> + <to-view-id>/views/forums/viewforum_body.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>success</from-outcome> - <to-view-id>/views/forums/viewforum_body.xhtml.jsp</to-view-id> + <to-view-id>/views/forums/viewforum_body.xhtml</to-view-id> </navigation-case> </navigation-rule> - <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> - <managed-bean> - <managed-bean-name>jumpbox</managed-bean-name> - <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewJumpbox</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - </managed-bean> - <managed-bean> - <managed-bean-name>profile</managed-bean-name> - <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewProfile</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - </managed-bean> - <managed-bean> - <managed-bean-name>moderator</managed-bean-name> - <managed-bean-class>org.jboss.portlet.forums.ui.action.ModeratorAction</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> + + <!-- 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> + + <!-- managedBean for the jumpbox usecase --> + <managed-bean> + <managed-bean-name>jumpbox</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewJumpbox</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> + + <!-- managedBean for the viewProfile usecase --> + <managed-bean> + <managed-bean-name>profile</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewProfile</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> + + <!-- managedBean for the moderatorPanel usecase --> + <managed-bean> + <managed-bean-name>moderator</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.action.ModeratorAction</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> </faces-config> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2006-05-01 23:41:42 UTC (rev 4025) @@ -10,14 +10,14 @@ <function-name>outputLink</function-name> <function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class> <function-signature>java.lang.String outputLink(java.lang.String,boolean)</function-signature> - </function> + </function> <!-- - function generates the contextPath of the application + function generates String value got from org.jboss.portal.core.CoreConstants --> <function> - <function-name>contextPath</function-name> - <function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class> - <function-signature>java.lang.String getContextPath()</function-signature> + <function-name>userProperty</function-name> + <function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class> + <function-signature>java.lang.String userProperty(java.util.Map,java.lang.String)</function-signature> </function> <!-- function to get constant declarations @@ -34,13 +34,22 @@ <function-name>themeURL</function-name> <function-class>org.jboss.portlet.forums.ui.ThemeHelper</function-class> <function-signature>java.lang.String getURL(java.lang.String)</function-signature> + </function> + <!-- + function generates the contextPath of the application + --> + <function> + <function-name>contextPath</function-name> + <function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class> + <function-signature>java.lang.String getContextPath()</function-signature> </function> - <!-- - function generates String value got from org.jboss.portal.core.CoreConstants + <!-- + function retrieves a generic error message if one is found. + return null if nothing is found --> <function> - <function-name>userProperty</function-name> - <function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class> - <function-signature>java.lang.String userProperty(java.util.Map,java.lang.String)</function-signature> + <function-name>errorMsg</function-name> + <function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class> + <function-signature>java.lang.String getErrorMsg()</function-signature> </function> </facelet-taglib> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml 2006-05-01 23:41:42 UTC (rev 4025) @@ -99,7 +99,7 @@ <mime-type>text/html</mime-type> </supports> <portlet-info> - <title>JSF Forums Demo</title> + <title>JSF Forums</title> </portlet-info> </portlet> </portlet-app> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -30,128 +30,131 @@ xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> -<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> - - <tr> - <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> - &nbsp;#{resource.Forum}&nbsp; - </th> - <th width="50" class="thTop" nowrap="nowrap"> - &nbsp;#{resource.Topics}&nbsp; - </th> - <th width="50" class="thTop" nowrap="nowrap"> - &nbsp;#{resource.Posts}&nbsp; - </th> - <th class="thCornerR" nowrap="nowrap"> - &nbsp;#{resource.Last_Post}&nbsp; - </th> - </tr> - - <!-- display each category and its corresponding forums --> - <c:forEach items="#{category.categories}" var="catrow"> - <!-- TODO: insert security check to make sure "viewing this category" is allowed --> - <tr> - <td class="catLeft" colspan="2" height="28"> - <span class="cattitle"> - <h:outputLink - value="#{forums:outputLink(shared.links['category'],true)}" - styleClass="cattitle"> - <f:param name="c" value="#{catrow.id}"/> - <h:outputText value="#{catrow.title}"/> - </h:outputLink> - </span> - </td> - <td class="rowpic" colspan="3" align="right">&nbsp;</td> - </tr> - <c:forEach items="#{category.forums[catrow.id]}" var="forumrow"> - <!-- TODO: insert security check to make sure "viewing this forum" is allowed --> - <tr> - <td class="row1" align="center" valign="middle" height="50"> - <img src="#{category.forumImages[forumrow.id]}" width="46" height="25" - alt="#{resource[category.forumImageDescriptions[forumrow.id]]}" - title="#{resource[category.forumImageDescriptions[forumrow.id]]}"/> - </td> - <td class="row1" width="100%" height="50"> - <span class="forumlink"> - <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" styleClass="forumlink"> - <f:param name="f" value="#{forumrow.id}"/> - <h:outputText value="#{forumrow.name}"/> - </h:outputLink><br/> - </span> - <span class="genmed">${forumrow.description}<br/></span> - <span class="gensmall">&nbsp;&nbsp;</span> - </td> - <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">${forumrow.topicCount}</span></td> - <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">${forumrow.postCount}</span></td> - <!-- display last post information for this forum --> - <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> - <span class="gensmall"> - <c:if test="#{forumrow.lastPost!=null}"> - <!-- TODO: hookup real data here...need to extract out the hardcoded html code from the original portlet --> - ${forumrow.lastPost.createDate}<br/> - <c:if test="#{category.anonymous}"> - POSTER_INFO - </c:if> - <c:if test="#{!category.anonymous}"> - ${forumrow.lastPost.poster.user.userName} - </c:if> - <!-- TODO: LINK TO LAST POST NEEDED --> - <a href="link to lastPost"><img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/></a> - </c:if> - <c:if test="#{forumrow.lastPost==null}"> - #{resource.No_Posts} - </c:if> - </span> - </td> - </tr> - </c:forEach> - </c:forEach> -</table> - -<!--table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> -<tr> -<td align="left"><span class="gensmall"><a href="" class="gensmall">${n:i18n("Mark_all_forums")}</a></span></td> -<td align="right"><span class="gensmall"></span></td> -</tr> -</table> - -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> -<tr> -<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="" -class="cattitle">${n:i18n("Who_is_Online")}</a></span></td> -</tr> -<tr> -<td class="row1" align="center" valign="middle" rowspan="2"><img -src="modules/bb/templates/subSilver/images/whosonline.gif" alt="${n:i18n("Who_is_Online")}" /></td> -<td class="row1" align="left" width="100%"><span class="gensmall"><br /><br /></span> -</td> -</tr> -<tr> -<td class="row1" align="left"><span class="gensmall"> [ ] [ ]<br /><br /></span></td> -</tr> -</table> - -<table width="100%" cellpadding="1" cellspacing="1" border="0"> -<tr> -<td align="left" valign="top"><span class="gensmall">${n:i18n("Online_explain")}</span></td> -</tr> -</table--> - -<br clear="all"/> - -<table cellspacing="3" border="0" align="center" cellpadding="0"> - <tr> - <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder_new.gif" alt="${resource.New_posts}"/></td> - <td><span class="gensmall">${resource.New_posts}</span></td> - <td>&nbsp;&nbsp;</td> - <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder.gif" alt="${resource.No_new_posts}"/></td> - <td><span class="gensmall">${resource.No_new_posts}</span></td> - <td>&nbsp;&nbsp;</td> - <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder_lock.gif" alt="${resource.Forum_is_locked}"/></td> - <td><span class="gensmall">${resource.Forum_is_locked}</span></td> - </tr> -</table> - +<ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> + + <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> + + <tr> + <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> + &nbsp;#{resource.Forum}&nbsp; + </th> + <th width="50" class="thTop" nowrap="nowrap"> + &nbsp;#{resource.Topics}&nbsp; + </th> + <th width="50" class="thTop" nowrap="nowrap"> + &nbsp;#{resource.Posts}&nbsp; + </th> + <th class="thCornerR" nowrap="nowrap"> + &nbsp;#{resource.Last_Post}&nbsp; + </th> + </tr> + + <!-- display each category and its corresponding forums --> + <c:forEach items="#{category.categories}" var="catrow"> + <!-- TODO: insert security check to make sure "viewing this category" is allowed --> + <tr> + <td class="catLeft" colspan="2" height="28"> + <span class="cattitle"> + <h:outputLink + value="#{forums:outputLink(shared.links['category'],true)}" + styleClass="cattitle"> + <f:param name="c" value="#{catrow.id}"/> + <h:outputText value="#{catrow.title}"/> + </h:outputLink> + </span> + </td> + <td class="rowpic" colspan="3" align="right">&nbsp;</td> + </tr> + <c:forEach items="#{category.forums[catrow.id]}" var="forumrow"> + <!-- TODO: insert security check to make sure "viewing this forum" is allowed --> + <tr> + <td class="row1" align="center" valign="middle" height="50"> + <img src="#{category.forumImages[forumrow.id]}" width="46" height="25" + alt="#{resource[category.forumImageDescriptions[forumrow.id]]}" + title="#{resource[category.forumImageDescriptions[forumrow.id]]}"/> + </td> + <td class="row1" width="100%" height="50"> + <span class="forumlink"> + <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" styleClass="forumlink"> + <f:param name="f" value="#{forumrow.id}"/> + <h:outputText value="#{forumrow.name}"/> + </h:outputLink><br/> + </span> + <span class="genmed">${forumrow.description}<br/></span> + <span class="gensmall">&nbsp;&nbsp;</span> + </td> + <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">${forumrow.topicCount}</span></td> + <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">${forumrow.postCount}</span></td> + <!-- display last post information for this forum --> + <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> + <span class="gensmall"> + <c:if test="#{forumrow.lastPost!=null}"> + <!-- TODO: hookup real data here...need to extract out the hardcoded html code from the original portlet --> + ${forumrow.lastPost.createDate}<br/> + <c:if test="#{category.anonymous}"> + POSTER_INFO + </c:if> + <c:if test="#{!category.anonymous}"> + ${forumrow.lastPost.poster.user.userName} + </c:if> + <!-- TODO: LINK TO LAST POST NEEDED --> + <a href="link to lastPost"><img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/></a> + </c:if> + <c:if test="#{forumrow.lastPost==null}"> + #{resource.No_Posts} + </c:if> + </span> + </td> + </tr> + </c:forEach> + </c:forEach> + </table> + + <!--table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> + <tr> + <td align="left"><span class="gensmall"><a href="" class="gensmall">${n:i18n("Mark_all_forums")}</a></span></td> + <td align="right"><span class="gensmall"></span></td> + </tr> + </table> + + <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> + <tr> + <td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="" + class="cattitle">${n:i18n("Who_is_Online")}</a></span></td> + </tr> + <tr> + <td class="row1" align="center" valign="middle" rowspan="2"><img + src="modules/bb/templates/subSilver/images/whosonline.gif" alt="${n:i18n("Who_is_Online")}" /></td> + <td class="row1" align="left" width="100%"><span class="gensmall"><br /><br /></span> + </td> + </tr> + <tr> + <td class="row1" align="left"><span class="gensmall"> [ ] [ ]<br /><br /></span></td> + </tr> + </table> + + <table width="100%" cellpadding="1" cellspacing="1" border="0"> + <tr> + <td align="left" valign="top"><span class="gensmall">${n:i18n("Online_explain")}</span></td> + </tr> + </table--> + + <br clear="all"/> + + <table cellspacing="3" border="0" align="center" cellpadding="0"> + <tr> + <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder_new.gif" alt="${resource.New_posts}"/></td> + <td><span class="gensmall">${resource.New_posts}</span></td> + <td>&nbsp;&nbsp;</td> + <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder.gif" alt="${resource.No_new_posts}"/></td> + <td><span class="gensmall">${resource.No_new_posts}</span></td> + <td>&nbsp;&nbsp;</td> + <td width="20" align="center"><img src="#{forums:contextPath()}/subSilver/images/folder_lock.gif" alt="${resource.Forum_is_locked}"/></td> + <td><span class="gensmall">${resource.Forum_is_locked}</span></td> + </tr> + </table> + </ui:define> +</ui:composition> </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/common/common.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/common/common.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/common/common.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -27,11 +27,28 @@ xmlns:c="http://java.sun.com/jstl/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" + xmlns:forums="http://www.jboss.com/products/jbossportal/forums" + class="bb" > + <!-- stylesheet for this application --> + <link rel='stylesheet' type='text/css' href='/portal-forums/subSilver/styles.css' media='screen'/> -<!-- move this into a common template --> -<link rel='stylesheet' type='text/css' href='/portal-forums/subSilver/styles.css' media='screen'/> -<f:loadBundle basename="ResourceJSF" var="resource"/> -<h:panelGroup id="error"/> + <!-- resourceBundle to be used by this entire application --> + <f:loadBundle basename="ResourceJSF" var="resource"/> + + <!-- header --> + <!-- body of the page --> + <c:choose> + <c:when test="#{(forums:errorMsg())!=null}"> + <!-- generic error handling --> + <ui:include src="/views/errors/error_body.xhtml"/> + </c:when> + <c:otherwise> + <!-- main content for this page --> + <ui:insert name="mainContent"/> + </c:otherwise> + </c:choose> + + <!-- footer --> </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -27,9 +27,9 @@ xmlns:c="http://java.sun.com/jstl/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" + xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> @@ -40,12 +40,20 @@ </tr> <tr> <td align="center"> - <h:message for="error" styleClass="gen"/> + <h:outputText value="${forums:errorMsg()}. Please try again." styleClass="gen"/> </td> </tr> <tr> <td>&nbsp;</td> </tr> + <tr> + <td align="center"> + <h:commandButton type="button" value="Back" onclick="javascript:history.back();"/> + </td> + </tr> + <tr> + <td>&nbsp;</td> + </tr> </table> </td> </tr> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -30,7 +30,8 @@ xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> +<ui:composition template="/views/common/common.xhtml"> +<ui:define name="mainContent"> <c:if test="#{forum.forum!=null && forum.forum.id!=-1}"> <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> @@ -349,5 +350,8 @@ </tr> </table> </c:if> + +</ui:define> +</ui:composition> </div> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -6,7 +6,8 @@ xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> +<ui:composition template="/views/common/common.xhtml"> +<ui:define name="mainContent"> <!-- TODO: <n:errors/> @@ -124,4 +125,8 @@ </td> </tr> </table> +</ui:define> +</ui:composition> + + </div> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -28,8 +28,13 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb"> - <ui:include src="/views/common/common.xhtml"/> + + <ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> - <h:outputText value="VIEW SHOWING AN EDITOR OF MEESSAGE SENT TO USER" /> + <h:outputText value="VIEW SHOWING AN EDITOR OF MEESSAGE SENT TO USER" /> + </ui:define> + </ui:composition> + </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -28,7 +28,10 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb"> - <ui:include src="/views/common/common.xhtml"/> + + + <ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> <table width="100%" cellspacing="2" cellpadding="2" border="0" @@ -241,16 +244,18 @@ </tr> </table> -<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> - <tr> - <td align="right"> - <span class="nav"> - <br/> - <ui:include src="/views/jumpbox.xhtml"/> - </span> - </td> - </tr> -</table> + <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> + <tr> + <td align="right"> + <span class="nav"> + <br/> + <ui:include src="/views/jumpbox.xhtml"/> + </span> + </td> + </tr> + </table> + </ui:define> + </ui:composition> </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -30,49 +30,49 @@ xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> - - -<table border="0" cellpadding="4" cellspacing="1" width="100%" align="center"> - <!-- main page link --> - <tr> - <td align="center" valign="middle" class="nav" width="100%"> - <span class="nav"> - &nbsp;&nbsp;&nbsp; - <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav"> - <h:outputText value="#{shared.mainPageName}"/> - </h:outputLink> - </span> - </td> - </tr> - - <!-- topic type --> - <tr> - <th class="thSides" colspan="1" height="25" valign="middle"> - #{resource[summary.blockTopicsType]} - </th> - </tr> - - <!-- a list of topics for the specified forum --> - <c:forEach items="#{summary.topics}" var="topicrow"> - <tr> - <td class="row1" width="100%"> - <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" styleClass="topictitle"> - <f:param name="t" value="#{topicrow.id}"/> - <h:outputText value="#{topicrow.subject}"/> - </h:outputLink> - </td> - </tr> - </c:forEach> - - <!-- a list of no topics for the specified forum --> - <tr> - <td class="row3" height="30" align="center" valign="middle"> - <span class="postdetails"> - ${summary.numberOfTopicsFound}&nbsp;${resource.L_TOPICS_FOUND} - </span> - </td> - </tr> -</table> - +<ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> + <table border="0" cellpadding="4" cellspacing="1" width="100%" align="center"> + <!-- main page link --> + <tr> + <td align="center" valign="middle" class="nav" width="100%"> + <span class="nav"> + &nbsp;&nbsp;&nbsp; + <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav"> + <h:outputText value="#{shared.mainPageName}"/> + </h:outputLink> + </span> + </td> + </tr> + + <!-- topic type --> + <tr> + <th class="thSides" colspan="1" height="25" valign="middle"> + #{resource[summary.blockTopicsType]} + </th> + </tr> + + <!-- a list of topics for the specified forum --> + <c:forEach items="#{summary.topics}" var="topicrow"> + <tr> + <td class="row1" width="100%"> + <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" styleClass="topictitle"> + <f:param name="t" value="#{topicrow.id}"/> + <h:outputText value="#{topicrow.subject}"/> + </h:outputLink> + </td> + </tr> + </c:forEach> + + <!-- a list of no topics for the specified forum --> + <tr> + <td class="row3" height="30" align="center" valign="middle"> + <span class="postdetails"> + ${summary.numberOfTopicsFound}&nbsp;${resource.L_TOPICS_FOUND} + </span> + </td> + </tr> + </table> + </ui:define> +</ui:composition> </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -32,9 +32,15 @@ class="bb" > -<!-- THIS PAGE RECEIVES A java.util.List of Attachments from facelet include param - <ui:param name="attachments" value="#{postrow.attachments}"/> ---> -<h:outputText value="ATTACHMENTS" /> +<ui:composition template="/views/common/common.xhtml"> +<ui:define name="mainContent"> + <!-- THIS PAGE RECEIVES A java.util.List of Attachments from facelet include param + <ui:param name="attachments" value="#{postrow.attachments}"/> + --> + <h:outputText value="ATTACHMENTS" /> + +</ui:define> +</ui:composition> + </div> \ No newline at end of file Modified: 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-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -31,7 +31,8 @@ xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb" > -<ui:include src="/views/common/common.xhtml"/> +<ui:composition template="/views/common/common.xhtml"> +<ui:define name="mainContent"> <script language="JavaScript" type="text/javascript"> @@ -660,5 +661,7 @@ </h:form> </table> +</ui:define> +</ui:composition> </div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-05-01 08:06:45 UTC (rev 4024) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-05-01 23:41:42 UTC (rev 4025) @@ -28,7 +28,9 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb"> - <ui:include src="/views/common/common.xhtml"/> + + <ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> <c:if test="#{topic.topic!=null && topic.topic.id!=-1}"> <table width="100%" cellspacing="2" cellpadding="2" border="0"> @@ -593,5 +595,9 @@ </tr>--> </table> -<ui:debug hotkey="d" /> + <ui:debug hotkey="d" /> + + </ui:define> + </ui:composition> + </div> |
From: <jbo...@li...> - 2006-05-01 08:23:35
|
Author: mic...@jb... Date: 2006-05-01 04:06:45 -0400 (Mon, 01 May 2006) New Revision: 4024 Added: labs/jbossrules/updates/drools-ide-feature/ labs/jbossrules/updates/drools-ide-feature/.project labs/jbossrules/updates/drools-ide-feature/build.properties labs/jbossrules/updates/drools-ide-feature/build.xml labs/jbossrules/updates/drools-ide-feature/feature.xml labs/jbossrules/updates/drools-ide-update/ labs/jbossrules/updates/drools-ide-update/.project labs/jbossrules/updates/drools-ide-update/features/ labs/jbossrules/updates/drools-ide-update/features/org.drools.ide_1.0.0.jar labs/jbossrules/updates/drools-ide-update/plugins/ labs/jbossrules/updates/drools-ide-update/plugins/org.drools.ide_1.0.0.jar labs/jbossrules/updates/drools-ide-update/site.xml Log: Added: labs/jbossrules/updates/drools-ide-feature/.project =================================================================== --- labs/jbossrules/updates/drools-ide-feature/.project 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-feature/.project 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>drools-ide-feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> Added: labs/jbossrules/updates/drools-ide-feature/build.properties =================================================================== --- labs/jbossrules/updates/drools-ide-feature/build.properties 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-feature/build.properties 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1 @@ +bin.includes = feature.xml Added: labs/jbossrules/updates/drools-ide-feature/build.xml =================================================================== --- labs/jbossrules/updates/drools-ide-feature/build.xml 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-feature/build.xml 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="org.drools.ide" default="build.update.jar" basedir="."> + + <target name="init"> + <property name="feature.temp.folder" value="${basedir}/feature.temp.folder"/> + <property name="feature.destination" value="${basedir}"/> + </target> + + <target name="all.plugins" depends="init"> + <ant antfile="build.xml" dir="../../../../Projects/jboss-rules-new/drools-ide" target="${target}"> + <property name="arch" value="x86"/> + <property name="os" value="win32"/> + <property name="ws" value="win32"/> + </ant> + </target> + <target name="all.features" depends="init"> + </target> + <target name="update.feature" depends="init"> + </target> + + <target name="all.children" depends="init,all.features,all.plugins,update.feature"> + </target> + + <target name="children" if="include.children"> + <antcall target="all.children"/> + </target> + + <target name="build.jars" depends="init" description="Build all the jars for the feature: org.drools.ide."> + <antcall target="all.children"> + <param name="target" value="build.jars"/> + </antcall> + </target> + + <target name="build.sources" depends="init"> + <antcall target="all.children"> + <param name="target" value="build.sources"/> + </antcall> + </target> + + <target name="build.zips" depends="init"> + <antcall target="all.children"> + <param name="target" value="build.zips"/> + </antcall> + </target> + + <target name="build.update.jar" depends="init" description="Build the feature jar of: org.drools.ide for an update site."> + <antcall target="all.children"> + <param name="target" value="build.update.jar"/> + </antcall> + <property name="feature.base" value="${feature.temp.folder}"/> + <delete dir="${feature.temp.folder}"/> + <mkdir dir="${feature.temp.folder}"/> + <antcall target="gather.bin.parts" inheritAll="false"> + <param name="arch" value="*"/> + <param name="ws" value="*"/> + <param name="nl" value="*"/> + <param name="os" value="*"/> + <param name="feature.base" value="${feature.temp.folder}"/> + </antcall> + <jar destfile="${feature.destination}/org.drools.ide_1.0.0.jar" basedir="${feature.temp.folder}/features/org.drools.ide_1.0.0"/> + <delete dir="${feature.temp.folder}"/> + </target> + + <target name="gather.bin.parts" depends="init" if="feature.base"> + <mkdir dir="${feature.base}/features/org.drools.ide_1.0.0"/> + <antcall target="children"> + <param name="destination.temp.folder" value="${feature.base}/plugins"/> + <param name="target" value="gather.bin.parts"/> + </antcall> + <copy todir="${feature.base}/features/org.drools.ide_1.0.0" failonerror="true" overwrite="false"> + <fileset dir="${basedir}" includes="feature.xml" /> + </copy> + <eclipse.idReplacer featureFilePath="${feature.base}/features/org.drools.ide_1.0.0/feature.xml" selfVersion="1.0.0" featureIds="" pluginIds="org.drools.ide,1.0.0,"/> + <antcall target="rootFiles${os}_${ws}_${arch}"/> + </target> + <target name="rootFileswin32_win32_x86"> + </target> + <target name="rootFilesgroup_group_group"> + <antcall target="rootFileswin32_win32_x86"/> + </target> + + <target name="zip.distribution" depends="init" description="Create a zip containing all the plug-ins and features for the feature: org.drools.ide."> + <delete dir="${feature.temp.folder}"/> + <mkdir dir="${feature.temp.folder}"/> + <antcall target="gather.bin.parts"> + <param name="arch" value="*"/> + <param name="ws" value="*"/> + <param name="nl" value="*"/> + <param name="include.children" value="true"/> + <param name="feature.base" value="${feature.temp.folder}"/> + <param name="os" value="*"/> + </antcall> + <zip destfile="${feature.destination}/org.drools.ide_1.0.0.bin.dist.zip" basedir="${feature.temp.folder}" filesonly="false" whenempty="skip" update="false"/> + <delete dir="${feature.temp.folder}"/> + </target> + + <target name="zip.sources" depends="init"> + <delete dir="${feature.temp.folder}"/> + <mkdir dir="${feature.temp.folder}"/> + <antcall target="all.children"> + <param name="destination.temp.folder" value="${feature.temp.folder}/plugins/org.drools.ide.source_1.0.0/src"/> + <param name="include.children" value="true"/> + <param name="target" value="gather.sources"/> + </antcall> + <zip destfile="${feature.destination}/org.drools.ide_1.0.0.src.zip" basedir="${feature.temp.folder}" filesonly="true" whenempty="skip" update="false"/> + <delete dir="${feature.temp.folder}"/> + </target> + + <target name="zip.logs" depends="init"> + <delete dir="${feature.temp.folder}"/> + <mkdir dir="${feature.temp.folder}"/> + <antcall target="all.children" inheritAll="false"> + <param name="destination.temp.folder" value="${feature.temp.folder}/plugins"/> + <param name="include.children" value="true"/> + <param name="target" value="gather.logs"/> + </antcall> + <zip destfile="${feature.destination}/org.drools.ide_1.0.0.log.zip" basedir="${feature.temp.folder}" filesonly="true" whenempty="skip" update="false"/> + <delete dir="${feature.temp.folder}"/> + </target> + + <target name="clean" depends="init" description="Clean the feature: org.drools.ide of all the zips, jars and logs created."> + <delete file="${feature.destination}/org.drools.ide_1.0.0.jar"/> + <delete file="${feature.destination}/org.drools.ide_1.0.0.bin.dist.zip"/> + <delete file="${feature.destination}/org.drools.ide_1.0.0.log.zip"/> + <delete file="${feature.destination}/org.drools.ide_1.0.0.src.zip"/> + <delete dir="${feature.temp.folder}"/> + <antcall target="all.children"> + <param name="target" value="clean"/> + </antcall> + </target> + + <target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder."> + <eclipse.convertPath fileSystemPath="C:/apps/eclipse3.2M6/workspace/drools-ide-feature/" property="resourcePath"/> + <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/> + <antcall target="all.children"> + <param name="target" value="refresh"/> + </antcall> + </target> + <target name="gather.sources"> + <antcall target="children"> + <param name="destination.temp.folder" value="${feature.temp.folder}/plugins/org.drools.ide.source_1.0.0/src"/> + <param name="target" value="gather.sources"/> + </antcall> + </target> + + <target name="gather.logs" depends="init"> + <mkdir dir="${feature.temp.folder}"/> + <antcall target="all.children" inheritAll="false"> + <param name="destination.temp.folder" value="${feature.temp.folder}/plugins"/> + <param name="target" value="gather.logs"/> + </antcall> + </target> + +</project> Added: labs/jbossrules/updates/drools-ide-feature/feature.xml =================================================================== --- labs/jbossrules/updates/drools-ide-feature/feature.xml 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-feature/feature.xml 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.drools.ide" + label="Drools Rule Workbench" + version="1.0.0"> + + <description> + JBoss Rules (Drools) Workbench for developers. + </description> + + <copyright> + Copyright 2005 JBoss Inc + </copyright> + + <license> + 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. + </license> + + <plugin + id="org.drools.ide" + download-size="0" + install-size="0" + version="1.0.0"/> + +</feature> Added: labs/jbossrules/updates/drools-ide-update/.project =================================================================== --- labs/jbossrules/updates/drools-ide-update/.project 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-update/.project 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>drools-ide-update</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.UpdateSiteBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.UpdateSiteNature</nature> + </natures> +</projectDescription> Added: labs/jbossrules/updates/drools-ide-update/features/org.drools.ide_1.0.0.jar =================================================================== (Binary files differ) Property changes on: labs/jbossrules/updates/drools-ide-update/features/org.drools.ide_1.0.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/updates/drools-ide-update/plugins/org.drools.ide_1.0.0.jar =================================================================== (Binary files differ) Property changes on: labs/jbossrules/updates/drools-ide-update/plugins/org.drools.ide_1.0.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/updates/drools-ide-update/site.xml =================================================================== --- labs/jbossrules/updates/drools-ide-update/site.xml 2006-05-01 01:49:01 UTC (rev 4023) +++ labs/jbossrules/updates/drools-ide-update/site.xml 2006-05-01 08:06:45 UTC (rev 4024) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<site> + <feature url="features/org.drools.ide_1.0.0.jar" id="org.drools.ide" version="1.0.0"> + <category name="JBossRules"/> + </feature> + <category-def name="JBossRules" label="JBoss Rules"/> +</site> |
From: <jbo...@li...> - 2006-05-01 01:49:09
|
Author: unibrew Date: 2006-04-30 21:49:01 -0400 (Sun, 30 Apr 2006) New Revision: 4023 Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/CountersService.java labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDB.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/project.xml labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java Log: [JBLAB-655] Adding new files for DownloadCounters in database and modifying old files a little Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/project.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/project.xml 2006-05-01 01:47:21 UTC (rev 4022) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/project.xml 2006-05-01 01:49:01 UTC (rev 4023) @@ -73,6 +73,19 @@ <jar>portal-server-lib.jar</jar> </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>ejb3-persistence</artifactId> + <version>3.0RC6</version> + <jar>ejb3-persistence.jar</jar> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-ejb3x</artifactId> + <version>3.0RC6</version> + <jar>jboss-ejb3x.jar</jar> + </dependency> + <dependency> <groupId>jboss</groupId> <artifactId>activation</artifactId> Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java 2006-05-01 01:47:21 UTC (rev 4022) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Counter.java 2006-05-01 01:49:01 UTC (rev 4023) @@ -61,7 +61,7 @@ * @param projectId * Name of project for this counter. */ - Counter (long value,String projectId,Boolean visible,Sorting sorting) { + public Counter (long value,String projectId,Boolean visible,Sorting sorting) { this.value=value; this.projectId=projectId; this.visible = visible; Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/CountersService.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/CountersService.java 2006-05-01 01:47:21 UTC (rev 4022) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/CountersService.java 2006-05-01 01:49:01 UTC (rev 4023) @@ -0,0 +1,46 @@ + + /* + * 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.projects; + +import java.util.Map; + +import javax.ejb.Local; + + +/** + * + * @author Ryszard Kozmik + * + */ +@Local +public interface CountersService +{ + + public void createCounterWithPath(String path); + + public Map<String,Counter> getCountersMap(); + + public void updateCounters(Map<String,Counter> downloadCounters); + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDB.java 2006-05-01 01:47:21 UTC (rev 4022) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDB.java 2006-05-01 01:49:01 UTC (rev 4023) @@ -0,0 +1,99 @@ + /* + * 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.projects; + +import java.util.Map; + +import javax.naming.InitialContext; + +import org.jboss.logging.Logger; +import org.jboss.shotoku.ContentManager; + + +/** + * DownloadCountersDB is a main class used for counting downloads by using EJB3 and database. + * It overrides persistence of DownloadCountersDescriptor class. + * + * @author Ryszard Kozmik + */ +public class DownloadCountersDB + extends DownloadCountersDescriptor +{ + + protected InitialContext ctx; + + public DownloadCountersDB (String portalName, ContentManager cm) + { + this.setContentManager(cm); + try + { + ctx = new InitialContext(); + CountersService countersService = (CountersService)ctx.lookup(CountersService.class.getName()); + downloadCounters=countersService.getCountersMap(); + + // Getting Map containing pairs of ProjectId and shotoku Node + // which refers to projects' download counter descriptor. + Map <String,org.jboss.shotoku.Node> descriptors = getDownloadDescriptors(portalName); + + // Synchronizing tracked links in downloadConters with links from + // projects download counter descriptors. + synchronizeCounters(descriptors); + + } catch (Exception e) + { + getLogger().error ("Failed to initialize downloadCounters.",e); + } + + } + + /** + * This method is overriding the method from DownloadCountersDescriptor and + * because of that name is missleading. It just executes proper method on + * CountersService to persist all counters in database. + * @param portalName + */ + public void synchronizeWithFile(String portalName) { + try { + CountersService countersService = (CountersService)ctx.lookup(CountersService.class.getName()); + countersService.updateCounters(downloadCounters); + } catch (Exception e) + { + getLogger().error("Failed to persist downloadCounters",e); + } + } + + /** + * Method simply just increments the counter value for + * given in parameter <link>. + * + * @param link + * Counter value for this <code>link</code> will be incremented. + */ + synchronized public void increment (final String link) { + if (downloadCounters!=null && downloadCounters.get(link)!=null) { + // Status change to inform about counters modification. + downloadCounters.get(link).increment(); + } + } + +} Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java 2006-05-01 01:47:21 UTC (rev 4022) +++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersDescriptor.java 2006-05-01 01:49:01 UTC (rev 4023) @@ -34,6 +34,8 @@ import java.util.Set; import java.util.TreeMap; +import javax.naming.InitialContext; + import org.apache.xerces.parsers.DOMParser; import org.jboss.forge.common.XmlTools; import org.jboss.logging.Logger; @@ -98,12 +100,12 @@ /** * This Map contains all counters for the portal. */ - private Map<String,Counter> downloadCounters; + protected Map<String,Counter> downloadCounters; /** * ContentManager is used for getting to file resources. */ - private ContentManager contentManager; + protected ContentManager contentManager; /** * Logger is used for displaying messages. @@ -128,41 +130,51 @@ */ public DownloadCountersDescriptor (final String portalName, ContentManager contentManager) { - // Just initializing the changeStatus variable - changeStatus=false; + this(); + + // Saving the ContentManager. + this.contentManager = contentManager; + + // Getting the path to main dowload counters descriptor. + String pathToCountersXml = File.separator + DownloadCounterTools.getMainXmlPath(portalName); - // Initializing logger. - logger = Logger.getLogger(this.getClass()); - - // Getting the path to main dowload counters descriptor. - String pathToCountersXml = File.separator + DownloadCounterTools.getMainXmlPath(portalName); - - // Saving the ContentManager. - this.contentManager = contentManager; - try { - // Parsing main download counters descriptor. - DOMParser parser = new DOMParser(); - InputStream is = contentManager.getNode(pathToCountersXml).getContentInputStream(); - parser.parse(new InputSource(is)); - Document doc = parser.getDocument(); - NodeList nodes = doc.getDocumentElement().getChildNodes(); - downloadCounters=getValuesFromNodes(nodes); + // Parsing main download counters descriptor. + DOMParser parser = new DOMParser(); + InputStream is = contentManager.getNode(pathToCountersXml).getContentInputStream(); + parser.parse(new InputSource(is)); + Document doc = parser.getDocument(); + NodeList nodes = doc.getDocumentElement().getChildNodes(); + downloadCounters=getValuesFromNodes(nodes); - // Getting Map containing pairs of ProjectId and shotoku Node - // which refers to projects' download counter descriptor. - Map <String,org.jboss.shotoku.Node> descriptors = getDownloadDescriptors(portalName); + // Getting Map containing pairs of ProjectId and shotoku Node + // which refers to projects' download counter descriptor. + Map <String,org.jboss.shotoku.Node> descriptors = getDownloadDescriptors(portalName); - // Synchronizing tracked links in downloadConters with links from - // projects download counter descriptors. - synchronizeCounters(descriptors); + // Synchronizing tracked links in downloadConters with links from + // projects download counter descriptors. + synchronizeCounters(descriptors); } catch (Exception e) { logger.error ("Failed to initialize downloadCounters.",e); } } - + + /** + * Just default constructor whic does almost nothing. + */ + protected DownloadCountersDescriptor () + { + // Just initializing the changeStatus variable + changeStatus=false; + + // Initializing logger. + logger = Logger.getLogger(this.getClass()); + + } + + /** * Method only returns all download counters. * @return Returns a Map containing tracked download counters. @@ -223,7 +235,7 @@ * This Map<Strin,org.jboss.shotoku.Node> contains project ids with their download * counter descriptor's Node. */ - private void synchronizeCounters (Map<String,org.jboss.shotoku.Node> counters) { + protected void synchronizeCounters (Map<String,org.jboss.shotoku.Node> counters) { // Checking if tracked projects still have their counter.xml descriptors. // If not deleting all tracked links for them. @@ -468,7 +480,7 @@ xmlFile.save ("[DownlaodCounter] Main xml descriptor file update."); changeStatus=false; } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to persist downloadCounters",e); } } @@ -511,6 +523,39 @@ doc.getDocumentElement().appendChild(newCounter); } } + + /** + * Just a method to get Logger, used by subclasses. + */ + protected Logger getLogger () + { + return logger; + } + + /** + * Just a method to set Logger, used by subclasses. + */ + protected void setLogger (Logger logger) + { + this.logger = logger; + } + + /** + * Just a method to get ContentManager, used by subclasses. + */ + protected ContentManager getContentManager () + { + return this.contentManager; + } + + /** + * Just a method to set ContentManager, used by subclasses. + */ + protected void setContentManager (ContentManager cm) + { + this.contentManager=cm; + } + /** * Method simply just increments the counter value for @@ -554,8 +599,16 @@ public boolean hasChanged () { return changeStatus; } - - + + /** + * Method for setting changed status. + */ + protected void setChanged(boolean changeStatus) + { + this.changeStatus = changeStatus; + } + + /** * Method used for pulling the links,counter values and projectIds out from the * xml file nodes to the <String,Counter> Map. |
From: <jbo...@li...> - 2006-05-01 01:47:33
|
Author: unibrew Date: 2006-04-30 21:47:21 -0400 (Sun, 30 Apr 2006) New Revision: 4022 Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/maven.xml labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.properties labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.xml labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersEntity.java labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersMDB.java labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersServiceBean.java labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/persistence.xml labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/tld/ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/tld/forge.tld Log: [JBLAB-655] Adding project to JBoss Labs containing EJB3 for DownloadCounters Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/maven.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/maven.xml 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/maven.xml 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,31 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> + <!-- Default war-project goals --> + + <goal name="all"> + <attainGoal name="prj-all" /> + </goal> + + <goal name="build"> + <ant:copy todir="target/classes"> + <ant:fileset dir="src/web/WEB-INF"> + <ant:filename name="persistence.xml" /> + </ant:fileset> + </ant:copy> + <attainGoal name="jar" /> + </goal> + + <goal name="deploy"> + <ant:copy + tofile="${local.deploy.dir}/counters.ejb3" + file="target/counters-ejb3-1.0.jar" /> + </goal> + + <goal name="clean"> + <attainGoal name="prj-clean" /> + </goal> +</project> Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.properties =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.properties 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.properties 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,3 @@ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ +maven.junit.fork=yes +maven.war.src=${basedir}/src/web Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.xml 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/project.xml 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,38 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project> + <pomVersion>3</pomVersion> + <extend>../common.xml</extend> + <id>counters-ejb3</id> + <name>Download Counters EJB</name> + <currentVersion>1.0</currentVersion> + <organization> + <name>JBoss Labs</name> + <url>http://www.jboss.org</url> + </organization> + <description></description> + <dependencies> + <dependency> + <groupId>jboss-forge</groupId> + <artifactId>forge-common</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>ejb3-persistence</artifactId> + <version>3.0RC6</version> + <jar>ejb3-persistence.jar</jar> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-ejb3x</artifactId> + <version>3.0RC6</version> + <jar>jboss-ejb3x.jar</jar> + </dependency> + + </dependencies> +</project> Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersEntity.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersEntity.java 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersEntity.java 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,113 @@ + + /* + * 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.counters; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * + * @author Ryszard Kozmik + * + */ +@Entity +@Table(name = "jblab_counters") +public class CountersEntity +{ + + private String path; + private long counterValue; + private String order; + private String projectId; + private boolean visible; + + public CountersEntity(String path) + { + this(path,0L); + } + + public CountersEntity (String path, long initValue) + { + this.path = path; + this.counterValue=initValue; + } + + @Id + @Column(name = "path") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Column(name = "counter") + public long getCounterValue() + { + return counterValue; + } + + public void setCounterValue(long cv) + { + this.counterValue = cv; + } + + public void setOrder(String order) + { + this.order = order; + } + + @Column(name = "order") + public String getOrder() + { + return order; + } + + public void setProjectId(String projectId) + { + this.projectId = projectId; + } + + @Column(name = "projectid") + public String getProjectId() + { + return projectId; + } + + public void setVisible(boolean visible) + { + this.visible = visible; + } + + @Column(name= "visible") + public boolean isVisible() + { + return visible; + } +} Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersMDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersMDB.java 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersMDB.java 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,50 @@ + + /* + * 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.counters; +/* +import javax.ejb.ActivationConfigProperty; +import javax.ejb.MessageDriven; +import javax.jms.Message; + + + /** + * + * @author Ryszard Kozmik + * + */ /* +@MessageDriven(activateConfig = +{ + @ActivationConfigProperty(propertyName="destinationType", + propertyValue="javax.jms.Queue"), + @ActivationConfigProperty(propertyName="destination", + propertyValue="queue/mdb") +})*/ +public class CountersMDB +{ +/* + public void onMessage (Message msg) { + + } +*/ +} Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersServiceBean.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersServiceBean.java 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/java/org/jboss/forge/counters/CountersServiceBean.java 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,76 @@ + + /* + * 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.counters; + +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.jboss.forge.common.projects.Counter; +import org.jboss.forge.common.projects.CountersService; +import org.jboss.forge.common.projects.Sorting; + + +/** + * + * @author Ryszard Kozmik + * + */ +@Stateless +public class CountersServiceBean implements CountersService +{ + + @PersistenceContext (unitName="counters") + protected EntityManager em; + + public void createCounterWithPath(String path) + { + CountersEntity ce = new CountersEntity(path); + em.persist(ce); + } + + public Map<String,Counter> getCountersMap() + { + List<CountersEntity> countersRows = em.createQuery("from CountersEntity e").getResultList(); + Map<String,Counter> countersMap = new Hashtable<String,Counter>(countersRows.size()); + for (CountersEntity counter : countersRows) + { + countersMap.put(counter.getPath(), + new Counter(counter.getCounterValue(), + counter.getProjectId(), + counter.isVisible(), + Sorting.valueOf(counter.getOrder()))); + } + return countersMap; + } + + public void updateCounters(Map<String,Counter> downloadCounters) + { + List<CountersEntity> countersRows = em.createQuery("from CountersEntity e").getResultList(); + } +} Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/persistence.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/persistence.xml 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/persistence.xml 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,7 @@ +<entity-manager> + <name>counters</name> + <jta-data-source>java:/JBossDS</jta-data-source> + <properties> + <property name="hibernate.hbm2ddl.auto" value="update" /> + </properties> +</entity-manager> Added: labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/tld/forge.tld =================================================================== --- labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/tld/forge.tld 2006-05-01 01:43:32 UTC (rev 4021) +++ labs/jbosslabs/trunk/portal-extensions/counters-ejb3/src/web/WEB-INF/tld/forge.tld 2006-05-01 01:47:21 UTC (rev 4022) @@ -0,0 +1,139 @@ +<taglib 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 web-jsptaglibrary_2_0.xsd" + version="2.0"> + <!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> + <tlib-version>1.1</tlib-version> + <jsp-version>2.0</jsp-version> + <shortname>forge</shortname> + <info>Forge tags</info> + + <tag> + <name>pageURL</name> + <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>param</name> + <tagclass>org.jboss.forge.common.taglib.ParamTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>wikiURL</name> + <tagclass>org.jboss.forge.common.taglib.WikiURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>freezoneURL</name> + <tagclass>org.jboss.forge.common.taglib.FreezoneURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>projectURL</name> + <tagclass>org.jboss.forge.common.taglib.ProjectURLTag</tagclass> + <attribute> + <name>project</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>page</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>categoryURL</name> + <tagclass>org.jboss.forge.common.taglib.CategoryURLTag</tagclass> + <attribute> + <name>category</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>selectedProject</name> + <tagclass>org.jboss.forge.common.taglib.SelectedProjectTag</tagclass> + </tag> + + <tag> + <name>imagePath</name> + <tagclass>org.jboss.forge.common.taglib.ImagePathTag</tagclass> + <attribute> + <name>src</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>project</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrValue</name> + <tagclass>org.jboss.forge.common.taglib.AttrValueTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrIf</name> + <tagclass>org.jboss.forge.common.taglib.AttrIfTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> +</taglib> |
From: <jbo...@li...> - 2006-05-01 01:43:36
|
Author: mar...@jb... Date: 2006-04-30 21:43:32 -0400 (Sun, 30 Apr 2006) New Revision: 4021 Modified: labs/jbossrules/trunk/pom.xml Log: -updated svn url Modified: labs/jbossrules/trunk/pom.xml =================================================================== --- labs/jbossrules/trunk/pom.xml 2006-05-01 01:21:53 UTC (rev 4020) +++ labs/jbossrules/trunk/pom.xml 2006-05-01 01:43:32 UTC (rev 4021) @@ -192,8 +192,8 @@ <scm> - <connection>scm:svn:http://anonsvn.labs.jboss.com/trunk/labs/jbossrules/</connection> - <url>http://anonsvn.labs.jboss.com/trunk/labs/jbossrules/</url> + <connection>scm:svn:http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/</connection> + <url>http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/</url> </scm> |
From: <jbo...@li...> - 2006-05-01 01:21:57
|
Author: mar...@jb... Date: 2006-04-30 21:21:53 -0400 (Sun, 30 Apr 2006) New Revision: 4020 Modified: labs/jbossrules/trunk/drools-examples/.classpath Log: -fixed classpath to use local lib/ jars Modified: labs/jbossrules/trunk/drools-examples/.classpath =================================================================== --- labs/jbossrules/trunk/drools-examples/.classpath 2006-05-01 00:57:40 UTC (rev 4019) +++ labs/jbossrules/trunk/drools-examples/.classpath 2006-05-01 01:21:53 UTC (rev 4020) @@ -7,7 +7,7 @@ <classpathentry output="target/test-classes" kind="src" path="src/test/resources"/> <classpathentry kind="con" path="DROOLS/JBoss Rules"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="var" path="M2_REPO/jgoodies/forms/1.0.4/forms-1.0.4.jar"/> - <classpathentry kind="var" path="M2_REPO/foxtrot/foxtrot/2.0/foxtrot-2.0.jar"/> + <classpathentry kind="lib" path="lib/foxtrot-2.0.jar"/> + <classpathentry kind="lib" path="lib/jgoodies-forms-1.0.4.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> |