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...> - 2005-12-21 12:43:39
|
Author: aron.gombas Date: 2005-12-21 07:43:30 -0500 (Wed, 21 Dec 2005) New Revision: 1916 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/CachedDataHandler.java Log: Javadocs comments fixed Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/CachedDataHandler.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/CachedDataHandler.java 2005-12-21 12:42:45 UTC (rev 1915) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/CachedDataHandler.java 2005-12-21 12:43:30 UTC (rev 1916) @@ -19,17 +19,9 @@ * still up-to-date, even if there was a cache miss caused by timeout. * Implement it simply by returning <code>false</code> if it's not possible to detect * whether the data is still up-to-date without recalculating everything. - * - * @param language can be ignored if the data and the resources referenced by the - * data are not language-dependent. */ - public boolean isDataUptodate(Object key);// TODO language ne legyen itt es csak azt vizsgalja, h az adatforras megvaltozott-e => isDataSourceUnchanged() + public boolean isDataUptodate(Object key); - /** - * Reloads the service-specific data in the case of stale data (cache miss). - * - * @param language can be ignored if the data and the resources referenced by the - * data are not language-dependent. - */ + /** Reloads the service-specific data in the case of stale data (cache miss). */ public Object reloadData(Object key); } |
From: <jbo...@li...> - 2005-12-21 12:42:52
|
Author: aron.gombas Date: 2005-12-21 07:42:45 -0500 (Wed, 21 Dec 2005) New Revision: 1915 Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java Log: Little fix Modified: trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java =================================================================== --- trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java 2005-12-21 07:41:36 UTC (rev 1914) +++ trunk/labs/kosmos/src/java/hu/midori/kosmos/server/AbstractKosmosService.java 2005-12-21 12:42:45 UTC (rev 1915) @@ -40,7 +40,7 @@ private static final int CACHE_TIMEOUT = 10*60*1000; /** Spring web-application context. */ - WebApplicationContext ctx; + private WebApplicationContext ctx; /** * Caches the result to return by the concrete service. |
From: <jbo...@li...> - 2005-12-21 07:41:41
|
Author: mic...@jb... Date: 2005-12-21 02:41:36 -0500 (Wed, 21 Dec 2005) New Revision: 1914 Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java Log: Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 07:38:28 UTC (rev 1913) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 07:41:36 UTC (rev 1914) @@ -124,9 +124,9 @@ listener.endComment(); } } else if (tagName.equals("P")) { - handleText("\n"); - } else if (tagName.equals("BR")) { - handleText("\n"); + listener.handleText("\n"); + } else if (tagName.equals("BR")) { + listener.handleText("\n"); } |
From: <jbo...@li...> - 2005-12-21 07:38:56
|
Author: mic...@jb... Date: 2005-12-21 02:38:28 -0500 (Wed, 21 Dec 2005) New Revision: 1913 Added: trunk/labs/jbossrules/drools-natural-language/lib/htmlparser.jar Log: Added: trunk/labs/jbossrules/drools-natural-language/lib/htmlparser.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/jbossrules/drools-natural-language/lib/htmlparser.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2005-12-21 07:38:01
|
Author: mic...@jb... Date: 2005-12-21 02:37:52 -0500 (Wed, 21 Dec 2005) New Revision: 1912 Modified: trunk/labs/jbossrules/drools-natural-language/doc/NaturalRulesSpec.odt Log: Modified: trunk/labs/jbossrules/drools-natural-language/doc/NaturalRulesSpec.odt =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-12-21 07:37:18
|
Author: mic...@jb... Date: 2005-12-21 02:37:13 -0500 (Wed, 21 Dec 2005) New Revision: 1911 Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java Log: handles newlines Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 07:32:06 UTC (rev 1910) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 07:37:13 UTC (rev 1911) @@ -4,6 +4,7 @@ import java.net.URL; import java.net.URLConnection; +import org.apache.commons.lang.StringUtils; import org.drools.natural.NaturalLanguageException; import org.drools.natural.ruledoc.RuleDocumentListener; import org.htmlparser.Node; @@ -85,8 +86,11 @@ private void handleText(String text) { - listener.handleText(unescapeSmartQuotes(unescapeEntities(text))); + String noNewLines = StringUtils.replaceChars(text, '\n', ' '); + noNewLines = StringUtils.replaceChars(noNewLines, '\r', ' '); + listener.handleText(unescapeSmartQuotes(unescapeEntities(noNewLines))); + } private void handleTag(TagNode tag) @@ -120,9 +124,9 @@ listener.endComment(); } } else if (tagName.equals("P")) { - handleText(" "); + handleText("\n"); } else if (tagName.equals("BR")) { - handleText(" "); + handleText("\n"); } |
From: <jbo...@li...> - 2005-12-21 07:32:33
|
Author: mic...@jb... Date: 2005-12-21 02:32:06 -0500 (Wed, 21 Dec 2005) New Revision: 1910 Added: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/DictionaryHelper.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocument.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/DictionaryHelperTest.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/NaturalRulesSpec.html trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentListenerTest.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentTest.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserTest.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/sample.dictionary.properties trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/simple-ruledoc.html Removed: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/ParseState.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListenerImpl.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleSectionState.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/TableState.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParserImpl.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserImplTest.java trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/NaturalRulesSpec.html trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/test_rule_raw.txt Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/NaturalLanguageException.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ast/AbstractSyntaxNode.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/Keywords.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListener.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/keywords.properties trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/simplest.html Log: some more work on the HTML parser Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/NaturalLanguageException.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/NaturalLanguageException.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/NaturalLanguageException.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -13,5 +13,9 @@ { super(message); } + + public NaturalLanguageException(String message, Throwable cause) { + super(message, cause); + } } Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ast/AbstractSyntaxNode.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ast/AbstractSyntaxNode.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ast/AbstractSyntaxNode.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,5 +1,14 @@ package org.drools.natural.ast; +/** + * All natural language syntax nodes extend this class. + * + * Basically we start out with a list of tokens, each token is then classified into one of the syntax types, + * and then they build themselvs up into a list of little ASTs. + * + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + * + */ public abstract class AbstractSyntaxNode { Added: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/DictionaryHelper.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/DictionaryHelper.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/DictionaryHelper.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,26 @@ +package org.drools.natural.ruledoc; + +import java.util.Properties; + +public class DictionaryHelper +{ + + private Properties props; + + public DictionaryHelper(Properties properties) { + props = properties; + } + + public String getItem(String key) { + return props.getProperty(key); + } + + public String getFunctions() { + return props.getProperty("functions"); + } + + public String getImports() { + if (props.containsKey("import")) return props.getProperty("import"); + return props.getProperty("imports"); + } +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/DictionaryHelper.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/Keywords.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/Keywords.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/Keywords.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -9,14 +9,14 @@ public class Keywords { - public static Keywords instance; + private static Keywords instance; private Properties props; private Keywords(Properties p) { this.props = p; } - public static Keywords getInstance() { + private static Keywords getInstance() { if (instance == null) { Properties props = new Properties(); @@ -34,6 +34,10 @@ * Helper method to get a keyword */ public static String getKeyword(String key) { + Keywords keywords = getInstance(); + if (!keywords.props.containsKey(key)) { + throw new IllegalArgumentException("The keyword [" + key + "] was not in the configuration."); + } return getInstance().props.getProperty(key); } Deleted: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/ParseState.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/ParseState.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/ParseState.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,12 +0,0 @@ -package org.drools.natural.ruledoc; - -/** - * This is the super class of all document parse states. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * - */ -public abstract class ParseState -{ - abstract void parseChunk(String text); - -} Added: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocument.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocument.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocument.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,31 @@ +package org.drools.natural.ruledoc; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.List; +import java.util.Properties; + +import org.drools.natural.ruledoc.html.HTMLDocParser; + +/** + * This is the class that does it all for rule documents (HTML based). + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + */ +public class RuleDocument +{ + + public RuleDocument() { + } + + List buildRuleListFromDocument(URL document, Properties dictionary) { + HTMLDocParser parser = new HTMLDocParser(); + RuleDocumentListener listener = new RuleDocumentListener(); + parser.parseDocument(document, listener); + + return listener.getRules(); + + } + + +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocument.java ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListener.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListener.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListener.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,27 +1,91 @@ package org.drools.natural.ruledoc; -public interface RuleDocumentListener +import java.util.ArrayList; +import java.util.List; + +/** + * This is a simple rule listener implementation. Doesn't do anything clever, just extracts the rules. + * Leaves everything else alone. + * No special treatment of tables. + * @author <a href="mailto:mic...@gm..."> Michael Neale</a> + */ +public class RuleDocumentListener { - /** - * Process a line of text. - */ - public abstract void handleText(String text); + private boolean inComment; + private List rules; + private StringBuffer ruleBuffer; + private boolean inRule; + + public RuleDocumentListener() { + rules = new ArrayList(); + } - public abstract void startTable(); + public void handleText(String text) + { + if (text.trim().startsWith(Keywords.getKeyword("rule.start"))) { + startNewRule(text); + } else if (text.trim().endsWith(Keywords.getKeyword("rule.end"))) { + finishCurrentRule(text); + } else if (inComment) { + return; + } else if (inRule) { + ruleBuffer.append(text); + } + + } - public abstract void startColumn(); + private void finishCurrentRule(String text) + { + ruleBuffer.append(text); + rules.add(ruleBuffer.toString()); + inRule = false; + } - public abstract void startRow(); + private void startNewRule(String text) + { + ruleBuffer = new StringBuffer(); + ruleBuffer.append(text); + inRule = true; + } - public abstract void endTable(); + public void startTable() + { + // TODO Auto-generated method stub + + } - public abstract void endColumn(); + public void startColumn() + { + // TODO Auto-generated method stub + + } - public abstract void endRow(); + public void startRow() + { + // TODO Auto-generated method stub + + } - public abstract void startComment(); + public void endTable() + { + // TODO Auto-generated method stub + + } - public abstract void endComment(); + public void startComment() + { + this.inComment = true; + } -} \ No newline at end of file + public void endComment() + { + this.inComment = false; + } + + public List getRules() { + return rules; + } + + +} Deleted: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListenerImpl.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListenerImpl.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleDocumentListenerImpl.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,83 +0,0 @@ -package org.drools.natural.ruledoc; - -/** - * This builds up the rules from the document events. - * HTML is obviously supported, but this interface is not bound to HTML. - * - * This is the class context for the parsing state, like GoF state pattern. - * - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * - */ -public class RuleDocumentListenerImpl implements RuleDocumentListener -{ - - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#handleText(java.lang.String) - */ - public void handleText(String text) { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#startTable() - */ - public void startTable() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#startColumn() - */ - public void startColumn() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#startRow() - */ - public void startRow() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#endTable() - */ - public void endTable() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#endColumn() - */ - public void endColumn() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#endRow() - */ - public void endRow() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#startComment() - */ - public void startComment() { - - } - - /* (non-Javadoc) - * @see org.drools.natural.ruledoc.RuleDocumentListener#endComment() - */ - public void endComment() { - - } - - - - - -} Deleted: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleSectionState.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleSectionState.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/RuleSectionState.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,31 +0,0 @@ -package org.drools.natural.ruledoc; - -import org.apache.commons.lang.StringUtils; - -public class RuleSectionState extends ParseState -{ - - private StringBuffer buf = new StringBuffer(); - private String name; - - - public RuleSectionState(String name) { - this.buf.append(name + " "); - } - - void parseChunk(String text) - { - buf.append(text); - } - - public static boolean isStart(String text) - { - return StringUtils.contains(text, Keywords.getKeyword("rule.start")); - } - - public static boolean isEnd(String text) - { - return StringUtils.contains(text, Keywords.getKeyword("rule.end")); - } - -} Deleted: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/TableState.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/TableState.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/TableState.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,28 +0,0 @@ -package org.drools.natural.ruledoc; - -import java.util.Properties; - -public class TableState extends ParseState -{ - - private String name; - private Properties data; - private boolean inKey; - - - public TableState(String name) { - this.name = name; - data = new Properties(); - } - - - - void parseChunk(String text) - { - - - - - } - -} Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParser.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,30 +1,154 @@ package org.drools.natural.ruledoc.html; import java.io.IOException; -import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import org.drools.natural.NaturalLanguageException; import org.drools.natural.ruledoc.RuleDocumentListener; +import org.htmlparser.Node; +import org.htmlparser.Parser; +import org.htmlparser.nodes.RemarkNode; +import org.htmlparser.nodes.TagNode; +import org.htmlparser.nodes.TextNode; +import org.htmlparser.util.NodeIterator; +import org.htmlparser.util.NodeList; +import org.htmlparser.util.ParserException; -/** +/** * The HTML document parser will treat italics as comments. * Must be tolerant of dodgy HTML, and handle quirky HTML like the stuff - * that Microsoft word spits out. - * - * Any html parsers must implement this. - * My suggested ones are: - * 1) javax.swing - * 2) HotSax - * 3) that one from SiteMesh - * 4) roll your own. + * that Microsoft word spits out. * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - * */ -public interface HTMLDocParser +public class HTMLDocParser { - /** - * @param input The input to the HTML. - * @param listener The listener to raise document events against. - * @throws IOException If there is something wrong with the stream. - */ - void parseDocument(InputStream input, RuleDocumentListener listener) throws IOException; + + private RuleDocumentListener listener; + + public void parseDocument(URL url, RuleDocumentListener listener) { + try { + parseDocument(url.openConnection(), listener); + } catch (IOException e) { + throw new NaturalLanguageException("Unable to open URL to rule document", e); + } + } + + public void parseDocument(URLConnection input, + RuleDocumentListener listener) + { + this.listener = listener; + try + { + Parser parser = new Parser(input); + for (NodeIterator i = parser.elements (); i.hasMoreNodes(); ) { + processNodes (i.nextNode ()); + } + } + catch ( ParserException e ) + { + throw new NaturalLanguageException("Error in the HTML parser.", e); + } + } + + private void processNodes (Node node) throws ParserException + { + if (node instanceof TextNode) + { + // downcast to TextNode + TextNode text = (TextNode)node; + // do whatever processing you want with the text + handleText(text.getText()); + } + if (node instanceof RemarkNode) + { + // downcast to RemarkNode + //RemarkNode remark = (RemarkNode)node; + } + else if (node instanceof TagNode) + { + // downcast to TagNode + TagNode tag = (TagNode)node; + // do whatever processing you want with the tag itself + handleTag(tag); + // process recursively (nodes within nodes) via getChildren() + NodeList nl = tag.getChildren (); + if (null != nl) + for (NodeIterator i = nl.elements (); i.hasMoreNodes(); ) { + processNodes (i.nextNode ()); + } + + } + } + + + + private void handleText(String text) + { + listener.handleText(unescapeSmartQuotes(unescapeEntities(text))); + + } + + private void handleTag(TagNode tag) + { + + String tagName = tag.getTagName(); + boolean isEnding = tag.isEndTag(); + + if (tagName.equals("TABLE") ) { + if (!isEnding) { + listener.startTable(); + } else { + listener.startTable(); + } + } else if (tagName.equals("TH")) { + if (!isEnding) { + listener.startRow(); + } + } else if (tagName.equalsIgnoreCase("TR")) { + if (!isEnding) { + listener.startRow(); + } + } else if (tagName.equals("TD")) { + if (!isEnding) { + listener.startColumn(); + } + } else if (tagName.equals("I")) { + if (!isEnding) { + listener.startComment(); + } else { + listener.endComment(); + } + } else if (tagName.equals("P")) { + handleText(" "); + } else if (tagName.equals("BR")) { + handleText(" "); + } + + + } + + + + private static String unescapeSmartQuotes(String s) { + s = s.replace('\u201c', '"'); + s = s.replace('\u201d', '"'); + s = s.replace('\u2018', '\''); + s = s.replace('\u2019', '\''); + return s; + } + + private static String unescapeEntities(String s) { + s = s.replaceAll("<", "<"); + s = s.replaceAll(">", ">"); + s = s.replaceAll(" ", " "); + s = s.replaceAll(""", "\""); + s = s.replaceAll("&", "&"); + s = s.replaceAll("&rdquo", "\""); + s = s.replaceAll("“", "\""); + return s; + } + + + } Deleted: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParserImpl.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParserImpl.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/html/HTMLDocParserImpl.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,122 +0,0 @@ -package org.drools.natural.ruledoc.html; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; - -import javax.swing.text.MutableAttributeSet; -import javax.swing.text.html.HTMLEditorKit; -import javax.swing.text.html.HTML.Tag; -import javax.swing.text.html.parser.ParserDelegator; - - -import org.drools.natural.ruledoc.RuleDocumentListener; - -/** - * This implementation of a doc parser uses the javax.swing package. - * @author <a href="mailto:mic...@gm..."> Michael Neale</a> - */ -public class HTMLDocParserImpl extends HTMLEditorKit.ParserCallback implements HTMLDocParser -{ - - private RuleDocumentListener listener; - - public void handleEndTag(Tag tag, - int arg1) - { - System.out.println("Breaksflow: " + tag.breaksFlow()); - - if ( tag == Tag.I ) - { - listener.endComment(); - } - else if ( tag == Tag.TABLE ) - { - listener.endTable(); - } - else if ( tag == Tag.TH ) - { - listener.endRow(); - } - else if ( tag == Tag.TR ) - { - listener.endRow(); - } - else if ( tag == Tag.TD ) - { - listener.endColumn(); - } else if (tag == Tag.BR) { - System.out.println("BREAK"); - } else if (tag == Tag.P) { - System.out.println("PARA"); - } - - } - - public void handleStartTag(Tag tag, - MutableAttributeSet arg1, - int arg2) - { - - // System.out.println("Start TAG: " + name); - if ( tag == Tag.I ) - { - listener.startComment(); - } - else if ( tag == Tag.TABLE ) - { - listener.startTable(); - } - else if ( tag == Tag.TH ) - { - listener.startRow(); - } - else if ( tag == Tag.TR ) - { - listener.startRow(); - } - else if ( tag == Tag.TD ) - { - listener.startColumn(); - } - - } - - public void handleText(char[] chars, - int arg1) - { - String s = new String(chars); - - listener.handleText(unescapeSmartQuotes(unescapeEntities(s))); - } - - - - public void parseDocument(InputStream input, - RuleDocumentListener listener) throws IOException - { - this.listener = listener; - ParserDelegator del = new ParserDelegator(); - Reader reader = new InputStreamReader(input); - del.parse(reader, this, true); - } - - private static String unescapeSmartQuotes(String s) { - s = s.replace('\u201c', '"'); - s = s.replace('\u201d', '"'); - s = s.replace('\u2018', '\''); - s = s.replace('\u2019', '\''); - return s; - } - - private static String unescapeEntities(String s) { - s = s.replaceAll("<", "<"); - s = s.replaceAll(">", ">"); - s = s.replaceAll(" ", " "); - s = s.replaceAll(""", "\""); - s = s.replaceAll("&", "&"); - return s; - } - -} Modified: trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/keywords.properties =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/keywords.properties 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/main/org/drools/natural/ruledoc/keywords.properties 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,16 +1,9 @@ #here we configure the syntax for rules -rule.start=Rule-start: -rule.end=Rule-end +rule.start=Start-rule +rule.end=End-rule rule.if=IF rule.then=THEN rule.condition.and=AND rule.consequence.and=AND -#and here is the config for what tables to look at. All tables have only 2 cols. -rule.config.table.header=Rules -dictionary.table.header=Dictionary -ruleset.table.header=Ruleset -#not sure if I will integrate tests or not... -test.table.header=Test - Added: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/DictionaryHelperTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/DictionaryHelperTest.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/DictionaryHelperTest.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,17 @@ +package org.drools.natural.ruledoc; + +import java.io.IOException; +import java.util.Properties; + +import junit.framework.TestCase; + +public class DictionaryHelperTest extends TestCase +{ + public void testLoad() throws IOException { + + Properties props = new Properties(); + props.load(getClass().getResourceAsStream("sample.dictionary.properties")); + DictionaryHelper dic = new DictionaryHelper(props); + assertEquals("convertToDate(\"${right}\")", dic.getItem("date of")); + } +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/DictionaryHelperTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/NaturalRulesSpec.html =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/NaturalRulesSpec.html 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/NaturalRulesSpec.html 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,315 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> + <TITLE></TITLE> + <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Win32)"> + <META NAME="CREATED" CONTENT="20051214;11592400"> + <META NAME="CHANGEDBY" CONTENT="Michael Neale"> + <META NAME="CHANGED" CONTENT="20051221;17212142"> + <STYLE> + <!-- + @page { size: 21cm 29.7cm; margin: 2cm } + P { margin-bottom: 0.21cm } + H1 { margin-bottom: 0.21cm } + H1.western { font-family: "Arial", sans-serif; font-size: 16pt } + H1.cjk { font-family: "Lucida Sans Unicode"; font-size: 16pt } + H1.ctl { font-family: "Tahoma"; font-size: 16pt } + H3 { margin-bottom: 0.21cm } + H3.western { font-family: "Arial", sans-serif } + TD P { margin-bottom: 0cm } + TH P { margin-bottom: 0cm; font-style: italic } + --> + </STYLE> +</HEAD> +<BODY LANG="" DIR="LTR"> +<H1 CLASS="western"><FONT FACE="Verdana, sans-serif">Drools natural +rule language</FONT><IMG SRC="NaturalRulesSpec_html_m48cc1843.jpg" NAME="graphics1" ALIGN=LEFT HSPACE=23 VSPACE=23 WIDTH=185 HEIGHT=246 BORDER=0><BR CLEAR=LEFT></H1> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt">Natural +rules, in textual documents specification<BR>(this is an executable +document)</FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><I>TODO: +do we prefer the term “Natural rules” or “Literate +rules”?</I></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Outline</B></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt">Natural +language rules work off any textual document that can be transformed +to HTML (this is similar in concept to Ward Cunningham’s +fit.c2.com framework) – including this one. Some simple rules +are followed to make the natural language very easy to lexically +analyse (which is normally the hardest bit of parsing). Combine this +with some conventions and object introspection, and we have an +interesting idea.</FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><B>This +is essentially an instance of Literate programming +(www.literateprogramming.com),</B> which was coined by Donald Knuth +(why isn’t he “Sir” yet, damn it if Elton John can +get a knighthood, so can Don). A core premise of literate programming +is that “comments” are first class, code is woven in.</FONT></FONT></FONT></P> +<H3 CLASS="western"><FONT FACE="Verdana, sans-serif">Features</FONT></H3> +<OL> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Must + be able to expose the full power of DRL features if needed (a lot of + them won’t be, but generally at least one person will ask for + each feature). </FONT></FONT></FONT> + </P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Should + be able to produce readable rules (readable by a suitably trained + non technical person) – having a non programmer edit rules in + entirety is a lofty goal ;) But it may be a poison chalice ;) </FONT></FONT></FONT> + </P> + <OL> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Can + use it to create rule templates, where the templates are not + editable, but the rule parameters are.</FONT></FONT></FONT></P> + </OL> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Should + allow editing in normal drools snippets format for power users when + natural language is not appropriate.</FONT></FONT></FONT></P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Allow + rapid building of Domain Specific Languages (using the built in + dictionary)</FONT></FONT></FONT></P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">As + it works off HTML (or any appropriate markup language) can be driven + off a wiki. DHTML may be used to provide “intellisense” + in the future, or swing, but at the end of the day it is JUST TEXT + so it can easily be diff’ed (this is important).</FONT></FONT></FONT></P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Should + produce a HTML “output” file showing how the document + was parsed (this is hard... but worth it), and FIT test results.</FONT></FONT></FONT></P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">As + it HTML, source could be edited by an enhanced WYSIWYG DHTML editor + (which could restrict what is edited, provide “intellisense” + etc), providing a web interface for rules (an alternative to + document based rules).</FONT></FONT></FONT></P> + <LI><P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> + <FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Tests + can be embedded in the document by utilizing FIT (and fit-for-rules + from Michael), providing what if testing, and regression testing of + rules in isolation.</FONT></FONT></FONT></P> +</OL> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<IMG SRC="NaturalRulesSpec_html_m48cc1843.jpg" NAME="graphics2" ALIGN=LEFT HSPACE=23 VSPACE=23 WIDTH=185 HEIGHT=246 BORDER=0><BR CLEAR=LEFT><BR><BR> +</P> +<H1 CLASS="western"><FONT FACE="Verdana, sans-serif">OK Here we go. </FONT> +</H1> +<P><BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">The +term “Rule-start” indicates the start of a rule section, +which continues until “Rule-end”. This is from literate +programming. So just about everything outside is a “comment”. +This is the opposite of normal source.</FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt"><SPAN STYLE="background: #e6e6e6">Start-rule +[In-the-beginning]<BR>Priority[1]<BR>Group[group1]<BR>Input[String +message]</SPAN></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt"><B>IF<BR> </B><SPAN STYLE="font-weight: medium">Today +<I>is</I> before date of 10-Jul-2005 or Today is date of +10-Jul-2006<BR></SPAN><B>THEN<BR> </B><SPAN STYLE="font-weight: medium">Log +“I am a parameter to the log function”</SPAN></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt"> [System.out.println(“boo”)]</FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt"><SPAN STYLE="font-weight: medium"><I><BR></I><SPAN STYLE="background: #e6e6e6">End-rule</SPAN></SPAN></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Note +that the configuration of the rule, such as parameters, salience etc. +is done in a tabular fashion <I>somewhere else</I> in the document. </FONT></FONT></FONT> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">The +expressions in the rule are compiled with the aid of a dictionary. +You can help the lexer out by putting “[ and ]” around +multi word expressions. Alternatively, you can put whole expressions +in square brackets, and they will be passed through the natural +language compiler.</FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt"><I>TODO: +should some attributes like parameters be in the rule definition?</I></FONT></FONT></FONT></P> +<H3 CLASS="western"><FONT FACE="Verdana, sans-serif">The Dictionary +(how it works for starters)</FONT></H3> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">The +dictionary is a little embedded grammar. I chose the word dictionary +as I think it is more intuitive, and it is a very primitive grammar. +This ideally can be imported from another file if needs be. It would +be possibly to map between languages this way, within reason.</FONT></FONT></P> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">This +should be in an appendix hidden and protected. You can also think of +things on the right hand side as templates (although it is more +complex then just string interpolation – such as order of +operations, and nesting).</FONT></FONT></P> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">This +dictionary provides a grammar that is used to help process stuff in +the Rule sections of the document.</FONT></FONT></P> +<P><BR><BR> +</P> +<DL> + <DD> + <TABLE WIDTH=652 BORDER=0 CELLPADDING=0 CELLSPACING=0> + <COL WIDTH=178> + <COL WIDTH=474> + <THEAD> + <TR> + <TH COLSPAN=2 WIDTH=652 VALIGN=TOP BGCOLOR="#e6e6e6"> + <P ALIGN=LEFT STYLE="font-style: normal; font-weight: medium"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Dictionary</FONT></FONT></P> + </TH> + </TR> + </THEAD> + <TBODY> + <TR VALIGN=TOP> + <TD WIDTH=178> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Today</FONT></FONT></P> + </TD> + <TD WIDTH=474> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">new + java.util.Date()</FONT></FONT></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=178> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">before</FONT></FONT></P> + </TD> + <TD WIDTH=474> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">${left}.before(${right})</FONT></FONT></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=178> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">date + of</FONT></FONT></P> + </TD> + <TD WIDTH=474> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">convertToDate(“${right}”) + //use of a drools function</FONT></FONT></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=178> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Log</FONT></FONT></P> + </TD> + <TD WIDTH=474> + <P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">System.out.println(${right})</FONT></FONT></P> + </TD> + </TR> + </TBODY> + </TABLE> +</DL> +<P><BR><BR> +</P> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Ok +lets explain that. The first cell of the table tells drools that it +is a dictionary. The left column are the keywords (watch for case +sensitivity, can be a pain). On the right, there are the little +expressions. Notice that there is no prescribed language yet. In this +case it is a mix of java and drools functions. ${right} means the +token to the right, ${left} means the token to the left. You can also +use ${2} and ${-3} as well to indicate positions. </FONT></FONT> +</P> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Pretty +simple, it gets a little more complex, later (ie order of operations +and nesting, some special keywords). </FONT></FONT> +</P> +<P><BR><BR> +</P> +<H3 CLASS="western"><FONT FACE="Verdana, sans-serif">Tables for +configuration</FONT></H3> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">This +is “somewhere else” in the document. Ideally this sort of +stuff can be included from external resources if needed (to share +common stuff). Where this appears in the document is not important. +Appendix probably makes most sense.</FONT></FONT></P> +<P><BR><BR> +</P> +<P><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">The +"Rule configuration" table sets up technical attributes and +parameters for the rule.</FONT></FONT></P> +<DL> + <DD> + <TABLE WIDTH=560 BORDER=0 CELLPADDING=0 CELLSPACING=0> + <COL WIDTH=140> + <COL WIDTH=420> + <THEAD> + <TR> + <TH COLSPAN=2 WIDTH=560 VALIGN=TOP BGCOLOR="#e6e6e6"> + <P ALIGN=LEFT STYLE="font-style: normal; font-weight: medium"><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Rule-configuration</FONT></FONT></P> + </TH> + </TR> + </THEAD> + <TBODY> + <TR VALIGN=TOP> + <TD WIDTH=140> + <P ALIGN=LEFT><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">In-the-beginning</FONT></FONT></P> + </TD> + <TD WIDTH=420> + <P ALIGN=LEFT><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">Salience=1</FONT></FONT></P> + <P ALIGN=LEFT><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">xor-group=group1 + </FONT></FONT> + </P> + <P ALIGN=LEFT><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">no-loop=false</FONT></FONT></P> + <P ALIGN=LEFT><FONT FACE="Verdana, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">parameters=(String + message, Integer number)</FONT></FONT></P> + </TD> + </TR> + <TR VALIGN=TOP> + <TD WIDTH=140> + <P ALIGN=LEFT><BR> + </P> + </TD> + <TD WIDTH=420> + <P ALIGN=LEFT><BR> + </P> + </TD> + </TR> + </TBODY> + </TABLE> +</DL> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><I>Thats +it for now... go have a coffee. Spend some quality time with your +family. Remember them?</I></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><I>TODO: +Macros for content sharing. eg (Include something here) and (Import +something here). Just like literate programming.</I></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-weight: medium; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<FONT COLOR="#000000"><FONT FACE="Verdana, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><I>TODO: +Output as HTML the bits that are parsed out.</I></FONT></FONT></FONT></P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; font-style: normal; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +<P LANG="en-US" ALIGN=LEFT STYLE="margin-bottom: 0.32cm; background: transparent; line-height: 130%; page-break-inside: auto; widows: 2; orphans: 2; page-break-before: auto; page-break-after: auto"> +<BR><BR> +</P> +</BODY> +</HTML> \ No newline at end of file Property changes on: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/NaturalRulesSpec.html ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentListenerTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentListenerTest.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentListenerTest.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,32 @@ +package org.drools.natural.ruledoc; + +import java.util.List; + +import junit.framework.TestCase; + +public class RuleDocumentListenerTest extends TestCase +{ + + public void testListBuilder() { + RuleDocumentListener listener = new RuleDocumentListener(); + listener.handleText("ignore me\t \n"); + listener.handleText("Start-rule"); + listener.handleText("in a rule"); + listener.startComment(); + listener.handleText("a comment"); + listener.endComment(); + listener.handleText("End-rule"); + + listener.handleText("Start-rule something here"); + listener.handleText("in a rule"); + listener.handleText("End-rule"); + + + List list = listener.getRules(); + assertEquals(2, list.size()); + String rule = (String) list.get(0); + assertEquals("Start-rulein a ruleEnd-rule", rule); + + } + +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentListenerTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentTest.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentTest.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,29 @@ +package org.drools.natural.ruledoc; + +import java.util.List; +import java.util.Properties; +import java.io.InputStream; +import java.net.URL; + +import junit.framework.TestCase; + +public class RuleDocumentTest extends TestCase +{ + public void testSimpleParser() { + URL url = this.getClass().getResource("simple-ruledoc.html"); + RuleDocument doc = new RuleDocument(); + List rules = doc.buildRuleListFromDocument(url, new Properties()); + assertEquals(1, rules.size()); + System.out.println(rules.get(0)); + } + + + public void testTheSpec() { + URL url = this.getClass().getResource("NaturalRulesSpec.html"); + RuleDocument doc = new RuleDocument(); + List rules = doc.buildRuleListFromDocument(url, new Properties()); + assertEquals(1, rules.size()); + System.out.println(rules.get(0)); + } + +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/RuleDocumentTest.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserImplTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserImplTest.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserImplTest.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,73 +0,0 @@ -package org.drools.natural.ruledoc.html; - -import java.io.InputStream; - -import org.drools.natural.ruledoc.RuleDocumentListener; - -import junit.framework.TestCase; - -public class HTMLDocParserImplTest extends TestCase -{ - public void testDocParsing() throws Exception { - - MockRuleDocumentListenter listener = new MockRuleDocumentListenter(); - InputStream stream = this.getClass().getResourceAsStream("simplest.html"); - HTMLDocParserImpl parser = new HTMLDocParserImpl(); - parser.parseDocument(stream, listener); - assertTrue(listener.buf.toString().indexOf("line B") > 0); - assertFalse(listener.comment.toString().indexOf("comment") > 0); - System.out.println(listener.buf.toString()); - assertEquals("comment", listener.comment.toString()); - } - - static class MockRuleDocumentListenter implements RuleDocumentListener { - - public StringBuffer comment = new StringBuffer(); - public StringBuffer buf = new StringBuffer(); - private boolean inComment = false; - - public void handleText(String text) - { - if (!inComment) { - buf.append(text + "|"); - } else { - comment.append(text); - } - } - - public void startTable() - { - } - - public void startColumn() - { - } - - public void startRow() - { - } - - public void endTable() - { - } - - public void endColumn() - { - } - - public void endRow() - { - } - - public void startComment() - { - inComment = true; - } - - public void endComment() - { - inComment = false; - } - - } -} Added: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserTest.java =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserTest.java 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserTest.java 2005-12-21 07:32:06 UTC (rev 1910) @@ -0,0 +1,87 @@ +package org.drools.natural.ruledoc.html; + +import java.net.URL; +import java.util.Properties; + +import junit.framework.TestCase; + +import org.drools.natural.ruledoc.RuleDocumentListener; + +public class HTMLDocParserTest extends TestCase +{ + public void testDocParsing() throws Exception { + + MockRuleDocumentListenter listener = new MockRuleDocumentListenter(); + URL url = this.getClass().getResource("simplest.html"); + HTMLDocParser parser = new HTMLDocParser(); + parser.parseDocument(url.openConnection(), listener); + + assertTrue(listener.buf.toString().indexOf("A line") > 0); + assertFalse(listener.comment.toString().indexOf("comment") > 0); + + assertEquals("comment", listener.comment.toString()); + + assertTrue(listener.table.toString().indexOf("left1|right1") > 0); + } + + static class MockRuleDocumentListenter extends RuleDocumentListener { + + public StringBuffer comment = new StringBuffer(); + public StringBuffer buf = new StringBuffer(); + private boolean inComment = false; + public StringBuffer table = new StringBuffer(); + private boolean inTable = false; + + public void handleText(String text) + { + if (inComment) { + comment.append(text); + } else if (inTable) { + table.append(text); + } + else { + buf.append(text); + + } + } + + public void startTable() + { + inTable = true; + } + + public void startColumn() + { + this.table.append("|"); + } + + public void startRow() + { + } + + public void endTable() + { + this.table.append("||"); + inTable = false; + } + + public void endColumn() + { + } + + public void endRow() + { + } + + public void startComment() + { + inComment = true; + } + + public void endComment() + { + inComment = false; + } + + } +} Property changes on: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/HTMLDocParserTest.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/NaturalRulesSpec.html =================================================================== --- trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/NaturalRulesSpec.html 2005-12-21 02:40:16 UTC (rev 1909) +++ trunk/labs/jbossrules/drools-natural-language/src/test/org/drools/natural/ruledoc/html/NaturalRulesSpec.html 2005-12-21 07:32:06 UTC (rev 1910) @@ -1,303 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> -<HEAD> - <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> - <TITLE></TITLE> - <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Win32)"> - <META NAME="CREATED" CONTENT="20051214;11592400"> - <META NAME="CHANGEDBY" CONTENT="Michael Neale"> - <META NAME="CHANGED" CONTENT="20051215;16490707"> - <STYLE> - <!-- - @page { size: 21cm 29.7cm; margin: 2cm } - P { margin-bottom: 0.21cm } - H1 { margin-bottom: 0.21cm } - H1.western { font-family: "Arial", sans-serif; font-... [truncated message content] |
From: <jbo...@li...> - 2005-12-21 02:40:28
|
Author: mar...@jb... Date: 2005-12-20 21:40:16 -0500 (Tue, 20 Dec 2005) New Revision: 1909 Added: trunk/labs/jbossrules/drools-manual/drools-manual.css trunk/labs/jbossrules/drools-manual/drools-manual.html trunk/labs/jbossrules/drools-manual/drools-manual2.html trunk/labs/jbossrules/drools-manual/drools-manual3.html Log: JBRULES-8 -HTML manual to be generated from time to time Added: trunk/labs/jbossrules/drools-manual/drools-manual.css =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual.css 2005-12-21 02:32:24 UTC (rev 1908) +++ trunk/labs/jbossrules/drools-manual/drools-manual.css 2005-12-21 02:40:16 UTC (rev 1909) @@ -0,0 +1,93 @@ + +/* start css.sty */ +.cmbx-12x-x-207{font-size:248%; font-weight: bold;} +.cmr-12{font-size:120%;} +body#tex4ht-menu {white-space: nowrap; } +p.noindent { text-indent: 0em } +p.nopar { text-indent: 0em; } +p.indent{ text-indent: 1.5em } +@media print {div.crosslinks {visibility:hidden;}} +a img { border-top: 0; border-left: 0; border-right: 0; } +center { margin-top:1em; margin-bottom:1em; } +td center { margin-top:0em; margin-bottom:0em; } +.Canvas { position:relative; } +img.math{vertical-align:middle;} +li p.indent { text-indent: 0em } +.obeylines-h,.obeylines-v {white-space: nowrap; } +div.obeylines-v p { margin-top:0; margin-bottom:0; } +.overline{ text-decoration:overline; } +.overline img{ border-top: 1px solid black; } +td.displaylines {text-align:center; white-space:nowrap;} +.centerline {text-align:center;} +.rightline {text-align:right;} +div.verbatim {font-family: monospace; white-space: nowrap; } +.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +table.minipage{width:100%;} +div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} +div.center div {text-align: left;} +div.flushright, div.flushright div.flushright {text-align: right;} +div.flushright div {text-align: left;} +div.flushleft {text-align: left;} +.underline{ text-decoration:underline; } +.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; } +.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } +.framebox-c {text-align:center;} +.framebox-l {text-align:left;} +.framebox-r {text-align:right;} +span.thank-mark{ vertical-align: super } +div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; } +table.tabular td p{margin-top:0em;} +table.tabular {margin-left: auto; margin-right: auto;} +div.td00{ margin-left:0pt; margin-right:0pt; } +div.td01{ margin-left:0pt; margin-right:5pt; } +div.td10{ margin-left:5pt; margin-right:0pt; } +div.td11{ margin-left:5pt; margin-right:5pt; } +td.td00{ padding-left:0pt; padding-right:0pt; } +td.td01{ padding-left:0pt; padding-right:5pt; } +td.td10{ padding-left:5pt; padding-right:0pt; } +td.td11{ padding-left:5pt; padding-right:5pt; } +.hline hr, .cline hr{ height : 1px; } +.tabbing-right {text-align:right;} +div.newtheorem { margin-bottom: 2em; margin-top: 2em;} +span.TEX {letter-spacing: -0.125em; } +span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;} +a span.TEX span.E {text-decoration: none; } +span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;} +span.LATEX span.TEX{ position:relative; left: -0.4em; } +.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;} +.marginpar p{margin-top:0.4em; margin-bottom:0.4em;} +div.float img, div.float .caption {text-align:center;} +div.figure img, div.figure .caption {text-align:center;} +.equation td{text-align:center; } +td.equation { margin-top:1em; margin-bottom:1em; } +td.eqnarray4 { width:5%; white-space: normal; } +td.eqnarray2 { width:5%; } +table.eqnarray-star, table.eqnarray {width:100%;} +div.eqnarray{text-align:center;} +div.array {text-align:center;} +div.pmatrix {text-align:center;} +span.pmatrix img{vertical-align:middle;} +div.pmatrix {text-align:center;} +img.cdots{vertical-align:middle;} +.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;} +.chapterToc a, .chapterToc, .likechapterToc a, .likechapterToc, .appendixToc a, .appendixToc {line-height: 200%; font-weight:bold;} +.caption td.id{font-weight: bold; white-space: nowrap; } +table.caption {text-align:center;} +h1.partHead{text-align: center} +p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } +.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;} +.subparagraphHead, .likesubparagraphHead { font-weight: bold;} +.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; } +.verse{white-space:nowrap; margin-left:2em} +div.maketitle {text-align:center;} +h2.titleHead{text-align:center;} +div.maketitle{ margin-bottom: 2em; } +div.author, div.date {text-align:center;} +div.thanks{text-align:left; margin-left:10%; font-size:80%; font-style:italic; } +div.author{white-space: nowrap;} +.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; } +h1.partHead{text-align: center} +div.lstinputlisting{ font-family: monospace; white-space: nowrap; } +body{ background-color: white;} +/* end css.sty */ Added: trunk/labs/jbossrules/drools-manual/drools-manual.html =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual.html 2005-12-21 02:32:24 UTC (rev 1908) +++ trunk/labs/jbossrules/drools-manual/drools-manual.html 2005-12-21 02:40:16 UTC (rev 1909) @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" +"http://www.w3.org/TR/html4/frameset.dtd"> +<html > +<head><title>Drools the JBoss Rules</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<!-- html,frames,png --> +<meta name="src" content="drools-manual.tex"> +<meta name="date" content="2005-12-21 01:40:00"> +<link rel="stylesheet" type="text/css" href="drools-manual.css"> +</head><frameset +cols="*,3*" rows="*"> <frame + src="drools-manual2.html#tex4ht-toc" name="tex4ht-menu" frameborder="0" /> <frame + src="drools-manual3.html#tex4ht-body" name="tex4ht-main" frameborder="0" /> <noframes><body> <a +href="drools-manual2.html" id="drools-manual2.html" >table of contents</a> <br /> <a +href="drools-manual3.html" id="drools-manual3.html" >text</a></body></noframes></frameset></html> + + + + Added: trunk/labs/jbossrules/drools-manual/drools-manual2.html =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual2.html 2005-12-21 02:32:24 UTC (rev 1908) +++ trunk/labs/jbossrules/drools-manual/drools-manual2.html 2005-12-21 02:40:16 UTC (rev 1909) @@ -0,0 +1,140 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html > +<head><title>table of contents</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<!-- html,frames,png --> +<meta name="src" content="drools-manual.tex"> +<meta name="date" content="2005-12-21 01:40:00"> +<link rel="stylesheet" type="text/css" href="drools-manual.css"> +</head><body +id="tex4ht-menu"> + <a + id="tex4ht-toc"></a> <div class="tableofcontents"> + <span class="partToc">I <a +target="tex4ht-main" href="drools-manual3.html#x3-2000I" name="QQ2-3-2">Drools</a></span> +<br> <span class="chapterToc">1 <a +target="tex4ht-main" href="drools-manual3.html#x3-30001" name="QQ2-3-3">The Rule Engine</a></span> +<br> <span class="sectionToc">1.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-40001.1" name="QQ2-3-4">Rete Algorithm</a></span> +<br> <span class="sectionToc">1.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-50001.2" name="QQ2-3-5">Rule Base</a></span> +<br> <span class="sectionToc">1.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-60001.3" name="QQ2-3-6">Working Memory</a></span> +<br> <span class="subsectionToc">1.3.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-70001.3.1" name="QQ2-3-7">Facts</a></span> +<br> <span class="subsectionToc">1.3.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-80001.3.2" name="QQ2-3-8">Assertion</a></span> +<br> <span class="subsectionToc">1.3.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-90001.3.3" name="QQ2-3-9">Retraction</a></span> +<br> <span class="subsectionToc">1.3.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-100001.3.4" name="QQ2-3-10">Modification</a></span> +<br> <span class="subsectionToc">1.3.5 <a +target="tex4ht-main" href="drools-manual3.html#x3-110001.3.5" name="QQ2-3-11">Application Data</a></span> +<br> <span class="subsectionToc">1.3.6 <a +target="tex4ht-main" href="drools-manual3.html#x3-120001.3.6" name="QQ2-3-12">Property Change Listeners</a></span> +<br> <span class="subsectionToc">1.3.7 <a +target="tex4ht-main" href="drools-manual3.html#x3-130001.3.7" name="QQ2-3-13">Shadow Facts</a></span> +<br> <span class="subsectionToc">1.3.8 <a +target="tex4ht-main" href="drools-manual3.html#x3-140001.3.8" name="QQ2-3-14">Stateless and Stateful Sessions</a></span> +<br> <span class="subsectionToc">1.3.9 <a +target="tex4ht-main" href="drools-manual3.html#x3-150001.3.9" name="QQ2-3-15">Synchronisation and Threading Issues</a></span> +<br> <span class="sectionToc">1.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-160001.4" name="QQ2-3-16">Agenda</a></span> +<br> <span class="subsectionToc">1.4.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-170001.4.1" name="QQ2-3-17">Conflict Resolution</a></span> +<br> <span class="subsectionToc">1.4.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-180001.4.2" name="QQ2-3-18">Modules</a></span> +<br> <span class="subsectionToc">1.4.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-190001.4.3" name="QQ2-3-19">Filters</a></span> +<br> <span class="sectionToc">1.5 <a +target="tex4ht-main" href="drools-manual3.html#x3-200001.5" name="QQ2-3-20">Event Model</a></span> +<br> <span class="subsectionToc">1.5.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-210001.5.1" name="QQ2-3-21">Debug Event Listener</a></span> +<br> <span class="subsectionToc">1.5.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-220001.5.2" name="QQ2-3-22">Audit Event Listener</a></span> +<br> <span class="chapterToc">2 <a +target="tex4ht-main" href="drools-manual3.html#x3-230002" name="QQ2-3-23">The Rule Assembly Language</a></span> +<br> <span class="sectionToc">2.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-240002.1" name="QQ2-3-24">Rule Overview</a></span> +<br> <span class="sectionToc">2.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-250002.2" name="QQ2-3-25">Pattern Matching</a></span> +<br> <span class="subsectionToc">2.2.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-260002.2.1" name="QQ2-3-26">Columns</a></span> +<br> <span class="subsectionToc">2.2.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-290002.2.2" name="QQ2-3-29">Constraints</a></span> +<br> <span class="subsectionToc">2.2.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-330002.2.3" name="QQ2-3-33">Conditional Elements</a></span> +<br> <span class="subsectionToc">2.2.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-420002.2.4" name="QQ2-3-42">Functions</a></span> +<br> <span class="subsectionToc">2.2.5 <a +target="tex4ht-main" href="drools-manual3.html#x3-430002.2.5" name="QQ2-3-43">Application Data</a></span> +<br> <span class="subsectionToc">2.2.6 <a +target="tex4ht-main" href="drools-manual3.html#x3-440002.2.6" name="QQ2-3-44">Imports</a></span> +<br> <span class="sectionToc">2.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-450002.3" name="QQ2-3-45">Rule Execution Control</a></span> +<br> <span class="subsectionToc">2.3.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-460002.3.1" name="QQ2-3-46">Salience</a></span> +<br> <span class="subsectionToc">2.3.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-470002.3.2" name="QQ2-3-47">Semaphores</a></span> +<br> <span class="subsectionToc">2.3.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-480002.3.3" name="QQ2-3-48">Modules</a></span> +<br> <span class="subsectionToc">2.3.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-490002.3.4" name="QQ2-3-49">Xor Group</a></span> +<br> <span class="sectionToc">2.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-500002.4" name="QQ2-3-50">Temporal Rules</a></span> +<br> <span class="sectionToc">2.5 <a +target="tex4ht-main" href="drools-manual3.html#x3-510002.5" name="QQ2-3-51">Truth Maintenance</a></span> +<br> <span class="sectionToc">2.6 <a +target="tex4ht-main" href="drools-manual3.html#x3-520002.6" name="QQ2-3-52">Searching with Query</a></span> +<br> <span class="chapterToc">3 <a +target="tex4ht-main" href="drools-manual3.html#x3-530003" name="QQ2-3-53">Semantic Module Framework</a></span> +<br> <span class="sectionToc">3.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-540003.1" name="QQ2-3-54">Semantic Modules</a></span> +<br> <span class="subsectionToc">3.1.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-550003.1.1" name="QQ2-3-55">Java</a></span> +<br> <span class="subsectionToc">3.1.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-560003.1.2" name="QQ2-3-56">Groovy</a></span> +<br> <span class="subsectionToc">3.1.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-570003.1.3" name="QQ2-3-57">Python</a></span> +<br> <span class="subsectionToc">3.1.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-580003.1.4" name="QQ2-3-58">C#</a></span> + + + +<br> <span class="chapterToc">4 <a +target="tex4ht-main" href="drools-manual3.html#x3-590004" name="QQ2-3-59">JSR-94</a></span> +<br> <span class="chapterToc">5 <a +target="tex4ht-main" href="drools-manual3.html#x3-600005" name="QQ2-3-60">Decision Tables</a></span> +<br> <span class="chapterToc">6 <a +target="tex4ht-main" href="drools-manual3.html#x3-610006" name="QQ2-3-61">Building and Deploying Rule Bases</a></span> +<br> <span class="sectionToc">6.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-620006.1" name="QQ2-3-62">Loading a Rule Set</a></span> +<br> <span class="sectionToc">6.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-630006.2" name="QQ2-3-63">Loading a Rule Base</a></span> +<br> <span class="sectionToc">6.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-640006.3" name="QQ2-3-64">Deployment with Drools Deployment Jars (.ddj)</a></span> +<br> <span class="sectionToc">6.4 <a +target="tex4ht-main" href="drools-manual3.html#x3-650006.4" name="QQ2-3-65">Debugging with Drools Deployment Source Jars </a></span> +<br> <span class="chapterToc">7 <a +target="tex4ht-main" href="drools-manual3.html#x3-660007" name="QQ2-3-66">Rule Management</a></span> +<br> <span class="sectionToc">7.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-670007.1" name="QQ2-3-67">The Rule Repository</a></span> +<br> <span class="chapterToc">8 <a +target="tex4ht-main" href="drools-manual3.html#x3-680008" name="QQ2-3-68">Developing Drools</a></span> +<br> <span class="sectionToc">8.1 <a +target="tex4ht-main" href="drools-manual3.html#x3-690008.1" name="QQ2-3-69">Building with Maven 2.0</a></span> +<br> <span class="sectionToc">8.2 <a +target="tex4ht-main" href="drools-manual3.html#x3-700008.2" name="QQ2-3-70">Using Eclipse</a></span> +<br> <span class="sectionToc">8.3 <a +target="tex4ht-main" href="drools-manual3.html#x3-710008.3" name="QQ2-3-71">Using IntelliJ</a></span> +<br> <span class="partToc">II <a +target="tex4ht-main" href="drools-manual3.html#x3-72000II" name="QQ2-3-72">Examples and Case Studies/Examples and Case Studies</a></span> + </div> + + + + +</body></html> Added: trunk/labs/jbossrules/drools-manual/drools-manual3.html =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual3.html 2005-12-21 02:32:24 UTC (rev 1908) +++ trunk/labs/jbossrules/drools-manual/drools-manual3.html 2005-12-21 02:40:16 UTC (rev 1909) @@ -0,0 +1,512 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html > +<head><title>text</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html)"> +<!-- html,frames,png --> +<meta name="src" content="drools-manual.tex"> +<meta name="date" content="2005-12-21 01:40:00"> +<link rel="stylesheet" type="text/css" href="drools-manual.css"> +</head><body +id="tex4ht-main"> + <a + id="tex4ht-body"></a> + <div class="maketitle"> + + + + + + + + + +<h2 class="titleHead">Drools<br> +the<br> +JBoss Rules</h2> + <div class="author" ><span +class="cmr-12">Mark Proctor,</span> +<br><span +class="cmr-12">Bob McWhirter,</span> +<br> <span +class="cmr-12">Michael Neale</span></div> +<br> +<div class="date" ><span +class="cmr-12">December 21, 2005</span></div> + + + + </div> + + + + <h2 class="likechapterHead"><a + id="x3-1000"></a>Contents</h2> <div class="tableofcontents"> + <span class="partToc">I <a +href="#x3-2000I" id="QQ2-3-2">Drools</a></span> +<br> <span class="chapterToc">1 <a +href="#x3-30001" id="QQ2-3-3">The Rule Engine</a></span> +<br> <span class="sectionToc">1.1 <a +href="#x3-40001.1" id="QQ2-3-4">Rete Algorithm</a></span> +<br> <span class="sectionToc">1.2 <a +href="#x3-50001.2" id="QQ2-3-5">Rule Base</a></span> +<br> <span class="sectionToc">1.3 <a +href="#x3-60001.3" id="QQ2-3-6">Working Memory</a></span> +<br> <span class="subsectionToc">1.3.1 <a +href="#x3-70001.3.1" id="QQ2-3-7">Facts</a></span> +<br> <span class="subsectionToc">1.3.2 <a +href="#x3-80001.3.2" id="QQ2-3-8">Assertion</a></span> +<br> <span class="subsectionToc">1.3.3 <a +href="#x3-90001.3.3" id="QQ2-3-9">Retraction</a></span> +<br> <span class="subsectionToc">1.3.4 <a +href="#x3-100001.3.4" id="QQ2-3-10">Modification</a></span> +<br> <span class="subsectionToc">1.3.5 <a +href="#x3-110001.3.5" id="QQ2-3-11">Application Data</a></span> +<br> <span class="subsectionToc">1.3.6 <a +href="#x3-120001.3.6" id="QQ2-3-12">Property Change Listeners</a></span> +<br> <span class="subsectionToc">1.3.7 <a +href="#x3-130001.3.7" id="QQ2-3-13">Shadow Facts</a></span> +<br> <span class="subsectionToc">1.3.8 <a +href="#x3-140001.3.8" id="QQ2-3-14">Stateless and Stateful Sessions</a></span> +<br> <span class="subsectionToc">1.3.9 <a +href="#x3-150001.3.9" id="QQ2-3-15">Synchronisation and Threading Issues</a></span> +<br> <span class="sectionToc">1.4 <a +href="#x3-160001.4" id="QQ2-3-16">Agenda</a></span> +<br> <span class="subsectionToc">1.4.1 <a +href="#x3-170001.4.1" id="QQ2-3-17">Conflict Resolution</a></span> +<br> <span class="subsectionToc">1.4.2 <a +href="#x3-180001.4.2" id="QQ2-3-18">Modules</a></span> +<br> <span class="subsectionToc">1.4.3 <a +href="#x3-190001.4.3" id="QQ2-3-19">Filters</a></span> +<br> <span class="sectionToc">1.5 <a +href="#x3-200001.5" id="QQ2-3-20">Event Model</a></span> +<br> <span class="subsectionToc">1.5.1 <a +href="#x3-210001.5.1" id="QQ2-3-21">Debug Event Listener</a></span> +<br> <span class="subsectionToc">1.5.2 <a +href="#x3-220001.5.2" id="QQ2-3-22">Audit Event Listener</a></span> +<br> <span class="chapterToc">2 <a +href="#x3-230002" id="QQ2-3-23">The Rule Assembly Language</a></span> +<br> <span class="sectionToc">2.1 <a +href="#x3-240002.1" id="QQ2-3-24">Rule Overview</a></span> +<br> <span class="sectionToc">2.2 <a +href="#x3-250002.2" id="QQ2-3-25">Pattern Matching</a></span> +<br> <span class="subsectionToc">2.2.1 <a +href="#x3-260002.2.1" id="QQ2-3-26">Columns</a></span> +<br> <span class="subsectionToc">2.2.2 <a +href="#x3-290002.2.2" id="QQ2-3-29">Constraints</a></span> +<br> <span class="subsectionToc">2.2.3 <a +href="#x3-330002.2.3" id="QQ2-3-33">Conditional Elements</a></span> +<br> <span class="subsectionToc">2.2.4 <a +href="#x3-420002.2.4" id="QQ2-3-42">Functions</a></span> +<br> <span class="subsectionToc">2.2.5 <a +href="#x3-430002.2.5" id="QQ2-3-43">Application Data</a></span> +<br> <span class="subsectionToc">2.2.6 <a +href="#x3-440002.2.6" id="QQ2-3-44">Imports</a></span> +<br> <span class="sectionToc">2.3 <a +href="#x3-450002.3" id="QQ2-3-45">Rule Execution Control</a></span> +<br> <span class="subsectionToc">2.3.1 <a +href="#x3-460002.3.1" id="QQ2-3-46">Salience</a></span> +<br> <span class="subsectionToc">2.3.2 <a +href="#x3-470002.3.2" id="QQ2-3-47">Semaphores</a></span> +<br> <span class="subsectionToc">2.3.3 <a +href="#x3-480002.3.3" id="QQ2-3-48">Modules</a></span> +<br> <span class="subsectionToc">2.3.4 <a +href="#x3-490002.3.4" id="QQ2-3-49">Xor Group</a></span> +<br> <span class="sectionToc">2.4 <a +href="#x3-500002.4" id="QQ2-3-50">Temporal Rules</a></span> + + + +<br> <span class="sectionToc">2.5 <a +href="#x3-510002.5" id="QQ2-3-51">Truth Maintenance</a></span> +<br> <span class="sectionToc">2.6 <a +href="#x3-520002.6" id="QQ2-3-52">Searching with Query</a></span> +<br> <span class="chapterToc">3 <a +href="#x3-530003" id="QQ2-3-53">Semantic Module Framework</a></span> +<br> <span class="sectionToc">3.1 <a +href="#x3-540003.1" id="QQ2-3-54">Semantic Modules</a></span> +<br> <span class="subsectionToc">3.1.1 <a +href="#x3-550003.1.1" id="QQ2-3-55">Java</a></span> +<br> <span class="subsectionToc">3.1.2 <a +href="#x3-560003.1.2" id="QQ2-3-56">Groovy</a></span> +<br> <span class="subsectionToc">3.1.3 <a +href="#x3-570003.1.3" id="QQ2-3-57">Python</a></span> +<br> <span class="subsectionToc">3.1.4 <a +href="#x3-580003.1.4" id="QQ2-3-58">C#</a></span> +<br> <span class="chapterToc">4 <a +href="#x3-590004" id="QQ2-3-59">JSR-94</a></span> +<br> <span class="chapterToc">5 <a +href="#x3-600005" id="QQ2-3-60">Decision Tables</a></span> +<br> <span class="chapterToc">6 <a +href="#x3-610006" id="QQ2-3-61">Building and Deploying Rule Bases</a></span> +<br> <span class="sectionToc">6.1 <a +href="#x3-620006.1" id="QQ2-3-62">Loading a Rule Set</a></span> +<br> <span class="sectionToc">6.2 <a +href="#x3-630006.2" id="QQ2-3-63">Loading a Rule Base</a></span> +<br> <span class="sectionToc">6.3 <a +href="#x3-640006.3" id="QQ2-3-64">Deployment with Drools Deployment Jars (.ddj)</a></span> +<br> <span class="sectionToc">6.4 <a +href="#x3-650006.4" id="QQ2-3-65">Debugging with Drools Deployment Source Jars </a></span> +<br> <span class="chapterToc">7 <a +href="#x3-660007" id="QQ2-3-66">Rule Management</a></span> +<br> <span class="sectionToc">7.1 <a +href="#x3-670007.1" id="QQ2-3-67">The Rule Repository</a></span> +<br> <span class="chapterToc">8 <a +href="#x3-680008" id="QQ2-3-68">Developing Drools</a></span> +<br> <span class="sectionToc">8.1 <a +href="#x3-690008.1" id="QQ2-3-69">Building with Maven 2.0</a></span> +<br> <span class="sectionToc">8.2 <a +href="#x3-700008.2" id="QQ2-3-70">Using Eclipse</a></span> +<br> <span class="sectionToc">8.3 <a +href="#x3-710008.3" id="QQ2-3-71">Using IntelliJ</a></span> +<br> <span class="partToc">II <a +href="#x3-72000II" id="QQ2-3-72">Examples and Case Studies/Examples and Case Studies</a></span> + </div> + + + +<!--l. 26--><p class="indent"> + + + +<!--l. 26--><p class="indent"> + + + + <h1 class="partHead"><span class="titlemark">Part I<br></span><a + id="x3-2000I"></a>Drools</h1> + + + + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 1</span><br><a + id="x3-30001"></a>The Rule Engine</h2> There is text in first chapter + <h3 class="sectionHead"><span class="titlemark">1.1 </span> <a + id="x3-40001.1"></a>Rete Algorithm</h3> +<!--l. 6--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">1.2 </span> <a + id="x3-50001.2"></a>Rule Base</h3> +<!--l. 8--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">1.3 </span> <a + id="x3-60001.3"></a>Working Memory</h3> +<!--l. 9--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.1 </span> <a + id="x3-70001.3.1"></a>Facts</h4> +<!--l. 10--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.2 </span> <a + id="x3-80001.3.2"></a>Assertion</h4> +<!--l. 11--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.3 </span> <a + id="x3-90001.3.3"></a>Retraction</h4> +<!--l. 12--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.4 </span> <a + id="x3-100001.3.4"></a>Modification</h4> +<!--l. 13--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.5 </span> <a + id="x3-110001.3.5"></a>Application Data</h4> +<!--l. 14--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.6 </span> <a + id="x3-120001.3.6"></a>Property Change Listeners</h4> +<!--l. 15--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.7 </span> <a + id="x3-130001.3.7"></a>Shadow Facts</h4> + + + +<!--l. 16--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.8 </span> <a + id="x3-140001.3.8"></a>Stateless and Stateful Sessions</h4> +<!--l. 17--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.3.9 </span> <a + id="x3-150001.3.9"></a>Synchronisation and Threading Issues</h4> +<!--l. 19--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">1.4 </span> <a + id="x3-160001.4"></a>Agenda</h3> +<!--l. 20--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.4.1 </span> <a + id="x3-170001.4.1"></a>Conflict Resolution</h4> +<!--l. 21--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.4.2 </span> <a + id="x3-180001.4.2"></a>Modules</h4> +<!--l. 22--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.4.3 </span> <a + id="x3-190001.4.3"></a>Filters</h4> +<!--l. 24--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">1.5 </span> <a + id="x3-200001.5"></a>Event Model</h3> +<!--l. 25--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.5.1 </span> <a + id="x3-210001.5.1"></a>Debug Event Listener</h4> +<!--l. 26--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">1.5.2 </span> <a + id="x3-220001.5.2"></a>Audit Event Listener</h4> + + + + + + + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 2</span><br><a + id="x3-230002"></a>The Rule Assembly Language</h2> There is text in first chapter + <h3 class="sectionHead"><span class="titlemark">2.1 </span> <a + id="x3-240002.1"></a>Rule Overview</h3> +<!--l. 6--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">2.2 </span> <a + id="x3-250002.2"></a>Pattern Matching</h3> +<!--l. 8--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.1 </span> <a + id="x3-260002.2.1"></a>Columns</h4> +<!--l. 9--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-270002.2.1"></a>Column Bindings</h5> +<!--l. 10--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-280002.2.1"></a>Field Bindings</h5> +<!--l. 12--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.2 </span> <a + id="x3-290002.2.2"></a>Constraints</h4> +<!--l. 13--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-300002.2.2"></a>Literal Constraints</h5> +<!--l. 14--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-310002.2.2"></a>Predicate Field Constraints</h5> +<!--l. 15--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-320002.2.2"></a>Return Value Constraints</h5> +<!--l. 17--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.3 </span> <a + id="x3-330002.2.3"></a>Conditional Elements</h4> + + + +<!--l. 18--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-340002.2.3"></a>The ’evaluate’ Conditional Element</h5> +<!--l. 19--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-350002.2.3"></a>The ’and’ Conditional Element</h5> +<!--l. 20--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-360002.2.3"></a>The ’or’ Conditional Element</h5> +<!--l. 21--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-370002.2.3"></a>The ’not’ Conditional Element</h5> +<!--l. 22--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-380002.2.3"></a>The ’exist’ Conditional Element</h5> +<!--l. 23--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-390002.2.3"></a>The ’forall’ Conditional Element</h5> +<!--l. 24--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-400002.2.3"></a>The ’accumulate’ Conditional Element</h5> +<!--l. 25--><p class="noindent"> + <h5 class="subsubsectionHead"><a + id="x3-410002.2.3"></a>The ’logical’ Conditional Element</h5> +<!--l. 27--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.4 </span> <a + id="x3-420002.2.4"></a>Functions</h4> +<!--l. 29--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.5 </span> <a + id="x3-430002.2.5"></a>Application Data</h4> +<!--l. 31--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.2.6 </span> <a + id="x3-440002.2.6"></a>Imports</h4> + + + +<!--l. 33--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">2.3 </span> <a + id="x3-450002.3"></a>Rule Execution Control</h3> +<!--l. 34--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.3.1 </span> <a + id="x3-460002.3.1"></a>Salience</h4> +<!--l. 35--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.3.2 </span> <a + id="x3-470002.3.2"></a>Semaphores</h4> +<!--l. 36--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.3.3 </span> <a + id="x3-480002.3.3"></a>Modules</h4> +<!--l. 37--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">2.3.4 </span> <a + id="x3-490002.3.4"></a>Xor Group</h4> +<!--l. 39--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">2.4 </span> <a + id="x3-500002.4"></a>Temporal Rules</h3> +<!--l. 41--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">2.5 </span> <a + id="x3-510002.5"></a>Truth Maintenance</h3> +<!--l. 43--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">2.6 </span> <a + id="x3-520002.6"></a>Searching with Query</h3> + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 3</span><br><a + id="x3-530003"></a>Semantic Module Framework</h2> There is text in first chapter + <h3 class="sectionHead"><span class="titlemark">3.1 </span> <a + id="x3-540003.1"></a>Semantic Modules</h3> +<!--l. 6--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">3.1.1 </span> <a + id="x3-550003.1.1"></a>Java</h4> +<!--l. 8--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">3.1.2 </span> <a + id="x3-560003.1.2"></a>Groovy</h4> +<!--l. 10--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">3.1.3 </span> <a + id="x3-570003.1.3"></a>Python</h4> +<!--l. 12--><p class="noindent"> + <h4 class="subsectionHead"><span class="titlemark">3.1.4 </span> <a + id="x3-580003.1.4"></a>C#</h4> + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 4</span><br><a + id="x3-590004"></a>JSR-94</h2> There is text in first chapter + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 5</span><br><a + id="x3-600005"></a>Decision Tables</h2> There is text in first chapter + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 6</span><br><a + id="x3-610006"></a>Building and Deploying Rule Bases</h2> There is text in first chapter + <h3 class="sectionHead"><span class="titlemark">6.1 </span> <a + id="x3-620006.1"></a>Loading a Rule Set</h3> +<!--l. 6--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">6.2 </span> <a + id="x3-630006.2"></a>Loading a Rule Base</h3> +<!--l. 8--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">6.3 </span> <a + id="x3-640006.3"></a>Deployment with Drools Deployment Jars (.ddj)</h3> +<!--l. 10--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">6.4 </span> <a + id="x3-650006.4"></a>Debugging with Drools Deployment Source Jars </h3> + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 7</span><br><a + id="x3-660007"></a>Rule Management</h2> There is text in first chapter + <h3 class="sectionHead"><span class="titlemark">7.1 </span> <a + id="x3-670007.1"></a>The Rule Repository</h3> + + + + + + + + + +<!--l. 1--><p class="indent"> + + + + <h2 class="chapterHead"><span class="titlemark">Chapter 8</span><br><a + id="x3-680008"></a>Developing Drools</h2> + <h3 class="sectionHead"><span class="titlemark">8.1 </span> <a + id="x3-690008.1"></a>Building with Maven 2.0</h3> +<!--l. 5--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">8.2 </span> <a + id="x3-700008.2"></a>Using Eclipse</h3> +<!--l. 7--><p class="noindent"> + <h3 class="sectionHead"><span class="titlemark">8.3 </span> <a + id="x3-710008.3"></a>Using IntelliJ</h3> + + + + + + +<!--l. 44--><p class="indent"> + + + +<!--l. 44--><p class="indent"> + + + + <h1 class="partHead"><span class="titlemark">Part II<br></span><a + id="x3-72000II"></a>Examples and Case Studies/Examples and Case Studies</h1> + + + +<!--l. 47--><p class="indent"> + + + + <h2 class="likechapterHead"><a + id="x3-73000II"></a>Bibliography</h2> + <div class="thebibliography"> + <p class="bibitem"><span class="biblabel"> + [1]<span class="bibsp"> </span></span><a + id="XLabel1"></a>... + </p> + <p class="bibitem"><span class="biblabel"> + [2]<span class="bibsp"> </span></span><a + id="XLabel2"></a>...</p></div> + + + + +</body></html> |
From: <jbo...@li...> - 2005-12-21 02:32:31
|
Author: wrzep Date: 2005-12-20 21:32:24 -0500 (Tue, 20 Dec 2005) New Revision: 1908 Modified: trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java Log: comments for Tomek&Adam http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java 2005-12-21 02:20:52 UTC (rev 1907) +++ trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java 2005-12-21 02:32:24 UTC (rev 1908) @@ -95,6 +95,8 @@ "utf-8"); } + /** Unimplemented methods from kosmos 0.1.7 - Pawel Wrzeszcz */ + public void begin() {}; public void end() {}; Modified: trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java 2005-12-21 02:20:52 UTC (rev 1907) +++ trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java 2005-12-21 02:32:24 UTC (rev 1908) @@ -112,6 +112,8 @@ "utf-8"); } + /** Unimplemented methods from kosmos 0.1.7 - Pawel Wrzeszcz */ + public void begin() {}; public void end() {}; Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-21 02:20:52 UTC (rev 1907) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-21 02:32:24 UTC (rev 1908) @@ -70,7 +70,7 @@ try { service = (SvnService) factory.create(SvnService.class, serviceURL); } catch (MalformedURLException e) { - log.error("Can not connect to kosmos svn service: " + serviceURL); + log.error("Can not connect to the kosmos svn service: " + serviceURL); return null; } |
From: <jbo...@li...> - 2005-12-21 02:20:57
|
Author: wrzep Date: 2005-12-20 21:20:52 -0500 (Tue, 20 Dec 2005) New Revision: 1907 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java Log: node update only when needed http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java 2005-12-21 01:41:54 UTC (rev 1906) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java 2005-12-21 02:20:52 UTC (rev 1907) @@ -54,10 +54,6 @@ String scorePluginsPath = StatusTools.getXmlScorePluginsCmPath(portalName); Node scorePluginsRoot = getRoot(cm, scorePluginsPath); - /* - if ((root.getNodeType() == Node.ELEMENT_NODE) - && (root.getNodeName().equals("projects"))) {}*/ - status = new Status(portalName, statusRoot, statusPluginsRoot, scorePluginsRoot); fillContext(); Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java 2005-12-21 01:41:54 UTC (rev 1906) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java 2005-12-21 02:20:52 UTC (rev 1907) @@ -22,9 +22,12 @@ package org.jboss.forge.status; import org.jboss.forge.common.service.NodeWatcher; +import org.jboss.forge.common.service.ResourceWatcher; import org.jboss.shotoku.ContentManager; public class StatusNodeWatcher implements NodeWatcher { + + private ResourceWatcher rw; private ContentManager cm; public StatusNodeWatcher(ContentManager cm) { @@ -32,7 +35,14 @@ } private StatusDescriptor getDesc(String portalName) { - return new StatusDescriptor(portalName, cm); + StatusDescriptor desc = new StatusDescriptor(portalName, cm); + + rw = new ResourceWatcher(cm); + rw.watchResource(StatusTools.getXmlCmPath(portalName)); + rw.watchResource(StatusTools.getXmlStatusPluginsCmPath(portalName)); + rw.watchResource(StatusTools.getXmlScorePluginsCmPath(portalName)); + + return desc; } public Object init(String portalName) { @@ -40,6 +50,9 @@ } public Object nodeUpdate(String portalName, Object currentValue) { - return getDesc(portalName); + if ((currentValue == null) || (rw.checkResources())) + return getDesc(portalName); + else + return null; } } |
From: <jbo...@li...> - 2005-12-21 01:42:01
|
Author: wrzep Date: 2005-12-20 20:41:54 -0500 (Tue, 20 Dec 2005) New Revision: 1906 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Plugins.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java Log: log msgs changes http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java 2005-12-21 01:35:31 UTC (rev 1905) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java 2005-12-21 01:41:54 UTC (rev 1906) @@ -74,8 +74,6 @@ // Get the plugin determining projects order orderPlugin = getOrderPlugin(pageRoot, plugins); - System.out.println("Order plugin " + - (orderPlugin == null ? "null" : orderPlugin.getId())); } /** Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Plugins.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Plugins.java 2005-12-21 01:35:31 UTC (rev 1905) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Plugins.java 2005-12-21 01:41:54 UTC (rev 1906) @@ -127,7 +127,7 @@ return null; } - System.out.println("[Status] Added plugin " + pluginClassString + "."); + log.info("Added plugin: " + pluginClassString + "."); return plugin; } Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-21 01:35:31 UTC (rev 1905) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2005-12-21 01:41:54 UTC (rev 1906) @@ -79,7 +79,7 @@ try { repositories = service.getRepositories(repoURL); } catch (Exception e) { - log.error("Can not analyze repo: " + repoURL, e); + log.error("Can not analyze repo: " + repoURL); return null; } |
From: <jbo...@li...> - 2005-12-21 01:35:39
|
Author: mar...@jb... Date: 2005-12-20 20:35:31 -0500 (Tue, 20 Dec 2005) New Revision: 1905 Modified: trunk/labs/jbossrules/drools-manual/drools-manual.tex Log: JBRULES-8 -added in hyperref package use for sidebar navigation Modified: trunk/labs/jbossrules/drools-manual/drools-manual.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual.tex 2005-12-21 01:31:01 UTC (rev 1904) +++ trunk/labs/jbossrules/drools-manual/drools-manual.tex 2005-12-21 01:35:31 UTC (rev 1905) @@ -1,10 +1,10 @@ %&latex \documentclass[14pt]{book} +\usepackage{hyperref} + \usepackage{listings} - - %+MakeIndex \usepackage{makeidx} \makeindex @@ -25,23 +25,23 @@ \part {Drools} -\include {The_Rule_Engine/Chapter} +\include {The_Rule_Engine/The_Rule_Engine} -\include {The_Rule_Assembly_Language} +\include {The_Rule_Assembly_Language/The_Rule_Assembly_Language} -\include {Semantic_Module_Framework} +\include {Semantic_Module_Framework/Semantic_Module_Framework} -\include {JSR-94} +\include {JSR-94/JSR-94} -\include {Decision_Tables} +\include {Decision_Tables/Decision_Tables} -\include {Building_And_Deploying_Rule_Bases} +\include {Building_And_Deploying_Rule_Bases/Building_And_Deploying_Rule_Bases} -\include {Rule_Management} +\include {Rule_Management/Rule_Management} -\include {Developing_Drools} +\include {Developing_Drools/Developing_Drools} -\part {Examples and Case Studies} +\part {Examples and Case Studies/Examples and Case Studies} %+Bibliography \begin{thebibliography}{99} |
From: <jbo...@li...> - 2005-12-21 01:31:39
|
Author: mar...@jb... Date: 2005-12-20 20:31:01 -0500 (Tue, 20 Dec 2005) New Revision: 1904 Added: trunk/labs/jbossrules/drools-manual/Benchmarking/Benchmarking.tex trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases/Building_And_Deploying_Rule_Bases.tex trunk/labs/jbossrules/drools-manual/Decision_Tables/Decision_Tables.tex trunk/labs/jbossrules/drools-manual/Developing_Drools/Developing_Drools.tex trunk/labs/jbossrules/drools-manual/JSR-94/JSR-94.tex trunk/labs/jbossrules/drools-manual/Rule_Management/Rule_Management.tex trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework/Semantic_Module_Framework.tex trunk/labs/jbossrules/drools-manual/Semantic_Modules/Semantic_Modules.tex trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language/The_Rule_Assembly_Language.tex trunk/labs/jbossrules/drools-manual/The_Rule_Engine/The_Rule_Engine.tex Removed: trunk/labs/jbossrules/drools-manual/Benchmarking.tex trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases.tex trunk/labs/jbossrules/drools-manual/Decision_Tables.tex trunk/labs/jbossrules/drools-manual/Developing_Drools.tex trunk/labs/jbossrules/drools-manual/JSR-94.tex trunk/labs/jbossrules/drools-manual/Rule_Management.tex trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework.tex trunk/labs/jbossrules/drools-manual/Semantic_Modules.tex trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language.tex trunk/labs/jbossrules/drools-manual/The_Rule_Engine.tex Modified: trunk/labs/jbossrules/drools-manual/drools-manual.tex Log: JBRULES-8 -Moved each chapter to its sub directory Copied: trunk/labs/jbossrules/drools-manual/Benchmarking/Benchmarking.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Benchmarking.tex) Deleted: trunk/labs/jbossrules/drools-manual/Benchmarking.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Benchmarking.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Benchmarking.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,4 +0,0 @@ -\chapter{JSR 94} -There is text in first chapter - - Copied: trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases/Building_And_Deploying_Rule_Bases.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases.tex) Deleted: trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,11 +0,0 @@ -\chapter{Building and Deploying Rule Bases} -There is text in first chapter - -\section{Loading a Rule Set} - -\section{Loading a Rule Base} - -\section{Deployment with Drools Deployment Jars (.ddj)} - -\section{Debugging with Drools Deployment Source Jars } - Copied: trunk/labs/jbossrules/drools-manual/Decision_Tables/Decision_Tables.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Decision_Tables.tex) Deleted: trunk/labs/jbossrules/drools-manual/Decision_Tables.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Decision_Tables.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Decision_Tables.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,4 +0,0 @@ -\chapter{Decision Tables} -There is text in first chapter - - Copied: trunk/labs/jbossrules/drools-manual/Developing_Drools/Developing_Drools.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Developing_Drools.tex) Deleted: trunk/labs/jbossrules/drools-manual/Developing_Drools.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Developing_Drools.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Developing_Drools.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,8 +0,0 @@ -\chapter{Developing Drools} - -\section{Building with Maven 2.0} - -\section{Using Eclipse} - -\section{Using IntelliJ} - Copied: trunk/labs/jbossrules/drools-manual/JSR-94/JSR-94.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/JSR-94.tex) Deleted: trunk/labs/jbossrules/drools-manual/JSR-94.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/JSR-94.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/JSR-94.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,4 +0,0 @@ -\chapter{JSR-94} -There is text in first chapter - - Copied: trunk/labs/jbossrules/drools-manual/Rule_Management/Rule_Management.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Rule_Management.tex) Deleted: trunk/labs/jbossrules/drools-manual/Rule_Management.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Rule_Management.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Rule_Management.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,5 +0,0 @@ -\chapter{Rule Management} -There is text in first chapter - -\section{The Rule Repository} - Copied: trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework/Semantic_Module_Framework.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework.tex) Deleted: trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,13 +0,0 @@ -\chapter{Semantic Module Framework} -There is text in first chapter - -\section{Semantic Modules} - -\subsection{Java} - -\subsection{Groovy} - -\subsection{Python} - -\subsection{C\#} - Copied: trunk/labs/jbossrules/drools-manual/Semantic_Modules/Semantic_Modules.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/Semantic_Modules.tex) Deleted: trunk/labs/jbossrules/drools-manual/Semantic_Modules.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/Semantic_Modules.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/Semantic_Modules.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,11 +0,0 @@ -\chapter{Semantic Modules} -There is text in first chapter - -\section{Java} - -\section{Groovy} - -\section{Python} - -\section{C\#} - Copied: trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language/The_Rule_Assembly_Language.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language.tex) Deleted: trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,44 +0,0 @@ -\chapter{The Rule Assembly Language} -There is text in first chapter - -\section{Rule Overview} - -\section{Pattern Matching} - -\subsection{Columns} -\subsubsection{Column Bindings} -\subsubsection{Field Bindings} - -\subsection{Constraints} -\subsubsection{Literal Constraints} -\subsubsection{Predicate Field Constraints} -\subsubsection{Return Value Constraints} - -\subsection{Conditional Elements} -\subsubsection{The 'evaluate' Conditional Element} -\subsubsection{The 'and' Conditional Element} -\subsubsection{The 'or' Conditional Element} -\subsubsection{The 'not' Conditional Element} -\subsubsection{The 'exist' Conditional Element} -\subsubsection{The 'forall' Conditional Element} -\subsubsection{The 'accumulate' Conditional Element} -\subsubsection{The 'logical' Conditional Element} - -\subsection{Functions} - -\subsection{Application Data} - -\subsection{Imports} - -\section{Rule Execution Control} -\subsection{Salience} -\subsection{Semaphores} -\subsection{Modules} -\subsection{Xor Group} - -\section{Temporal Rules} - -\section{Truth Maintenance} - -\section{Searching with Query} - Copied: trunk/labs/jbossrules/drools-manual/The_Rule_Engine/The_Rule_Engine.tex (from rev 1899, trunk/labs/jbossrules/drools-manual/The_Rule_Engine.tex) Deleted: trunk/labs/jbossrules/drools-manual/The_Rule_Engine.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/The_Rule_Engine.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/The_Rule_Engine.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -1,26 +0,0 @@ -\chapter{The Rule Engine} -There is text in first chapter - -\section{Rete Algorithm} - -\section{Rule Base} - -\section{Working Memory} -\subsection{Facts} -\subsection{Assertion} -\subsection{Retraction} -\subsection{Modification} -\subsection{Application Data} -\subsection{Property Change Listeners} -\subsection{Shadow Facts} -\subsection{Stateless and Stateful Sessions} -\subsection{Synchronisation and Threading Issues} - -\section{Agenda} -\subsection{Conflict Resolution} -\subsection{Modules} -\subsection{Filters} - -\section{Event Model} -\subsection{Debug Event Listener} -\subsection{Audit Event Listener} Modified: trunk/labs/jbossrules/drools-manual/drools-manual.tex =================================================================== --- trunk/labs/jbossrules/drools-manual/drools-manual.tex 2005-12-21 01:28:03 UTC (rev 1903) +++ trunk/labs/jbossrules/drools-manual/drools-manual.tex 2005-12-21 01:31:01 UTC (rev 1904) @@ -3,6 +3,8 @@ \usepackage{listings} + + %+MakeIndex \usepackage{makeidx} \makeindex @@ -23,7 +25,7 @@ \part {Drools} -\include {The_Rule_Engine} +\include {The_Rule_Engine/Chapter} \include {The_Rule_Assembly_Language} |
From: <jbo...@li...> - 2005-12-21 01:28:09
|
Author: wrzep Date: 2005-12-20 20:28:03 -0500 (Tue, 20 Dec 2005) New Revision: 1903 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java Log: removed debug msgs http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2005-12-21 01:24:39 UTC (rev 1902) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2005-12-21 01:28:03 UTC (rev 1903) @@ -84,8 +84,6 @@ } CcMap = (Map) repositories.get(0); - - printMap(CcMap); return CcMap; } |
From: <jbo...@li...> - 2005-12-21 01:24:46
|
Author: mar...@jb... Date: 2005-12-20 20:24:39 -0500 (Tue, 20 Dec 2005) New Revision: 1902 Added: trunk/labs/jbossrules/drools-manual/Benchmarking/ trunk/labs/jbossrules/drools-manual/Building_And_Deploying_Rule_Bases/ trunk/labs/jbossrules/drools-manual/Decision_Tables/ trunk/labs/jbossrules/drools-manual/Developing_Drools/ trunk/labs/jbossrules/drools-manual/JSR-94/ trunk/labs/jbossrules/drools-manual/Rule_Management/ trunk/labs/jbossrules/drools-manual/Semantic_Module_Framework/ trunk/labs/jbossrules/drools-manual/Semantic_Modules/ trunk/labs/jbossrules/drools-manual/The_Rule_Assembly_Language/ trunk/labs/jbossrules/drools-manual/The_Rule_Engine/ Log: JBRULES-8 -Added Initial directory structure, now that Bakoma supports sub directories |
From: <jbo...@li...> - 2005-12-21 01:22:01
|
Author: wrzep Date: 2005-12-20 20:21:55 -0500 (Tue, 20 Dec 2005) New Revision: 1901 Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/ClosedIssuesStatusPlugin.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/OpenIssuesStatusPlugin.java Log: new jira plugins http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/ClosedIssuesStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/ClosedIssuesStatusPlugin.java 2005-12-21 01:14:15 UTC (rev 1900) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/ClosedIssuesStatusPlugin.java 2005-12-21 01:21:55 UTC (rev 1901) @@ -0,0 +1,44 @@ +/* + * 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.status.plugins.jira; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class ClosedIssuesStatusPlugin extends JiraStatusPlugin { + + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Integer resolvedIssues = (Integer) projectMap.get("closedIssues"); + return resolvedIssues.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/OpenIssuesStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/OpenIssuesStatusPlugin.java 2005-12-21 01:14:15 UTC (rev 1900) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/OpenIssuesStatusPlugin.java 2005-12-21 01:21:55 UTC (rev 1901) @@ -0,0 +1,44 @@ +/* + * 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.status.plugins.jira; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class OpenIssuesStatusPlugin extends JiraStatusPlugin { + + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Integer resolvedIssues = (Integer) projectMap.get("openIssues"); + return resolvedIssues.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file |
From: <jbo...@li...> - 2005-12-21 01:14:23
|
Author: wrzep Date: 2005-12-20 20:14:15 -0500 (Tue, 20 Dec 2005) New Revision: 1900 Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/ErrorsStatusPlugin.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/TestsStatusPlugin.java Removed: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java Log: 2 cc plugins http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Deleted: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java 2005-12-21 00:50:35 UTC (rev 1899) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java 2005-12-21 01:14:15 UTC (rev 1900) @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.plugins.cc; - -import java.util.Map; - -/** -* @author Pawel Wrzeszcz -*/ - -public class BuildStatusPlugin extends CcStatusPlugin { - - @Override - protected int getPluginSpecyficValue(Map projectMap) { - /*Integer resolvedIssues = (Integer) projectMap.get("resolvedIssues"); - return resolvedIssues.intValue();*/ - return 0; - } - - @Override - protected int getPluginSpecyficDefaultValue() { - return 0; - } - -} \ No newline at end of file Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/ErrorsStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/ErrorsStatusPlugin.java 2005-12-21 00:50:35 UTC (rev 1899) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/ErrorsStatusPlugin.java 2005-12-21 01:14:15 UTC (rev 1900) @@ -0,0 +1,44 @@ +/* + * 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.status.plugins.cc; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class ErrorsStatusPlugin extends CcStatusPlugin { + + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Integer resolvedIssues = (Integer) projectMap.get("errors"); + return resolvedIssues.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/TestsStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/TestsStatusPlugin.java 2005-12-21 00:50:35 UTC (rev 1899) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/TestsStatusPlugin.java 2005-12-21 01:14:15 UTC (rev 1900) @@ -0,0 +1,44 @@ +/* + * 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.status.plugins.cc; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class TestsStatusPlugin extends CcStatusPlugin { + + @Override + protected int getPluginSpecyficValue(Map projectMap) { + Integer resolvedIssues = (Integer) projectMap.get("tests"); + return resolvedIssues.intValue(); + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file |
From: <jbo...@li...> - 2005-12-21 00:50:39
|
Author: wrzep Date: 2005-12-20 19:50:35 -0500 (Tue, 20 Dec 2005) New Revision: 1899 Modified: trunk/forge/portal-extensions/forge-kosmos/project.xml trunk/forge/portal-extensions/forge-status/project.xml Log: dependencies problem fix http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-kosmos/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/project.xml 2005-12-21 00:36:24 UTC (rev 1898) +++ trunk/forge/portal-extensions/forge-kosmos/project.xml 2005-12-21 00:50:35 UTC (rev 1899) @@ -10,17 +10,21 @@ <id>forge-kosmos</id> <name>Forge kosmos</name> <dependencies> + <dependency> <groupId>jboss-forge</groupId> <artifactId>forge-common</artifactId> <version>1.0</version> - </dependency> - <dependency> + </dependency> + + + <dependency> <groupId>kosmos</groupId> <artifactId>kosmos-server</artifactId> - <version>1.0</version> - <jar>kosmos-server-pw.jar</jar> - </dependency> + <version>1.0</version> + <jar>kosmos-server.jar</jar> + </dependency> + </dependencies> <build> Modified: trunk/forge/portal-extensions/forge-status/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-status/project.xml 2005-12-21 00:36:24 UTC (rev 1898) +++ trunk/forge/portal-extensions/forge-status/project.xml 2005-12-21 00:50:35 UTC (rev 1899) @@ -41,13 +41,11 @@ <dependency> <groupId>kosmos</groupId> <artifactId>kosmos</artifactId> - <jar>kosmos-server-pw.jar</jar> - <version>1.5</version> + <jar>kosmos-server.jar</jar> + <version>1.0</version> <properties> <war.bundle>true</war.bundle> </properties> - - </dependency> <dependency> |
From: <jbo...@li...> - 2005-12-21 00:35:52
|
Author: wrzep Date: 2005-12-20 19:35:37 -0500 (Tue, 20 Dec 2005) New Revision: 1897 Modified: trunk/forge/portal-extensions/binaries/maven-repo-addons/kosmos/jars/kosmos-server.jar trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war Log: kosmos new version without my debuging msgs inside it http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/binaries/maven-repo-addons/kosmos/jars/kosmos-server.jar =================================================================== (Binary files differ) Modified: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war =================================================================== (Binary files differ) |
From: <jbo...@li...> - 2005-12-21 00:04:14
|
Author: mic...@jb... Date: 2005-12-20 19:04:05 -0500 (Tue, 20 Dec 2005) New Revision: 1896 Added: trunk/labs/jbossrules/drools-natural-language/ Log: Created directory drools-natural-language |
From: <jbo...@li...> - 2005-12-21 00:03:47
|
Author: wrzep Date: 2005-12-20 18:57:42 -0500 (Tue, 20 Dec 2005) New Revision: 1895 Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java Modified: trunk/forge/portal-extensions/forge-kosmos/project.xml trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-portlet.war trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war trunk/forge/portal-extensions/forge-status/project.xml trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java Log: finally... chaged kosmos version to 0.1.7 (with remote jira support!) After that I had to add (empty) begin() and end() methods to *CashedDataStore classes in forge-kosmos. Created superclass for CC kosmos service based plugins. http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-kosmos/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/project.xml 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-kosmos/project.xml 2005-12-20 23:57:42 UTC (rev 1895) @@ -19,7 +19,7 @@ <groupId>kosmos</groupId> <artifactId>kosmos-server</artifactId> <version>1.0</version> - <jar>kosmos-server.jar</jar> + <jar>kosmos-server-pw.jar</jar> </dependency> </dependencies> Modified: trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/LabsCachedDataStore.java 2005-12-20 23:57:42 UTC (rev 1895) @@ -94,4 +94,8 @@ return URLEncoder.encode(String.format("%s_%s", prefix, filename), "utf-8"); } + + public void begin() {}; + + public void end() {}; } Modified: trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-kosmos/src/java/org/jboss/kosmos/ShotokuCachedDataStore.java 2005-12-20 23:57:42 UTC (rev 1895) @@ -111,4 +111,8 @@ return URLEncoder.encode(String.format("%s_%s", prefix, filename), "utf-8"); } + + public void begin() {}; + + public void end() {}; } Modified: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-portlet.war =================================================================== (Binary files differ) Modified: trunk/forge/portal-extensions/forge-kosmos/to-copy/kosmos-server.war =================================================================== (Binary files differ) Modified: trunk/forge/portal-extensions/forge-status/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-status/project.xml 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-status/project.xml 2005-12-20 23:57:42 UTC (rev 1895) @@ -41,17 +41,19 @@ <dependency> <groupId>kosmos</groupId> <artifactId>kosmos</artifactId> - <jar>kosmos-server.jar</jar> + <jar>kosmos-server-pw.jar</jar> <version>1.5</version> <properties> <war.bundle>true</war.bundle> </properties> + + </dependency> <dependency> <groupId>hessian</groupId> <artifactId>hessian</artifactId> - <version>3.0.13</version> + <version>3.0.1</version> <jar>hessian-3.0.13.jar</jar> <properties> <war.bundle>true</war.bundle> Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/BuildStatusPlugin.java 2005-12-20 23:57:42 UTC (rev 1895) @@ -0,0 +1,45 @@ +/* + * 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.status.plugins.cc; + +import java.util.Map; + +/** +* @author Pawel Wrzeszcz +*/ + +public class BuildStatusPlugin extends CcStatusPlugin { + + @Override + protected int getPluginSpecyficValue(Map projectMap) { + /*Integer resolvedIssues = (Integer) projectMap.get("resolvedIssues"); + return resolvedIssues.intValue();*/ + return 0; + } + + @Override + protected int getPluginSpecyficDefaultValue() { + return 0; + } + +} \ No newline at end of file Added: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2005-12-20 23:57:42 UTC (rev 1895) @@ -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.status.plugins.cc; + +import java.net.MalformedURLException; +import java.util.List; +import java.util.Map; + +import org.jboss.forge.status.plugins.KosmosStatusPlugin; +import org.jboss.logging.Logger; + +import com.caucho.hessian.client.HessianProxyFactory; + +import hu.midori.kosmos.protocol.CcService; + +/** +* @author Pawel Wrzeszcz +*/ + +public abstract class CcStatusPlugin extends KosmosStatusPlugin { + + private static final String CC_SERVICE_PROPERTY = "cc-service"; + private static final String CC_ADRESS_TAG = "cc-adress"; + + protected String getKosmosServiceProperty() { return CC_SERVICE_PROPERTY;}; + + protected Logger log; + + public CcStatusPlugin() { + super(); + + log = Logger.getLogger(this.getClass()); + } + + + protected Map getProjectMap(String projectId) { + // Get project cc URL + String ccURL = getCcURL(projectId); + + if (ccURL == null) { + return null; + } + + Map CcMap = null; + + // Connect to the kosmos service + HessianProxyFactory factory = new HessianProxyFactory(); + CcService service; + + try { + service = (CcService) factory.create(CcService.class, serviceURL); + } catch (MalformedURLException e) { + log.error("Can not connect to kosmos cc service: " + serviceURL); + return null; + } + + // Get map with the cc statistics + List repositories = null; + try { + repositories = service.getProjects(ccURL); + } catch (Exception e) { + log.error("Can not analyze cc: " + ccURL, e); + return null; + } + + CcMap = (Map) repositories.get(0); + + printMap(CcMap); + + return CcMap; + } + + + private String getCcURL(String projectId) { + String ccURL = projects.getProjectProperty(projectId, CC_ADRESS_TAG); + return (ccURL == "" ? null : ccURL); + } + +} Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java 2005-12-20 22:13:30 UTC (rev 1894) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java 2005-12-20 23:57:42 UTC (rev 1895) @@ -31,6 +31,7 @@ import com.caucho.hessian.client.HessianProxyFactory; +import hu.midori.kosmos.model.JiraProject; import hu.midori.kosmos.protocol.JiraService; /** |
From: <jbo...@li...> - 2005-12-20 22:13:34
|
Author: adamw Date: 2005-12-20 17:13:30 -0500 (Tue, 20 Dec 2005) New Revision: 1894 Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java Log: Some comments Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-12-20 17:54:10 UTC (rev 1893) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-12-20 22:13:30 UTC (rev 1894) @@ -28,6 +28,14 @@ * @author Adam Warski (ad...@as...) */ public interface SvnNode extends SvnResource, Node { + /** + * Sets this node's content to the given one. Used when switching + * implementations (possible content changes must propagate). + * @param content + */ public void setNodeContent(NodeContent content); + /** + * @return This node's content representation (possibly modified). + */ public NodeContent getNodeContent(); } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java 2005-12-20 17:54:10 UTC (rev 1893) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java 2005-12-20 22:13:30 UTC (rev 1894) @@ -33,24 +33,86 @@ * @author Adam Warski (ad...@as...) */ public interface SvnResource extends Resource { + /** + * @return True iff this resource has been changed in any way (modified + * properties or content). + */ public boolean checkForChanges(); + /** + * To the given collection, adds operations that have to be executed + * on this resource to save modification that have been done (this can + * be: adding a node/ directory, modifying properties, modifying content). + * @param ops + */ public void addOperations(Collection<ResourceOperation> ops); + /** + * To the given collection, adds an operation which, when executed, will + * cause the resource to be deleted. + * @param ops + * @throws DeleteException + */ public void addDeleteOperation(Collection<ResourceOperation> ops) throws DeleteException ; + /** + * Called when this resource has been saved. For example, memory resources + * have to "know" that they have been saved, and that they should start + * behaving like an ordinary resource. + */ public void notifySaved(); + /** + * @return True iff this this resource's impelementation can be switched + * between repository and file, basing on the state of the "dirty sets". + * In general, new, not-yet-saved resources aren't switchable. Used by + * the proxy classes. + */ public boolean switchable(); + /** + * @return True iff the current implementation should be forced to be + * switched (for example, a just saved memory node should be switched; + * used by the proxy classes). + */ public boolean forceSwitch(); + /** + * To the given set, adds this resource's path if it's content is large and + * should be stored in a temporary file instead of a in-memoery array. + * @param toFill + */ public void addLargePaths(Set<String> toFill); + /** + * @return Full path to this resource (in the svn repository, with the + * prefix). + */ public String getFullPath(); + /** + * @return Id of the current content manager. + */ public String getId(); + /** + * @return Content manager from which this node was obtained from. + */ public SvnContentManager getSvnCm(); + /** + * @return A map of properties that have been modified in this resource. + */ public Map<String, String> getModifiedProperties(); + /** + * @return A set of property names, which have been deleted in this + * resource. + */ public Set<String> getDeletedProperties(); + /** + * Sets the modified & deleted properties collections to the given ones. + * Used when implemenation of a resource is switched and it is modified + * (the modifications must propagate to the new implementation that is + * to be used). + * @param properties + * @param deletedProperties + */ public void setModifiedProperties(Map<String, String> properties, Set<String> deletedProperties); } |
Author: unibrew Date: 2005-12-20 12:54:10 -0500 (Tue, 20 Dec 2005) New Revision: 1893 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersWatcher.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Poll.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollVotesDatabase.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsWatcher.java trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml Log: [JBLAB-407] Update of Polls and turning them off for release. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersWatcher.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadCountersWatcher.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -73,7 +73,7 @@ new DownloadCountersDescriptor(portalName, contentManager); rw = new ResourceWatcher(contentManager); // Registering ResourceWatcher to watch for main download counters xml file change. - rw.watchResource(DownloadCounterTools.getMainXmlPath(portalName)); + //rw.watchResource(DownloadCounterTools.getMainXmlPath(portalName)); // Getting the project ids names where are project download counter descriptors. counterDescriptors = descriptor.getDownloadDescriptors(portalName).keySet(); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Poll.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Poll.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Poll.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -1,3 +1,26 @@ + +/* + * 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.Collections; @@ -5,12 +28,39 @@ import java.util.Map; import java.util.Set; +/** + * Class which abstracts one Poll. It has all information about it and + * contains summary votes for answers. + * @author Ryszard Kozmik + * + */ public class Poll { + /** + * Contains poll's question. + */ private String question; + + /** + * Contains poll identifycation number. + */ private String pollId; + + /** + * This Map<String,Integer> contains pairs where the keys are + * answers and the values are summary numbers of votes. + */ private Map<String,Integer> votes; + /** + * Poll's constructor which initiates all variables with given parameters. + * @param answers + * Set<String> containing possible poll's answers for <code>question</code> + * @param question + * Poll's <code>question</code> + * @param pollId + * Poll identification number. + */ public Poll (Set<String>answers,String question, String pollId) { votes = Collections.synchronizedMap(new LinkedHashMap<String,Integer>(answers.size())); for (String answer : answers){ @@ -20,6 +70,15 @@ this.pollId = pollId; } + /** + * Poll's constructor which initiates all variables with given parameters. + * @param votes + * Map<String,Integer> containing pairs of answers and summary votes values for them. + * @param question + * Poll's question. + * @param pollId + * Poll's identification number. + */ public Poll (Map<String,Integer>votes,String question, String pollId) { this.votes = votes; if (votes==null) this.votes = Collections.synchronizedMap(new LinkedHashMap<String,Integer>()); @@ -27,17 +86,32 @@ this.pollId = pollId; } + /** + * Simplest constructor for Poll used only for temporary constructing of Poll + * used for comparing. + * @param question + * Poll's question. + */ public Poll (String question) { this.question = question; this.pollId= Integer.toString((int)(Math.random()*Integer.MAX_VALUE)); } + /** + * Method increments the number of votes for given in parameter <code>answer</code>. + * @param answer + * Answer on which number of votes must be incremented. + */ public void incrementAnswer (String answer) { if (votes.get(answer)!=null) { votes.put(answer,votes.get(answer)+1); } } + /** + * Overrided equals method is comparing two Polls checking if they have + * the same question and the same answers. + */ @Override public boolean equals(Object obj) { Poll poll = ((Poll)obj); @@ -49,35 +123,53 @@ return false; } + /** + * Method returns summary number of votes for specified <code>answer</code>. + * @param answer + * Answer for which number of votes is requested. + * @return + * Number of votes for given <code>answer</code> + */ public Integer getAnswerVotes (String answer) { return votes.get(answer); } + /** + * Method returns Poll's question. + * @return + * Poll's question. + */ public String getQuestion() { return question; } + /** + * Method returns Poll's identification number. + * @return + * Poll's identification number. + */ public String getPollId() { return pollId; } + /** + * Method returns Set<String> containing Poll's answers. + * @return + * Set<String> of Poll's answers. + */ public Set<String> getAnswers(){ return votes.keySet(); } + /** + * Method is used for voting on specified in parameter <code>answer</code>. + * @param answer + * The <code>answer</code> on which the vote is given. + */ public void vote (String answer) { if (votes.containsKey(answer)) { votes.put(answer,votes.get(answer)+1); } } - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("POLLID: "+this.getPollId()); - sb.append("QUESTION: "+this.getQuestion()); - for (String answer :this.getAnswers()) { - sb.append("ANSWER "+answer); - } - return sb.toString(); - } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollDescriptor.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollDescriptor.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -40,6 +40,12 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; +/** + * This class abstracts poll.xml descriptor which is located in projects' dirs. + * It parses this xml and keeps all the data read from it. + * @author Ryszard Kozmik + * + */ public class PollDescriptor extends AbstractDescriptor { /** @@ -62,7 +68,18 @@ */ public static final String POLL = "poll"; - + /** + * Main class constructor which parses the descriptor and initiates + * all class variables. + * @param pollDescNode + * Shotoku Node which points to the poll.xml descriptor. + * @throws SAXException + * XML Parser exception. + * @throws IOException + * Exception which tell that there was problem with reading a file. + * @throws XmlNotFoundException + * This exception is thrown when under specified Node, there is no xml desciptor. + */ public PollDescriptor (org.jboss.shotoku.Node pollDescNode) throws SAXException, IOException,XmlNotFoundException { @@ -75,12 +92,24 @@ NodeList nodes = doc.getDocumentElement().getChildNodes(); // Parsing and gettting polls' questions. + /* + * XML schema: + * <polls>1..1 + * <poll>0..* + * <question />1..1 + * <answer />0..* + * </poll> + * </polls> + */ polls = new LinkedList<Poll>(); for (int i = 0; i < nodes.getLength(); i++) { n = nodes.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { + + // temporary variables String tempQuestion = null; Set<String> tempAnswers = Collections.synchronizedSet(new LinkedHashSet<String>()); + System.out.println("[POLLSDESCRIPTOR] IN POLLS"); if (n.getNodeName().equals(POLL)) { System.out.println("[POLLSDESCRIPTOR] IN POLL"); @@ -102,6 +131,7 @@ } } } + // Checking if all needed information was collected and then creating Poll. if (tempQuestion!=null && !tempQuestion.equals("") && tempAnswers.size()>0) { System.out.println ("ADDING A POLL TO THE POLLS"); polls.add(new Poll(tempAnswers,tempQuestion,Integer.toString((int)(Math.random()*99999999)))); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollTools.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -25,10 +25,7 @@ import java.io.File; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -36,7 +33,6 @@ import javax.portlet.PortletURL; import org.jboss.forge.common.ForgeHelper; -import org.jboss.portal.common.context.Context; import org.jboss.portal.common.context.DelegateContext; import org.jboss.portlet.JBossRenderResponse; import org.jboss.shotoku.ContentManager; @@ -55,6 +51,11 @@ public static final String VOTED_PARAMETER_NAME = "voted"; /** + * Name of the request parameter which contains error information which should be displayed. + */ + public static final String ERROR_PARAMETER_NAME = "error"; + + /** * Value of request parameter for false. */ public static final String FALSE = "false"; @@ -101,6 +102,7 @@ * Method constructs path to polls descriptor. * * @param portalName + * Name of the portal. * @return Path to polls descriptor. */ public static String getMainXmlPath (final String portalName) { @@ -111,6 +113,7 @@ * Method constructs path to project's poll descriptor. * * @param portalName + * Name of the portal. * @param projectId * Project id name for which the poll descriptor path will be constructed. * @return Path to project's poll descriptor. @@ -152,6 +155,7 @@ * information about voting results. * * @param portalName + * Name of the portal. * @return Path to the PollPortlet's JSP voting info view file. */ public static String getInfoJsp() { @@ -163,6 +167,7 @@ * detailed information about who and how has voted on specified poll. * * @param portalName + * Name of the portal. * @return Path to the PollPortlet's JSP voting detailed info view file. */ public static String getDetailsJsp() { @@ -174,6 +179,7 @@ * voting question. * * @param portalName + * Name of the portal. * @return Path to the PollPortlet's JSP voting view file. */ public static String getVotingJsp() { @@ -194,7 +200,7 @@ * @return * Content context for information JSP page. */ - public static Context getInfoContext (final String portalName,final String projectId, + public static DelegateContext getInfoContext (final String portalName,final String projectId, ContentManager cm,JBossRenderResponse response) { // If the projectId is null method returns empty DelegateContext object. @@ -224,14 +230,14 @@ // Filling the context for portlet. /** * Context structure: - * <polls>ONE - * <poll>MANY - * <question />ONE - * <renderUrl/>ONE - * <renderUrlDetailed />ONE - * <answers>MANY - * <votes />ONE - * <text />ONE + * <polls>1..1 + * <poll>0..* + * <question />1..1 + * <renderUrl/>1..1 + * <renderUrlDetailed />1..1 + * <answers>0..* + * <votes />1..1 + * <text />1..1 * </answers> * </poll> * </polls> @@ -273,8 +279,8 @@ * @return * Content context for detailed information JSP page. */ - public static Context getDetailsContext (final String portalName,final String projectId,final String pollId, - ContentManager cm,JBossRenderResponse response) { + public static DelegateContext getDetailsContext (final String portalName,final String projectId, + final String pollId, ContentManager cm,JBossRenderResponse response) { // If the projectId is null method returns empty DelegateContext object. if (projectId==null) { @@ -308,14 +314,14 @@ // Filling the context for portlet. /** * Context structure: - * <poll>ONE - * <question />ONE - * <renderUrlVoting />ONE - * <renderUrlInfo />ONE - * <answer>MANY - * <text />ONE - * <user>MANY - * <id />ONE + * <poll>1..1 + * <question />1..1 + * <renderUrlVoting />1..1 + * <renderUrlInfo />1..1 + * <answer>0..* + * <text />1..1 + * <user>1..* + * <id />1..1 * </user> * </answer> * </poll> @@ -359,10 +365,10 @@ * @return * Content context for detailed information JSP page. */ - public static Context getVotingContext (String portalName, String projectId, - ContentManager cm,JBossRenderResponse response) { + public static DelegateContext getVotingContext (String portalName, String projectId, + String error, ContentManager cm,JBossRenderResponse response) { - // If the projectId is null method returns empty DelegateContext object. + // If the projectId is null method returns empty DelegateContext object. if (projectId==null) { return new DelegateContext(); } @@ -382,33 +388,28 @@ if (!desc.checkForProjectPolls(projectId)) { return ctx; } - - /* - // Getting the polls for given projectId. - Map<String,String> values = desc.getPollsInfoForProject(projectId); - Collection<String> answersRedundant = values.values(); - - // Getting possible answers - Set<String> answers = new HashSet<String>(); - answers.addAll(answersRedundant);*/ - + List<Poll> pollDesc = desc.getPollsInfoForProject(projectId); // Filling the context for portlet. /** * Context structure: - * <polls>ONE - * <poll>MANY - * <question>ONE - * <actionUrl>ONE - * <pollId>ONE - * <answer>MANY - * <text />ONE + * <polls>1..1 + * <error>0..1 + * <poll>0..* + * <question>1..1 + * <actionUrl>1..1 + * <pollId>1..1 + * <answer>0..* + * <text />1..1 * </answer> * </poll> * </polls> */ DelegateContext polls = ctx.next("polls"); + if (error!=null && !error.equals("")) { + polls.put("error",error); + } for (Poll pollObj : pollDesc) { DelegateContext poll = polls.next("poll"); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollVotesDatabase.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollVotesDatabase.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollVotesDatabase.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -1,3 +1,26 @@ + +/* + * 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.Hashtable; @@ -13,19 +36,42 @@ import org.jboss.shotoku.exceptions.ResourceDoesNotExist; import org.jboss.shotoku.exceptions.SaveException; +/** + * This class is an interface for managing Polls' *database*. Information are stored in + * shotoku Node properties. Each file describes one Poll and keeps voting data for it. + * @author Ryszard Kozmik + * + */ public class PollVotesDatabase { + /** + * Location where the *database* is stored in content repository. + */ public static final String DATABASE_LOCATION = "default/polls/database/"; - Directory databaseDir; + /** + * Shotoku Directory object which points to the *database*. + */ + private Directory databaseDir; @Inject ContentManager contentManager; - + + /** + * Constructor just initiates the <code>databaseDir</code> variable + * to point to the *database* Directory in content repository. + * @throws ResourceDoesNotExist + * The exception is thrown if the specified *database*'s directory doesn't exist. + */ public PollVotesDatabase() throws ResourceDoesNotExist { databaseDir =contentManager.getDirectory(DATABASE_LOCATION); } + /** + * This method creates new file for keeping data for Poll. + * @param fileName + * The name of new Poll file. + */ public void createNewPollFile (String fileName) { try { System.out.println ("POLLVOTESDATABASE CREATENEWPOLL"); @@ -43,7 +89,13 @@ } } - + /** + * Method simply checks if file for given in parameter <code>pollId</pollId> Poll exists. + * @param pollId + * Id of a Poll to check. + * @return + * True if file exists, false othervise. + */ public boolean checkForPollFile(String pollId) { try { databaseDir.getNode(pollId); @@ -53,12 +105,28 @@ return true; } + /** + * This method saves vote on specified Poll <code>pollId</code> if user + * <code>userId</code> hasn't voted before. If he had already voted the vote + * will be rejected and method will return false. + * @param pollId + * Id name of the Poll on which user votes. + * @param userId + * User id login name. + * @param vote + * Text content of user's vote. + * @return + * True if vote was added successfully, false if user has already voted on that Poll. + */ public boolean votedOnPoll (String pollId, String userId, String vote) { System.out.println ("SETTING PROPERTY FOR FILE"); System.out.println ("POLLID: "+pollId+" USERID: "+userId+" VOTE: "+vote); Node pollFile=null; try { + // Getting the file for Poll pollFile = databaseDir.getNode(pollId); + + // Checking whether user has already voted before. String voteValue = pollFile.getProperty(userId); if (voteValue!= null && !voteValue.equals("")) return false; @@ -69,6 +137,7 @@ } catch (ResourceDoesNotExist e2) { System.out.println("[POLLPORTLET] Database file for poll didn't exist!"); e2.printStackTrace(); + // There was no file for Poll so it is created. try { databaseDir.newNode(pollId); } catch (ResourceAlreadyExists e3) { @@ -76,6 +145,7 @@ } } System.out.println("PRZED DODANIEM GŁOSU "+pollFile.getClass().getCanonicalName()); + // Saving vote pollFile.setProperty(userId,vote); System.out.println("PO DODANIU GŁOSU PRZED SAVEM"+pollFile.getClass().getCanonicalName()); try { @@ -88,13 +158,24 @@ return true; } + /** + * Method returns Map containing pairs of Strings where keys are users' login names + * and the values are their votes. + * @param pollId + * Poll id name for which votes must be returned. + * @return + * Map<String,String> containing users' votes. + */ public Map<String,String> getUserVotesForPollFile (String pollId) { System.out.println ("GETUSERVOTESFORPOLLFILE POLLID: "+pollId); Map<String,String> userVotes = null; + // if no poll id name was specified, method returns empty Map if (pollId==null) return new Hashtable<String,String>(0); try { + // Getting Node for Poll Node pollFile = databaseDir.getNode(pollId); System.out.println("PRZED GETPROPERTIES "+pollFile.getClass().getCanonicalName()); + //Collecting users' votes. userVotes = pollFile.getProperties(); System.out.println("PO GETPROPERTIES "+pollFile.getClass().getCanonicalName()); System.out.println ("I'M BEFORE DISPLAYING FILE PROPERTIES."); @@ -113,9 +194,16 @@ return userVotes; } + /** + * Method removes data file for Poll specified by id name in parameter <code>pollId</code>. + * @param pollId + * Poll id name which *database* file have to be deleted. + */ public void removePollDataFile (String pollId) { try { + // Getting Node for data file. Node pollFile = databaseDir.getNode(pollId); + // Removing file. pollFile.delete(); } catch (ResourceDoesNotExist e2) { System.out.println ("[POLLS] Poll's data file was already deleted."); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsDescriptor.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -44,6 +44,12 @@ import org.w3c.dom.NodeList; import org.xml.sax.InputSource; +/** + * Main class for Polls project. It is an image of main Polls xml file, polls.xml. + * Class serves methods for building Polls, synchronizing them and voting on them. + * @author Ryszard Kozmik + * + */ public class PollsDescriptor extends AbstractDescriptor { @@ -98,6 +104,9 @@ */ private ContentManager contentManager; + /** + * This variable references object used for accessing *database* of Polls' votes. + */ private PollVotesDatabase database; /** @@ -107,7 +116,7 @@ */ private boolean changeStatus; - /** GOTOWA!!! + /** * Constructor for PollsDescriptor. * While constructing object all information from projects' descriptors * is being collected and the polls Map is filled with values @@ -154,24 +163,27 @@ } } + /** + * This method returns List<Poll> which contains all Polls for specified in parameter + * <code>projectId> project id name. + * @param projectId + * @return + */ public synchronized List<Poll> getPollsInfoForProject(String projectId) { List<Poll> polls = getProjectPolls(projectId); List<Poll> pollsCopy = new ArrayList<Poll>(polls.size()); pollsCopy.addAll(polls); - /*Map<String,String> values = null; - if (polls!=null) { - values = new Hashtable<String,String>(polls.size()); - for (Poll poll:polls) { - values.put(poll.getPollId(),poll.getQuestion()); - } - - } else { - values = new Hashtable<String,String>(); - } - return values;*/ return pollsCopy; } + /** + * Method returns Map<String,Poll> which contains all the Polls for requested + * <code>projectId</code>. + * @param projectId + * Project id name for which the Polls are requested. + * @return + * Map<String,Polls> pairs of pollId:Poll. + */ public synchronized Map<String,Poll> getPollsStatsForProject(String projectId) { List<Poll> polls = getProjectPolls(projectId); Map<String,Poll> values = null; @@ -186,11 +198,19 @@ return values; } + /** + * Method returns Map<String,String> for specified poll id + * containing user:answer pairs which tells what answer user has given. + * @param pollId + * Poll's identification number. + * @return + * Map<String,String> - pairs of user:answer. + */ public Map<String,String> getDetailStatsForPoll (String pollId) { return database.getUserVotesForPollFile(pollId); } - /** GOTOWA!!! + /** * This method searches through projects direcories in order to find all poll descriptors. * Method returns Map containing pairs of String projectId and * org.jboss.shotoku.Node poll descriptor file node. @@ -213,6 +233,7 @@ return nodes; } + // going through projects' directories for (Directory projectDir:membersProjectDirs) { for (org.jboss.shotoku.Node n:projectDir.getNodes().toList()) { // Checking if node is a node containing poll descriptor. @@ -220,6 +241,7 @@ String projectId = projectDir.getName(); try { projectId = projectDir.getName(); + // getting Node for poll.xml project's descriptor org.jboss.shotoku.Node poll = projectDir.getNode(ProjectsHelper.POLL_DESC); nodes.put(projectId,poll); break; @@ -233,7 +255,7 @@ return nodes; } - /** GOTOWA!!! + /** * Method removes polls which were disabled from working * and adds those which was added in their project's poll descriptor. * @@ -294,10 +316,41 @@ changeStatus=false; } + /** + * Method remmoves all Polls which are not contained in + * specified in parameter <code>projectIds</code> String Set. + * @param projectIds + * Set<String> containing all project id names available. + */ private synchronized void removeNotTrackedProjects(Set<String> projectIds) { - polls.keySet().retainAll(projectIds); + //polls.keySet().retainAll(projectIds); + List<String> projectsToDelete = new LinkedList<String>(); + for (String projectId : polls.keySet()) { + if (!projectIds.contains(projectId)) { + projectsToDelete.add(projectId); + } + } + for (String projectId : projectsToDelete) { + List<Poll> pollObjects = polls.get(projectId); + if (pollObjects !=null && pollObjects.size()>0){ + for (Poll poll : pollObjects ){ + database.removePollDataFile(poll.getPollId()); + } + } + polls.remove(projectId); + } } + /** + * Method simply returns Poll object for specified <code>projectId</code> + * and <code>pollId</code> + * @param projectId + * Project id name. + * @param pollId + * Poll identification number. + * @return + * Poll object. + */ public synchronized Poll getPoll (String projectId,String pollId) { if (projectId!=null && pollId!=null && !projectId.equals("") && !pollId.equals("") && polls!=null) { @@ -312,7 +365,7 @@ return null; } - /** GOTOWA!!! + /** * Method removes polls specified in <code>pollsToDelete</code> * from tracking their votes. * @@ -327,7 +380,7 @@ } } - /** GOTOWA!!! + /** * Method adds polls which are wished to be tracked. * * @param questions @@ -348,7 +401,7 @@ } } - /** GOTOWA !!! + /** * This method returns a List<Poll> of Poll-s, which * are now tracked, for project given by <projectId> parameter. * @@ -360,7 +413,7 @@ return polls.get(projectId); } - /** GOTOWA!!! + /** * Method synchronizes the polls Map with a main polls descriptor file. * * @param portalName @@ -400,7 +453,7 @@ } } - /** GOTOWA!!! + /** * Method creates content of polls main descriptor by * copying values from polls Map. * @@ -413,7 +466,6 @@ Node newProject = doc.createElement(PROJECT); Node projectAttribute = doc.createAttribute(PROJECT_ID); projectAttribute.appendChild(doc.createTextNode(projectId)); - //newProject.appendChild(projectAttribute); newProject.getAttributes().setNamedItem(projectAttribute); for (Poll poll:polls.get(projectId)) { @@ -461,7 +513,7 @@ - /** GOTOWA!!! + /** * Method simply just increments the counter value for * <code>answer</code> for given in parameters <code>projectId</code> * and <code>pollId</code> @@ -500,7 +552,7 @@ } - /** GOTOWA!!! + /** * This method returns true if there is at least one poll, * connected with given in parameter <projectId>, defined. * If not method returns false. @@ -513,7 +565,7 @@ return polls.containsKey(projectId); } - /** GOTOWA!!! + /** * Method returns true if there was change in polls Map. * Othervise it returns false. * @@ -524,7 +576,7 @@ } - /** GOTOWA!!! + /** * Method used for pulling the polls' values and projectIds out from the * xml file nodes to the <String,List<Poll>> Map. * @param nodes @@ -539,6 +591,18 @@ Node projectNode=null,pollNode=null,property=null; // Parsing main download counters descriptor. + /* + * XML schema: + * <polls>1..1 + * <project>0..* attributes(id) + * <poll>1..* + * <question />1..1 + * <answer />0..* + * <id>1..1 + * </poll> + * </project> + * </polls> + */ for (int i = 0; i < nodes.getLength(); i++) { projectNode = nodes.item(i); if (projectNode.getNodeType() == Node.ELEMENT_NODE && projectNode.getNodeName().equals(PROJECT)) { @@ -546,9 +610,12 @@ String tempProjectId = XmlTools.getAttributeValue(projectNode,PROJECT_ID); for (int j=0;j< pollNodes.getLength() ; j++) { pollNode = pollNodes.item(j); + + // temporary variables String tempQuestion = null; Map<String,Integer> answerVotes = Collections.synchronizedMap(new LinkedHashMap<String,Integer>()); String tempPollId = null; + if (pollNode.getNodeType()== Node.ELEMENT_NODE && pollNode.getNodeName().equals(POLL)) { NodeList properties = pollNode.getChildNodes(); for (int k=0;k< properties.getLength() ; k++) { @@ -572,6 +639,7 @@ } } } + // Adding answer to the Map if it was correctly specified. if (answerVotesValue!=null && answerText!=null) { answerVotes.put(answerText,answerVotesValue); } @@ -581,12 +649,14 @@ } } } + // Checking if all information was correctly read and constructing a Poll. if (tempProjectId!=null && tempQuestion!=null && tempPollId!=null && answerVotes.size()>0 ) { if (values.get(tempProjectId)==null) { values.put(tempProjectId,new ArrayList<Poll>()); } values.get(tempProjectId).add(new Poll(answerVotes,tempQuestion,tempPollId)); System.out.println ("JESTEM PRZED CREATE"); + // Adding data file for saving votes if it isn't already created. if (!database.checkForPollFile(tempPollId)) { System.out.println ("JESTEM W CREATE"); database.createNewPollFile(tempPollId); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsWatcher.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/PollsWatcher.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -29,14 +29,20 @@ import org.jboss.forge.common.service.ResourceWatcher; import org.jboss.shotoku.ContentManager; - +/** + * This class which implements NodeWatcher interface is looking after changes + * in xml descriptors connected to Polls and executes apropriate methods according + * to the noticed change. + * @author Ryszard Kozmik + * + */ public class PollsWatcher implements NodeWatcher{ ContentManager contentManager; ResourceWatcher rw; /** - * This Collection contains names of projects which contain poll.xml descriptors. + * This Collection contains id names of projects which contain poll.xml descriptors. */ Set<String> pollDescriptors; @@ -65,8 +71,6 @@ PollsDescriptor descriptor = new PollsDescriptor(portalName, contentManager); rw = new ResourceWatcher(contentManager); - // Registering ResourceWatcher to watch for main polls descriptor file change. - //rw.watchResource(PollTools.getMainXmlPath(portalName)); // Getting the project ids names where are poll descriptors. pollDescriptors = descriptor.getPollDescriptors(portalName).keySet(); @@ -84,6 +88,7 @@ * If the object is changed the method returns new object if not returns null. */ public Object nodeUpdate(String portalName, Object currentValue) { + System.out.println ("IN UPDATE CHANGE STATUS: "+((PollsDescriptor)currentValue).hasChanged()); boolean resources = rw.checkResources(); boolean descriptors = false; @@ -96,8 +101,9 @@ return getDescriptor(portalName); } else if (((PollsDescriptor)currentValue).hasChanged()){ System.out.println ("I'M IN POLLWATCHER MAIN XML UPDATE."); - PollsDescriptor descriptor = - (PollsDescriptor)currentValue; + // There was some change on object connected to main polls xml descriptor + // so we must synchronize the object with the file. + PollsDescriptor descriptor = (PollsDescriptor)currentValue; descriptor.synchronizeWithFile(portalName); System.out.println ("I'M IN POLLWATCHER AFTER MAIN XML UPDATE."); return null; @@ -106,6 +112,15 @@ return null; } + /** + * This method checks whether someone hasn't added new poll.xml descriptor to his/her project dir. + * @param desc + * Main PollsDescriptor object. + * @param portalName + * Name of the portal. + * @return + * False if someone added poll.xml descriptor, true if not. + */ private boolean checkForNewResources (PollsDescriptor desc, String portalName) { return pollDescriptors.containsAll(desc.getPollDescriptors(portalName).keySet()); } Modified: trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java =================================================================== --- trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/polls/src/java/org/jboss/forge/polls/PollsPortlet.java 2005-12-20 17:54:10 UTC (rev 1893) @@ -1,3 +1,26 @@ + +/* + * 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.polls; import java.io.IOException; @@ -11,6 +34,7 @@ import org.jboss.forge.common.projects.PollTools; import org.jboss.forge.common.projects.ProjectsHelper; import org.jboss.portal.common.context.Context; +import org.jboss.portal.common.context.DelegateContext; import org.jboss.portal.core.model.User; import org.jboss.portal.core.servlet.jsp.PortalJsp; import org.jboss.portlet.JBossActionRequest; @@ -23,28 +47,37 @@ /** - * + * This class is Portlet for Polls. It manages three views - voting, info and detailed info. * @author Ryszard Kozmik * */ public class PollsPortlet extends JBossPortlet { - + /** + * Injected ContentManager object used for accessing content repository. + */ @Inject ContentManager contentManager; + /** + * Method displays one of three views - voting view or scores information view + * or voting detailed information. + */ public void doView(JBossRenderRequest request, JBossRenderResponse response) throws IOException, PortletException { + response.setContentType("text/html"); - + + // resolving name of a portal String portalName = ForgeHelper.getPortalName(request); // Getting name of the project on which the download counter is used. String projectId = ProjectsHelper.getSelectedProjectId(request); ProjectsHelper.prepareRequest(request); - PortletSession session = request.getPortletSession(false); + + // Getting User from request. User user = request.getUser(); if (user!=null) { String userName = user.getUserName(); @@ -52,74 +85,96 @@ } else { System.out.println ("USER IS NULL"); } + + // Checking whether user has given his vote. String voted = request.getParameter(PollTools.VOTED_PARAMETER_NAME); - Context pollContext=null; + + // Adding eventuall errors information to the context. + String errorReq = request.getParameter (PollTools.ERROR_PARAMETER_NAME); + + DelegateContext pollContext=null; PortletRequestDispatcher rd = null; + + // If user has voted information page with scores will be displayed. if (voted!=null && voted.compareTo(PollTools.TRUE)==0) { System.out.println ("USER VOTED"); - // Getting the poll context. + // Getting the poll context for scores information page. pollContext = PollTools.getInfoContext(portalName,projectId,contentManager,response); rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, PollTools .getInfoJsp())); + // If user has requested detailed information about voting on specified poll. } else if (request.getParameter(PollTools.DETAILED_VIEW_REQUEST)!=null && request.getParameter(PollTools.DETAILED_VIEW_REQUEST).compareTo(PollTools.TRUE)==0 ) { System.out.println ("DETAILED VIEW"); + // Getting pollId about which user wants to see detailed information. String pollId = request.getParameter("pollId"); - // Getting the poll context. + + // Getting the poll context for detailed voting information on specified poll. pollContext = PollTools.getDetailsContext(portalName,projectId,pollId,contentManager,response); rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, PollTools .getDetailsJsp())); + // If user hasn't done anything yet the voting page will be displayed. } else { System.out.println ("USER HAVEN'T VOTED"); - // Getting the poll context. - pollContext = PollTools.getVotingContext(portalName,projectId,contentManager,response); + + // Getting the poll voting context. + pollContext = PollTools.getVotingContext(portalName,projectId,errorReq,contentManager,response); rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, PollTools .getVotingJsp())); } - // Displaying. + + // Adding content context to the request attributes. request.setAttribute(PortalJsp.CTX_REQUEST, pollContext); - rd.include(request, response); } + /** + * In this method PollsPortlet is procesing user's vote. + */ @Override public void processAction(JBossActionRequest request, JBossActionResponse response) { + + // Resolving portal name. String portalName = ForgeHelper.getPortalName(request); + + // Getting user's vote and pollId on which the vote was given. String vote=request.getParameter("vote"); String pollId = request.getParameter("pollId"); - PortletURL url=response.createRenderURL(); + + // Getting name of the project on which the PollsPortlet is used. + String projectId = request.getParameter(ProjectsHelper.PROJECT_URL_PARAM); + System.out.println ("HELLO I'M IN POLLPORTLET VOTE: "+vote); String userId = request.getUser()==null?"user"+Integer.toString((int)(Math.random()*100000)):request.getUser().getUserName(); - - // Getting name of the project on which the download counter is used. - String projectId = ProjectsHelper.getSelectedProjectId(request); + System.out.println("PROJECTID:"+projectId); - if (projectId==null){ - projectId = request.getParameter(ProjectsHelper.PROJECT_URL_PARAM); - System.out.println ("2 PROJECTID:"+projectId); - if (projectId==null) { - projectId="jbosswiki"; - } - } - + if (vote != null && !vote.equals("")) { - response.setRenderParameter(PollTools.VOTED_PARAMETER_NAME,PollTools.TRUE); + + System.out.println ("VOTING"); System.out.println ("VOTE: "+vote+"POLLID:"+pollId+" userId:"+userId+" PROJECTID: "+projectId); + + // Trying to vote. If it returns true it means that vote was given successfully + // if not it means that user has already voted on this poll. if (PollTools.getDesc(portalName,contentManager).vote(vote,pollId,userId,projectId)) { + // Adding parameter to url which tells doView to render scores information page. + response.setRenderParameter(PollTools.VOTED_PARAMETER_NAME,PollTools.TRUE); System.out.println ("ZAGŁOSOWANO"); } else { + response.setRenderParameter(PollTools.ERROR_PARAMETER_NAME,"You have already voted on that poll"); System.out.println ("GŁOS ODRZUCONO"); } } else { System.out.println ("USER ZONK"); + response.setRenderParameter(PollTools.ERROR_PARAMETER_NAME,"You haven't given your vote."); } } Modified: trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml =================================================================== --- trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-12-20 17:16:06 UTC (rev 1892) +++ trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-12-20 17:54:10 UTC (rev 1893) @@ -330,13 +330,13 @@ <height>1</height> <window-state>normal</window-state> </window> - <window> + <!-- <window> <window-name>PollsPortletWindowDefaultDownloads</window-name> <instance-ref>polls.PollsPortlet.PollsPortletInstance</instance-ref> <region>center</region> <height>2</height> <window-state>normal</window-state> - </window> + </window>--> </page> <page> |
From: <jbo...@li...> - 2005-12-20 17:16:11
|
Author: rl...@jb... Date: 2005-12-20 12:16:06 -0500 (Tue, 20 Dec 2005) New Revision: 1892 Modified: trunk/labs/jbossbuild/projects/jboss/cluster/pom.xml Log: fix artifact name Modified: trunk/labs/jbossbuild/projects/jboss/cluster/pom.xml =================================================================== --- trunk/labs/jbossbuild/projects/jboss/cluster/pom.xml 2005-12-20 16:05:03 UTC (rev 1891) +++ trunk/labs/jbossbuild/projects/jboss/cluster/pom.xml 2005-12-20 17:16:06 UTC (rev 1892) @@ -2,7 +2,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.jboss.server.cluster</groupId> <version>5.0-SNAPSHOT</version> - <artifactId>jbossja</artifactId> + <artifactId>jbossha</artifactId> <packaging>jar</packaging> <name>JBoss Cluster Project</name> <description>JBoss Cluster Project</description> |
From: <jbo...@li...> - 2005-12-20 16:03:19
|
Author: rl...@jb... Date: 2005-12-20 11:03:06 -0500 (Tue, 20 Dec 2005) New Revision: 1890 Modified: trunk/labs/jbossbuild/projects/maven-plugins/maven-addSources-plugin/pom.xml Log: update version Modified: trunk/labs/jbossbuild/projects/maven-plugins/maven-addSources-plugin/pom.xml =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/maven-addSources-plugin/pom.xml 2005-12-20 15:45:25 UTC (rev 1889) +++ trunk/labs/jbossbuild/projects/maven-plugins/maven-addSources-plugin/pom.xml 2005-12-20 16:03:06 UTC (rev 1890) @@ -7,7 +7,7 @@ </parent> <groupId>org.jboss.mojo.plugins.sources</groupId> <artifactId>maven-addSources-plugin</artifactId> - <version>1.0</version> + <version>1.1</version> <packaging>maven-plugin</packaging> <name>Maven Add Sources Plugin</name> <dependencies> |