You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jbo...@li...> - 2006-05-18 00:09:58
|
Author: mar...@jb... Date: 2006-05-17 20:09:54 -0400 (Wed, 17 May 2006) New Revision: 4303 Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual4.jpg Removed: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual1.jpg labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual2.jpg Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Maven_build.xml Log: -fixed the manual build docs for using ant Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Maven_build.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Maven_build.xml 2006-05-18 00:04:13 UTC (rev 4302) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Maven_build.xml 2006-05-18 00:09:54 UTC (rev 4303) @@ -10,7 +10,7 @@ <primary>Ant</primary> </indexterm>Ant, which uses maven 2 under the covers to get the needed dependencies (you don't need to have maven 2 installed to build). Note - that the plug in is build seperatly, but the build process will update the + that the plug in is built seperatly, but the build process will update the plug ins dependencies (refer to the section on building the plug in if you need to build a new version of the plug in).</para> @@ -31,12 +31,11 @@ [echo] drools-jsr94 [echo] [echo] Further to this there are two Eclipse project: - [echo] drools-examples - To use open eclipse and import. - [echo] Requires the Drools eclipse plugin. + [echo] drools-examples - To use open Eclipse and import. + [echo] Requires the Drools Eclipse plugin. [echo] Either build the plugin from drools-ide [echo] or install from the Eclipse update site - [echo] http://anonsvn.labs.jboss.com/labs/jbossrules/upda -tes + [echo] http://anonsvn.labs.jboss.com/labs/jbossrules/updates [echo] drools-ide - To use open Eclipse and import. [echo] Select export and plugin fragements to [echo] generate the Drools Eclipse plugin @@ -141,7 +140,8 @@ <listitem> <para><indexterm> <primary>pdf</primary> - </indexterm>PDF</para> + </indexterm>PDF (currently broken, due to layout issues with image + sizes)</para> <para>A generated PDF, with nagivation.</para> </listitem> @@ -153,31 +153,105 @@ </listitem> </itemizedlist> - <para>The documentation is generated by using the <literal>'ant'</literal> - commandin the <literal>documentation\manual</literal> directory.</para> + <para>The manual can be generated from the project root's build.xml by + calling <literal>'ant manual'</literal>, with the generated documentation + being copied to <literal>'target/docs'</literal>. What actually happens is + a call to a separate ant build.xml for the manual, located at + <literal>documentation/manual</literal>; the documentation is generated + into <literal>documentation/manual/build</literal> before being copied to + <literal>'target/docs'.</literal><figure> + <title>Generating the Manual with Ant</title> - <screenshot> - <screeninfo>Start documentation building</screeninfo> + <programlisting>C:\dev\jbossrules>ant manual +Buildfile: build.xml - <mediaobject> - <imageobject> - <imagedata fileref="manual1.jpg" /> - </imageobject> - </mediaobject> - </screenshot> +manual: + [delete] Deleting directory D:\dev\jbossrules\documentation\manual\build +clean: + +all.doc: + +lang.all: + +lang.misc: + [copy] Copying 102 files to C:\dev\jbossrules\documentation\manual\build\en\shared\images + [copy] Copying 1 file to C:\dev\jbossrules\documentation\manual\build\en\shared\css + [style] Transforming into C:\dev\jbossrules\documentation\manual\build\en\shared\images + [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\guests_at_table.svg to C:\dev\jbossrules +\documentation\manual\build\en\shared\images\Chapter-Papers\guests_at_table.svg + [style] Loading stylesheet C:\dev\jbossrules\documentation\manual\en\styles\visio_svg.xsl + [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\make_path.svg to C:\dev\jbossrules\docum +entation\manual\build\en\shared\images\Chapter-Papers\make_path.svg + [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Papers\manners_activity_diagram.svg to C:\dev\j +bossrules\documentation\manual\build\en\shared\images\Chapter-Papers\manners_activity_diagram.svg + [style] Processing C:\dev\jbossrules\documentation\manual\en\Chapter-Performance_Tuning\beta_node.svg to C:\dev\jbos +... +snip +... +lang.dochtml: + [mkdir] Created dir: C:\dev\jbossrules\documentation\manual\build\en\html + [copy] Copying 1 file to C:\dev\jbossrules\documentation\manual\build\en\html + [java] Writing bk01-toc.html for book + [java] Writing pr01.html for preface(preface) + [java] ID recommended on part: Reference Manual + [java] ID recommended on chapter: The Rule Engine + [java] ID recommended on section: What is a Rule Engine + [java] ID recommended on section: Background + [java] ID recommended on figure: Inference Engine + [java] ID recommended on figure: SQL as a simplistic Inference Engine + [java] ID recommended on figure: Additional Reading + [java] ID recommended on section: Rules + [java] ID recommended on figure: A Basic Rete network + [java] ID recommended on figure: A Basic Rete network +... +snip +... +lang.dochtmlsingle: + [mkdir] Created dir: C:\dev\jbossrules\documentation\manual\build\en\html_single + [java] ID recommended on part: Reference Manual + [java] ID recommended on chapter: The Rule Engine + [java] ID recommended on section: What is a Rule Engine + [java] ID recommended on section: Background + [java] ID recommended on figure: Inference Engine + [java] ID recommended on figure: SQL as a simplistic Inference Engine + [java] ID recommended on figure: Additional Reading + [java] ID recommended on section: Rules + [java] ID recommended on figure: A Basic Rete network + [java] ID recommended on figure: A Basic Rete network + [java] ID recommended on section: Why use a Rule Engine +... +snip +... + [java] ID recommended on section: Make Path and Path Done + [java] ID recommended on figure: Rete Diagram + [java] ID recommended on section: Continue and Are We Done + [java] ID recommended on section: Conclusion + [java] ID recommended on section: Output Summary + [java] ID recommended on index + [copy] Copying 142 files to C:\dev\jbossrules\target\docs + +BUILD SUCCESSFUL +Total time: 54 seconds +C:\dev\jbossrules></programlisting> + </figure></para> + + <para>The generated manual can be found in the + <literal>target\docs</literal> directory, a folder per each format.</para> + <screenshot> - <screeninfo>Finished documentation building</screeninfo> + <screeninfo>Generated documentation</screeninfo> <mediaobject> <imageobject> - <imagedata fileref="manual2.jpg" /> + <imagedata fileref="manual4.jpg" /> </imageobject> </mediaobject> </screenshot> - <para>The generated docuementation can be found in the - <literal>build</literal> directory, a folder per each format.</para> + <para>The manual was first generated into the manual's + <literal>build</literal> directory, as shown below, before being copied + across.</para> <screenshot> <screeninfo>Generated documentation</screeninfo> Deleted: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual1.jpg =================================================================== (Binary files differ) Deleted: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual2.jpg =================================================================== (Binary files differ) Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual4.jpg =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/manual4.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <jbo...@li...> - 2006-05-18 00:04:17
|
Author: mar...@jb... Date: 2006-05-17 20:04:13 -0400 (Wed, 17 May 2006) New Revision: 4302 Added: labs/jbossrules/tags/RC-3/ Log: made a copy Copied: labs/jbossrules/tags/RC-3 (from rev 4301, labs/jbossrules/trunk) |
From: <jbo...@li...> - 2006-05-18 00:02:44
|
Author: mar...@jb... Date: 2006-05-17 20:02:40 -0400 (Wed, 17 May 2006) New Revision: 4301 Removed: labs/jbossrules/trunk/drools-examples/log/assertion.log labs/jbossrules/trunk/drools-examples/log/fibonacci.log labs/jbossrules/trunk/drools-examples/log/state.log labs/jbossrules/trunk/drools-examples/log/trouble_ticket.log Log: -deleted committed log files Deleted: labs/jbossrules/trunk/drools-examples/log/assertion.log =================================================================== --- labs/jbossrules/trunk/drools-examples/log/assertion.log 2006-05-17 23:55:59 UTC (rev 4300) +++ labs/jbossrules/trunk/drools-examples/log/assertion.log 2006-05-18 00:02:40 UTC (rev 4301) @@ -1,296 +0,0 @@ -<object-stream> - <list> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [-1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [2]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>1</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [2]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>s</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>1</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>s</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [-1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [-1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [2]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>1</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [2]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>s</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>1</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>s</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [-1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>1</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>s</objectToString> - <type>3</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>i then s [-1]</activationId> - <rule>i then s</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>not s then i [0]</activationId> - <rule>not s then i</rule> - <declarations></declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - </list> -</object-stream> \ No newline at end of file Deleted: labs/jbossrules/trunk/drools-examples/log/fibonacci.log =================================================================== --- labs/jbossrules/trunk/drools-examples/log/fibonacci.log 2006-05-17 23:55:59 UTC (rev 4300) +++ labs/jbossrules/trunk/drools-examples/log/fibonacci.log 2006-05-18 00:02:40 UTC (rev 4301) @@ -1,2538 +0,0 @@ -<object-stream> - <list> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [1]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(50/-1)(1)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>1</factId> - <objectToString>Fibonacci(50/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [1]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(50/-1)(1)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [2]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(49/-1)(2)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>2</factId> - <objectToString>Fibonacci(49/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [1]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(50/-1)(1)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [2]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(49/-1)(2)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [3]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(48/-1)(3)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>3</factId> - <objectToString>Fibonacci(48/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [2]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(49/-1)(2)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [3]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(48/-1)(3)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [4]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(47/-1)(4)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>4</factId> - <objectToString>Fibonacci(47/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [3]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(48/-1)(3)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [4]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(47/-1)(4)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [5]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(46/-1)(5)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>5</factId> - <objectToString>Fibonacci(46/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [4]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(47/-1)(4)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [5]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(46/-1)(5)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [6]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(45/-1)(6)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>6</factId> - <objectToString>Fibonacci(45/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [5]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(46/-1)(5)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [6]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(45/-1)(6)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [7]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(44/-1)(7)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>7</factId> - <objectToString>Fibonacci(44/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [6]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(45/-1)(6)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [7]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(44/-1)(7)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [8]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(43/-1)(8)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>8</factId> - <objectToString>Fibonacci(43/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [7]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(44/-1)(7)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [8]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(43/-1)(8)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [9]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(42/-1)(9)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>9</factId> - <objectToString>Fibonacci(42/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [8]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(43/-1)(8)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [9]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(42/-1)(9)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [10]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(41/-1)(10)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>10</factId> - <objectToString>Fibonacci(41/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [9]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(42/-1)(9)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [10]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(41/-1)(10)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [11]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(40/-1)(11)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>11</factId> - <objectToString>Fibonacci(40/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [10]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(41/-1)(10)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [11]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(40/-1)(11)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [12]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(39/-1)(12)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>12</factId> - <objectToString>Fibonacci(39/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [11]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(40/-1)(11)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [12]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(39/-1)(12)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [13]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(38/-1)(13)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>13</factId> - <objectToString>Fibonacci(38/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [12]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(39/-1)(12)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [13]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(38/-1)(13)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [14]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(37/-1)(14)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>14</factId> - <objectToString>Fibonacci(37/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [13]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(38/-1)(13)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [14]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(37/-1)(14)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [15]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(36/-1)(15)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>15</factId> - <objectToString>Fibonacci(36/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [14]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(37/-1)(14)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [15]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(36/-1)(15)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [16]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(35/-1)(16)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>16</factId> - <objectToString>Fibonacci(35/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [15]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(36/-1)(15)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [16]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(35/-1)(16)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [17]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(34/-1)(17)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>17</factId> - <objectToString>Fibonacci(34/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [16]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(35/-1)(16)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [17]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(34/-1)(17)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [18]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(33/-1)(18)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>18</factId> - <objectToString>Fibonacci(33/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [17]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(34/-1)(17)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [18]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(33/-1)(18)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [19]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(32/-1)(19)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>19</factId> - <objectToString>Fibonacci(32/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [18]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(33/-1)(18)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [19]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(32/-1)(19)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [20]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(31/-1)(20)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>20</factId> - <objectToString>Fibonacci(31/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [19]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(32/-1)(19)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [20]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(31/-1)(20)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [21]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(30/-1)(21)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>21</factId> - <objectToString>Fibonacci(30/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [20]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(31/-1)(20)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [21]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(30/-1)(21)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [22]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(29/-1)(22)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>22</factId> - <objectToString>Fibonacci(29/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [21]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(30/-1)(21)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [22]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(29/-1)(22)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [23]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(28/-1)(23)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>23</factId> - <objectToString>Fibonacci(28/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [22]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(29/-1)(22)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [23]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(28/-1)(23)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [24]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(27/-1)(24)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>24</factId> - <objectToString>Fibonacci(27/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [23]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(28/-1)(23)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [24]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(27/-1)(24)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [25]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(26/-1)(25)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>25</factId> - <objectToString>Fibonacci(26/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [24]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(27/-1)(24)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [25]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(26/-1)(25)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [26]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(25/-1)(26)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>26</factId> - <objectToString>Fibonacci(25/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [25]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(26/-1)(25)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [26]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(25/-1)(26)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [27]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(24/-1)(27)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>27</factId> - <objectToString>Fibonacci(24/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [26]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(25/-1)(26)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [27]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(24/-1)(27)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [28]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(23/-1)(28)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>28</factId> - <objectToString>Fibonacci(23/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [27]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(24/-1)(27)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [28]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(23/-1)(28)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [29]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(22/-1)(29)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>29</factId> - <objectToString>Fibonacci(22/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [28]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(23/-1)(28)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [29]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(22/-1)(29)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [30]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(21/-1)(30)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>30</factId> - <objectToString>Fibonacci(21/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [29]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(22/-1)(29)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [30]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(21/-1)(30)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [31]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(20/-1)(31)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>31</factId> - <objectToString>Fibonacci(20/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [30]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(21/-1)(30)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [31]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(20/-1)(31)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [32]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(19/-1)(32)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>32</factId> - <objectToString>Fibonacci(19/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [31]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(20/-1)(31)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [32]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(19/-1)(32)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [33]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(18/-1)(33)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>33</factId> - <objectToString>Fibonacci(18/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [32]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(19/-1)(32)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [33]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(18/-1)(33)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [34]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(17/-1)(34)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>34</factId> - <objectToString>Fibonacci(17/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [33]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(18/-1)(33)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [34]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(17/-1)(34)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [35]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(16/-1)(35)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>35</factId> - <objectToString>Fibonacci(16/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [34]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(17/-1)(34)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [35]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(16/-1)(35)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [36]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(15/-1)(36)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>36</factId> - <objectToString>Fibonacci(15/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [35]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(16/-1)(35)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [36]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(15/-1)(36)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [37]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(14/-1)(37)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>37</factId> - <objectToString>Fibonacci(14/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [36]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(15/-1)(36)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [37]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(14/-1)(37)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [38]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(13/-1)(38)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>38</factId> - <objectToString>Fibonacci(13/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [37]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(14/-1)(37)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [38]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(13/-1)(38)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [39]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(12/-1)(39)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>39</factId> - <objectToString>Fibonacci(12/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [38]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(13/-1)(38)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [39]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(12/-1)(39)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [40]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(11/-1)(40)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>40</factId> - <objectToString>Fibonacci(11/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [39]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(12/-1)(39)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [40]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(11/-1)(40)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [41]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(10/-1)(41)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>41</factId> - <objectToString>Fibonacci(10/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [40]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(11/-1)(40)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [41]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(10/-1)(41)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [42]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(9/-1)(42)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>42</factId> - <objectToString>Fibonacci(9/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [41]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(10/-1)(41)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [42]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(9/-1)(42)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [43]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(8/-1)(43)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>43</factId> - <objectToString>Fibonacci(8/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [42]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(9/-1)(42)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [43]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(8/-1)(43)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [44]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(7/-1)(44)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>44</factId> - <objectToString>Fibonacci(7/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [43]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(8/-1)(43)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [44]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(7/-1)(44)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [45]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(6/-1)(45)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>45</factId> - <objectToString>Fibonacci(6/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [44]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(7/-1)(44)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [45]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(6/-1)(45)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [46]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(5/-1)(46)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>46</factId> - <objectToString>Fibonacci(5/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [45]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(6/-1)(45)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [46]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(5/-1)(46)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [47]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(4/-1)(47)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>47</factId> - <objectToString>Fibonacci(4/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [46]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(5/-1)(46)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [47]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(4/-1)(47)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [48]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(3/-1)(48)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>48</factId> - <objectToString>Fibonacci(3/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [47]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(4/-1)(47)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [48]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(3/-1)(48)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Bootstrap2 [49]</activationId> - <rule>Bootstrap2</rule> - <declarations>f=Fibonacci(2/-1)(49)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [49]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(2/-1)(49)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>49</factId> - <objectToString>Fibonacci(2/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [48]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(3/-1)(48)</declarations> - <type>7</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [49]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(2/-1)(49)</declarations> - <type>6</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Bootstrap1 [50]</activationId> - <rule>Bootstrap1</rule> - <declarations>f=Fibonacci(1/-1)(50)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [50]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(1/-1)(50)</declarations> - <type>4</type> - </org.drools.audit.event.ActivationLogEvent> - <org.drools.audit.event.ObjectLogEvent> - <factId>50</factId> - <objectToString>Fibonacci(1/-1)</objectToString> - <type>1</type> - </org.drools.audit.event.ObjectLogEvent> - <org.drools.audit.event.ActivationLogEvent> - <activationId>Recurse [49]</activationId> - <rule>Recurse</rule> - <declarations>f=Fibonacci(2/-1)(49)</de... [truncated message content] |
Author: soh...@jb... Date: 2006-05-17 19:55:59 -0400 (Wed, 17 May 2006) New Revision: 4300 Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java Removed: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/TransactionFilter.java Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml Log: Integrated a JSF PhaseListener for handling Transactions. Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -30,6 +30,7 @@ //portlet api import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; +import javax.portlet.PortletRequestDispatcher; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.PortletException; @@ -44,11 +45,33 @@ /** * Called by the portlet container to allow the portlet to process an action request. */ - public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException - { - this.setupRenderParameters(request,response); - super.processAction(request,response); + public void processAction(ActionRequest request, ActionResponse response) throws PortletException,IOException + { + try + { + this.setupRenderParameters(request,response); + super.processAction(request,response); + } + catch(Throwable t) + { + throw new PortletException(t); + } } + + /** + * Called by the portlet container to allow the portlet to render its view + */ + public void doView(RenderRequest request,RenderResponse response) throws PortletException,IOException + { + try + { + super.doView(request,response); + } + catch(Throwable t) + { + throw new PortletException(t); + } + } /** * Not sure why this needs to be done... Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -180,6 +180,23 @@ * * */ + public static boolean isErrorOccurred() + { + boolean errorOccurred = false; + + Iterator msgs = FacesContext.getCurrentInstance().getMessages(Constants.ERROR); + if(msgs!=null && msgs.hasNext()) + { + errorOccurred = true; + } + + return errorOccurred; + } + + /** + * + * + */ public static void setMessage(String id,String msg) { FacesMessage message = new FacesMessage( Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -71,6 +71,21 @@ { }; + + /** + * + * + */ + public static boolean isRunningInPortal() + { + boolean isRunningInPortal = false; + Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest(); + if(o instanceof PortletRequest) + { + isRunningInPortal = true; + } + return isRunningInPortal; + } /** * Deleted: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/TransactionFilter.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/TransactionFilter.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/TransactionFilter.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -1,148 +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.portlet.forums.ui; - -import org.apache.log4j.Logger; - -import javax.servlet.ServletException; -import javax.servlet.FilterChain; -import javax.servlet.ServletResponse; -import javax.servlet.ServletRequest; -import javax.servlet.FilterConfig; -import javax.servlet.Filter; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.transaction.UserTransaction; -import javax.transaction.Status; -import javax.transaction.SystemException; -import java.io.IOException; - -/** - * Wraps a servlet into a user transaction. Behaviour - * is similar as RequiresNew in EJB world. - * - * @author <a href="mailto:ju...@jb...">Julien Viet</a> - * @version $Revision: 1.1.1.1 $ - */ -public class TransactionFilter implements Filter -{ - - // Attributes ---------------------------------------------------- - - /** - * The filter config. - */ - private FilterConfig filterConfig; - - /** - * The JNDI context. - */ - private InitialContext ctx; - - // Static -------------------------------------------------------- - - private static Logger log = Logger.getLogger(TransactionFilter.class); - - // Filter implementation ----------------------------------------- - - public void init(FilterConfig filterConfig) throws ServletException - { - this.filterConfig = filterConfig; - try - { - ctx = new InitialContext(); - } - catch (NamingException e) - { - throw new ServletException(e); - } - } - - public void destroy() - { - filterConfig = null; - } - - public void doFilter(ServletRequest request, - ServletResponse response, - FilterChain chain) - throws ServletException, IOException - { - - UserTransaction tx = null; - - try - { - tx = (UserTransaction) ctx.lookup("java:comp/UserTransaction"); - tx.begin(); - } - catch (Throwable t) - { - log.error("cannot start transaction, request aborted", t); - throw new ServletException(t); - } - - try - { - // do the job only if the - // transaction has started succesfully - chain.doFilter(request, response); - } - catch (Throwable t) - { - try - { - tx.setRollbackOnly(); - } - catch (IllegalStateException e) - { - log.error("SystemException while setting transaction for rollback only", e); - } - catch (SystemException e) - { - log.error("IllegalStateException while setting transaction for rollback only", e); - } - throw new ServletException(t); - } - finally - { - if (tx != null) - { - try - { - if (tx.getStatus() != Status.STATUS_MARKED_ROLLBACK) - { - tx.commit(); - } - else - { - tx.rollback(); - } - } - catch (Exception e) - { - log.error("cannot end transaction", e); - } - } - } - } -} Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -43,8 +43,8 @@ * ui data associated with "Category" information * */ - private String categoryName = null; - private Category category = null; + private String categoryName = null; //this is used by the create new category usecase + private Category category = null; //this is used in the edit category usecase /** * ui data associated with "Forum" information @@ -177,7 +177,7 @@ String navState = null; boolean success = false; try - { + { JSFUtil.setMessage(Constants.FEEDBACK,"The Category \""+this.category.getTitle()+"\" was successfully updated."); navState = Constants.EDIT_CATEGORY; success = true; @@ -191,7 +191,7 @@ if(success) { //cleanup the state - this.categoryName = null; + this.category = null; } } return navState; Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -317,10 +317,9 @@ { post.addAttachment((Attachment)itr.next()); } - - + //set the proper navigation state - navState = Constants.SUCCESS; + navState = Constants.SUCCESS; success = true; } Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -0,0 +1,95 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.event; + + +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; + +//transaction related +import javax.naming.InitialContext; +import javax.transaction.UserTransaction; + +// +import org.jboss.portlet.forums.ui.PortalUtil; + +/* + * Created on May 17, 2006 + * + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + */ +public class BeginTransactionListener implements PhaseListener +{ + /** + * The JNDI context. + */ + private InitialContext ctx = null; + + /** + * + */ + public BeginTransactionListener() throws Exception + { + this.ctx = new InitialContext(); + } + + /* + * + */ + public PhaseId getPhaseId() + { + return PhaseId.RESTORE_VIEW; + } + + /* + * + */ + public void beforePhase(PhaseEvent phaseEvent) + { + //check if the application is running in a portal + if(PortalUtil.isRunningInPortal()) + { + //no need....use the portal's transaction context + return; + } + + //handle transactions in a non-portal environment + try + { + UserTransaction tx = (UserTransaction) ctx.lookup("java:comp/UserTransaction"); + tx.begin(); + } + catch (Throwable t) + { + throw new RuntimeException(t); + } + } + + /* + * + */ + public void afterPhase(PhaseEvent phaseEvent) + { + //leave this empty...nothing to do here + } +} Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java 2006-05-17 23:55:59 UTC (rev 4300) @@ -0,0 +1,139 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.portlet.forums.ui.event; + + +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; + +//transaction related +import javax.naming.InitialContext; +import javax.transaction.UserTransaction; + +import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; + +/* + * Created on May 17, 2006 + * + * @author <a href="mailto:soh...@jb...">Sohil Shah</a> + */ +public class EndTransactionListener implements PhaseListener +{ + /** + * The JNDI context. + */ + private InitialContext ctx = null; + + /** + * + */ + public EndTransactionListener() throws Exception + { + this.ctx = new InitialContext(); + } + + /* + * + */ + public PhaseId getPhaseId() + { + return PhaseId.RENDER_RESPONSE; + } + + /* + * + */ + public void beforePhase(PhaseEvent phaseEvent) + { + //leave this empty, nothing to do here....... + } + + /* + * + */ + public void afterPhase(PhaseEvent phaseEvent) + { + UserTransaction tx = null; + boolean rollback = false; + + //check if the application is running in a portal + if(PortalUtil.isRunningInPortal()) + { + //no need....use the portal's transaction context + if(JSFUtil.isErrorOccurred()) + { + try + { + tx = (UserTransaction) ctx.lookup("java:comp/UserTransaction"); + tx.setRollbackOnly(); + } + catch(Throwable t) + { + //dont worry....this accomplishes killing the transaction + //when an application error occurs + } + } + return; + } + + //handle transactions in a non-portal environment + try + { + tx = (UserTransaction) ctx.lookup("java:comp/UserTransaction"); + //check if an error occurred and transaction should be rolled back + if(JSFUtil.isErrorOccurred()) + { + //this means an error occurred + rollback = true; + } + } + catch(Throwable t) + { + rollback = true; + throw new RuntimeException(t); + } + finally + { + if(tx!=null) + { + try + { + if(rollback) + { + tx.rollback(); + } + else + { + tx.commit(); + } + } + catch(Exception e) + { + //if exceptions occur with transaction rollback and committ...not a whole lot you can do about it + e.printStackTrace(); + } + } + } + } +} Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-17 23:55:59 UTC (rev 4300) @@ -23,6 +23,14 @@ <!--supported-locale>fr</supported-locale--> </locale-config> </application> + + <!-- phase listeners --> + <lifecycle> + <!-- starts before restoreView --> + <phase-listener>org.jboss.portlet.forums.ui.event.BeginTransactionListener</phase-listener> + <!-- starts after renderResponse --> + <phase-listener>org.jboss.portlet.forums.ui.event.EndTransactionListener</phase-listener> + </lifecycle> <!-- configuration for the shared EmptyController --> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml 2006-05-17 23:55:59 UTC (rev 4300) @@ -156,7 +156,7 @@ </header-content> </portlet> <portlet> - <portlet-name>JSFForumsPortlet</portlet-name> + <portlet-name>JSFForumsPortlet</portlet-name> <transaction> <trans-attribute>Required</trans-attribute> </transaction> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml 2006-05-17 22:56:00 UTC (rev 4299) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml 2006-05-17 23:55:59 UTC (rev 4300) @@ -10,11 +10,6 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> - <!-- MyFaces --> - <listener> - <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> - </listener> - <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value> @@ -53,17 +48,7 @@ <param-name>facelets.LIBRARIES</param-name> <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/forums.taglib.xml</param-value> </context-param> - - <!-- TransactionFilter --> - <filter> - <filter-name>TransactionFilter</filter-name> - <filter-class>org.jboss.portlet.forums.ui.TransactionFilter</filter-class> - </filter> - <filter-mapping> - <filter-name>TransactionFilter</filter-name> - <servlet-name>FacesServlet</servlet-name> - </filter-mapping> - + <!-- JSF Extensions filter --> <filter> <filter-name>MyFacesExtensionsFilter</filter-name> @@ -112,6 +97,12 @@ <url-pattern>/files</url-pattern> </servlet-mapping> + <!-- error handling --> + <!--error-page> + <error-code>500</error-code> + <location>/views/errors/error_body.jsf</location> + </error-page--> + <!-- secure the facelet views that make up the ui components of this jsf application --> <security-constraint> <display-name>constraints for all facelets</display-name> |
From: <jbo...@li...> - 2006-05-17 22:56:06
|
Author: KrisVerlaenen Date: 2006-05-17 18:56:00 -0400 (Wed, 17 May 2006) New Revision: 4299 Removed: labs/jbossrules/trunk/drools-ide/help/DroolsProject.GIF labs/jbossrules/trunk/drools-ide/help/audit/ labs/jbossrules/trunk/drools-ide/help/debug/ labs/jbossrules/trunk/drools-ide/help/drools.html labs/jbossrules/trunk/drools-ide/help/editor/ labs/jbossrules/trunk/drools-ide/toc.xml Log: generating eclipse help Deleted: labs/jbossrules/trunk/drools-ide/help/DroolsProject.GIF =================================================================== (Binary files differ) Deleted: labs/jbossrules/trunk/drools-ide/help/drools.html =================================================================== --- labs/jbossrules/trunk/drools-ide/help/drools.html 2006-05-17 22:54:30 UTC (rev 4298) +++ labs/jbossrules/trunk/drools-ide/help/drools.html 2006-05-17 22:56:00 UTC (rev 4299) @@ -1,26 +0,0 @@ -<html> - <H1>Drools Plugin</H1> - This is the Drools Plugin. - <P/> - All .drl files in a Drools project are automatically checked for correctness when saved. - <P/> - You can create a new Drools Project by selecting File -> New -> Project ... which pops up a 'New Project'-dialog. Select the New Rule Project item in the JBoss Rules folder and click Next. Fill in a name and click Finish. The new Drools Project should have been created. - <P/> - <IMG src="./DroolsProject.GIF"/> - <P/> - The newly created contains an example rule file (Sample.drl) in the src/rules dir and an example java file (DroolsTest.java) that can be used to execute the rules in a Drools engine in the folder src/java, in the com.sample package. All the others jars that are necessary during execution are also added to the classpath in a custom classpath container called Drools Library [3.0]. - <P/> - You can create a new Drools DRL File by selecting File -> New -> Other ... which pops up a 'New'-dialog. Select the New Rule Resource item in the JBoss Rules folder and click Next. Fill in a name and select the location where the Drools file should be created and click Finish. A new .java.drl file should have been created. This file already contains some xml that should be extended by adding new rulesets, rules, etc. - <P/> - Drools files (ending with .drl) are edited using the <A href="editor/editor.html">Drools Editor</A>. The editor offers some basic syntax colouring, code completion, etc. - <P/> - Drools files can be checked for consistence, and possible errors or warnings are shown in the Problems View. *.drl files in a Drools Project are automatically checked when building the project. This occurs automatically when the Drools file is saved if the project uses automatic building. - <P/> - When debugging an application using a Drools engine, three new views can be used to check the state of the Drools engine itself: the Working Memory View, the Agenda View and the Global Data View. To be able to use these views, create breakpoints in your code invoking the working memory. For example, the line where you call workingMemory.fireAllRules() is a good candidate. If the debugger halts at that joinpoint, you should select the working memory variable in the debug variables view. The following rules can then be used to show the details of the selected working memory: - <UL> - <LI>The <A href="debug/workingMemory.html">Working Memory</A> shows all elements in the working memory of the Drools working memory.</LI> - <LI>The <A href="debug/agenda.html">Agenda View</A> shows all elements on the agenda. For each rule on the agenda, the rule name and bound variables are shown.</LI> - <LI>The <A href="debug/applicationData.html">Global Data View</A> shows all global data currently defined in the Drools working memory.</LI> - </UL> - The <A href="audit/audit.html">Audit view</A> can be used to show audit logs that contain events that were logged during the execution of a rules engine in a tree view. -</html> \ No newline at end of file Deleted: labs/jbossrules/trunk/drools-ide/toc.xml =================================================================== --- labs/jbossrules/trunk/drools-ide/toc.xml 2006-05-17 22:54:30 UTC (rev 4298) +++ labs/jbossrules/trunk/drools-ide/toc.xml 2006-05-17 22:56:00 UTC (rev 4299) @@ -1,7 +0,0 @@ -<toc label="JBoss Rules Help" topic="help/drools.html"> - <topic label="Editor" href="help/editor/editor.html" /> - <topic label="Debugging" href="help/debug/debug.html"> - <link toc="help/debug/debug.toc" /> - </topic> - <topic label="Audit" href="help/audit/audit.html" /> -</toc> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-17 22:54:33
|
Author: KrisVerlaenen Date: 2006-05-17 18:54:30 -0400 (Wed, 17 May 2006) New Revision: 4298 Modified: labs/jbossrules/trunk/drools-ide/plugin.xml Log: generating eclipse help Modified: labs/jbossrules/trunk/drools-ide/plugin.xml =================================================================== --- labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-17 22:51:29 UTC (rev 4297) +++ labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-17 22:54:30 UTC (rev 4298) @@ -146,10 +146,6 @@ <toc file="help/eclipse/toc.xml" primary="true" /> </extension> - <extension point="org.eclipse.help.toc"> - <toc file="help/debug/debug.toc" /> - </extension> - <extension point = "org.eclipse.ui.preferencePages"> <page id="org.drools.ide.preferences.DroolsPreferencePage" class="org.drools.ide.preferences.DroolsPreferencePage" |
From: <jbo...@li...> - 2006-05-17 22:51:35
|
Author: KrisVerlaenen Date: 2006-05-17 18:51:29 -0400 (Wed, 17 May 2006) New Revision: 4297 Modified: labs/jbossrules/trunk/drools-ide/plugin.xml Log: generating eclipse help Modified: labs/jbossrules/trunk/drools-ide/plugin.xml =================================================================== --- labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-17 22:48:42 UTC (rev 4296) +++ labs/jbossrules/trunk/drools-ide/plugin.xml 2006-05-17 22:51:29 UTC (rev 4297) @@ -143,7 +143,7 @@ </extension> <extension point="org.eclipse.help.toc"> - <toc file="toc.xml" primary="true" /> + <toc file="help/eclipse/toc.xml" primary="true" /> </extension> <extension point="org.eclipse.help.toc"> |
From: <jbo...@li...> - 2006-05-17 22:48:51
|
Author: KrisVerlaenen Date: 2006-05-17 18:48:42 -0400 (Wed, 17 May 2006) New Revision: 4296 Modified: labs/jbossrules/trunk/documentation/manual/build.xml Log: generating eclipse help Modified: labs/jbossrules/trunk/documentation/manual/build.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/build.xml 2006-05-17 22:46:09 UTC (rev 4295) +++ labs/jbossrules/trunk/documentation/manual/build.xml 2006-05-17 22:48:42 UTC (rev 4296) @@ -1,220 +1,220 @@ -<!-- - To build the reference docs for a particular language only, use "ant -Dlang=en", for - example, and call either lang.all, lang.docpdf, lang.dochtml, or lang.dochtmlsingle - for the target of your choice. - - You can also call lang.section-check to track down missing identifiers in a particular - language, or you can call lang.revdiff to get a difference report for a particular - language, compared with the English reference. ---> -<project name="ReferenceDocumentation" default="all.doc" basedir="."> - <!-- Allow this to be overriden by others importing this project. --> - <dirname property="imported.basedir" file="${ant.file.ReferenceDocumentation}"/> - - <!-- Set build directories for all formats. --> - <property name="build.dir" value="${basedir}/build"/> - - <!-- Support files for build process. --> - <property name="support.dir" value="${imported.basedir}/support"/> - - <!-- Base name for documentation artifacts. --> - <property name="docname" value="drools"/> - - <!-- Set DocBook stylesheets. --> - <property name="db.style.fopdf" value="fopdf.xsl"/> - <property name="db.style.eclipse" value="eclipse.xsl"/> - <property name="db.style.html" value="html_chunk.xsl"/> - <property name="db.style.htmlsingle" value="html.xsl"/> - - <!-- Classpath for the build tools. --> - <path id="lib.classpath"> - <fileset dir="${support.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </path> - - <!-- ################################################################## --> - - <target name="all.doc" - depends="clean" - description="Compile documentation for all languages and all formats."> - - <!-- TRANSLATOR: Duplicate this line for your language --> - <antcall target="lang.all"><param name="lang" value="en"/></antcall> - - </target> - - <target name="all.revdiff" - description="Generates a diff report for all translated versions."> - - <!-- TRANSLATOR: Duplicate this line for your language --> - <antcall target="lang.revdiff"><param name="lang" value="zh-cn"/></antcall> - <antcall target="lang.revdiff"><param name="lang" value="es"/></antcall> - <antcall target="lang.revdiff"><param name="lang" value="ko"/></antcall> - - </target> - - <!-- ################################################################## --> - - <target name="clean"> - - <!-- Delete build directory. --> - <!--delete dir="${build.dir}"/--> - - </target> - - <target name="lang.all"> - <!-- Compile the documentation for a single language in all formats. --> - <antcall target="lang.misc"/> - <!--antcall target="lang.docpdf"/--> - <antcall target="lang.dochtml"/> - <antcall target="lang.dochtmlsingle"/> - <!--antcall target="lang.doceclipse"/--> - </target> - - <target name="lang.docpdf.prepare"> - <!-- Create the XSL/FO temporary file. --> - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}" maxmemory="128m" > - <classpath refid="lib.classpath"/> - <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" - value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> - <sysproperty key="javax.xml.parsers.SAXParserFactory" - value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> - <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" - value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> - <arg value="-o"/> - <arg value="${build.dir}/${lang}/pdf/drools.fo"/> - <arg value="${basedir}/${lang}/master.xml"/> - <arg value="${basedir}/${lang}/styles/${db.style.fopdf}"/> - </java> - - </target> - - <target name="lang.docpdf" depends="lang.docpdf.prepare"> - <!-- Create a PDF from the XSL/FO. --> - <java classname="org.apache.fop.cli.Main" fork="true" dir="${basedir}"> - <classpath refid="lib.classpath"/> - <arg value="-q"/> - <arg value="${build.dir}/${lang}/pdf/drools.fo"/> - <arg value="${build.dir}/${lang}/pdf/${docname}.pdf"/> - </java> - <!--delete> - <fileset dir="${build.dir}/${lang}/pdf" excludes="**/*.pdf"/> - </delete--> - </target> - - <target name="lang.dochtml" - description="Generates the HTML documentation only for a language (set lang)"> - - <mkdir dir="${build.dir}/${lang}/html/"/> - - <copy file="${basedir}/${lang}/index.html" todir="${build.dir}/${lang}/html"/> - - <copy todir="${build.dir}/${lang}/shared/images"> - <fileset dir="${basedir}/${lang}"> - <include name="**/*.png"/> - <include name="**/*.jpg"/> - <include name="**/*.png"/> - </fileset> - </copy> - - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html"> - <classpath refid="lib.classpath"/> - <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" - value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> - <sysproperty key="javax.xml.parsers.SAXParserFactory" - value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> - <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" - value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> - <arg value="${basedir}/${lang}/master.xml"/> - <arg value="${basedir}/${lang}/styles/${db.style.html}"/> - </java> - </target> - - <target name="lang.dochtmlsingle" - description="Generates the single-page HTML documentation only for a language (set lang)"> - - <mkdir dir="${build.dir}/${lang}/html_single/"/> - - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}"> - <classpath refid="lib.classpath"/> - <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" - value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> - <sysproperty key="javax.xml.parsers.SAXParserFactory" - value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> - <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" - value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> - <arg value="-o"/> - <arg value="${build.dir}/${lang}/html_single/index.html"/> - <arg value="${basedir}/${lang}/master.xml"/> - <arg value="${basedir}/${lang}/styles/${db.style.htmlsingle}"/> - </java> - </target> - - <target name="lang.doceclipse" - description="Generates the single-page HTML documentation only for a language (set lang)"> - - <mkdir dir="${build.dir}/${lang}/eclipse/"/> - - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/eclipse"> - <classpath refid="lib.classpath"/> - <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" - value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> - <sysproperty key="javax.xml.parsers.SAXParserFactory" - value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> - <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" - value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> - <arg value="${basedir}/${lang}/master.xml"/> - <arg value="${basedir}/${lang}/styles/${db.style.eclipse}"/> - </java> - </target> - - <target name="lang.misc"> - - <!-- Copy images and CSS for HTML documentation, language specific. --> - <copy todir="${build.dir}/${lang}/shared/images"> - <fileset dir="${basedir}/${lang}"> - <include name="**/*.png"/> - <include name="**/*.jpg"/> - <include name="**/*.png"/> - </fileset> - </copy> - <copy todir="${build.dir}/${lang}/shared/css"> - <fileset dir="${basedir}/${lang}/styles"> - <include name="**/*.css"/> - </fileset> - </copy> - - <!-- Fix and copy visio svg files --> - <style basedir="${basedir}/${lang}" destdir="${build.dir}/${lang}/shared/images" style="${basedir}/${lang}/styles/visio_svg.xsl" extension=".svg" force="true"> - <classpath refid="lib.classpath"/> - <include name="**/*.svg"/> - </style> - - </target> - - <target name="lang.revdiff" - description="Reports difference between English and translation (set lang)"> - - <taskdef name="revdiff" - classname="org.drools.docproc.revdiff.RevDiffReportTask" - classpathref="lib.classpath"> - - </taskdef> - - <revdiff original="${basedir}/en/master.xml" - copy="${basedir}/${lang}/master.xml" - report="${build.dir}/status_${lang}.html"/> - - </target> - - <target name="lang.section-check" depends="lang.dochtml" - description="Reports missing unique chapter/section identifiers (set lang)"> - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html"> - <classpath refid="lib.classpath"/> - <arg value="${basedir}/${lang}/master.xml"/> - <arg value="${support.dir}/section-check.xsl"/> - </java> - </target> - -</project> +<!-- + To build the reference docs for a particular language only, use "ant -Dlang=en", for + example, and call either lang.all, lang.docpdf, lang.dochtml, or lang.dochtmlsingle + for the target of your choice. + + You can also call lang.section-check to track down missing identifiers in a particular + language, or you can call lang.revdiff to get a difference report for a particular + language, compared with the English reference. +--> +<project name="ReferenceDocumentation" default="all.doc" basedir="."> + <!-- Allow this to be overriden by others importing this project. --> + <dirname property="imported.basedir" file="${ant.file.ReferenceDocumentation}"/> + + <!-- Set build directories for all formats. --> + <property name="build.dir" value="${basedir}/build"/> + + <!-- Support files for build process. --> + <property name="support.dir" value="${imported.basedir}/support"/> + + <!-- Base name for documentation artifacts. --> + <property name="docname" value="drools"/> + + <!-- Set DocBook stylesheets. --> + <property name="db.style.fopdf" value="fopdf.xsl"/> + <property name="db.style.eclipse" value="eclipse.xsl"/> + <property name="db.style.html" value="html_chunk.xsl"/> + <property name="db.style.htmlsingle" value="html.xsl"/> + + <!-- Classpath for the build tools. --> + <path id="lib.classpath"> + <fileset dir="${support.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + </path> + + <!-- ################################################################## --> + + <target name="all.doc" + depends="clean" + description="Compile documentation for all languages and all formats."> + + <!-- TRANSLATOR: Duplicate this line for your language --> + <antcall target="lang.all"><param name="lang" value="en"/></antcall> + + </target> + + <target name="all.revdiff" + description="Generates a diff report for all translated versions."> + + <!-- TRANSLATOR: Duplicate this line for your language --> + <antcall target="lang.revdiff"><param name="lang" value="zh-cn"/></antcall> + <antcall target="lang.revdiff"><param name="lang" value="es"/></antcall> + <antcall target="lang.revdiff"><param name="lang" value="ko"/></antcall> + + </target> + + <!-- ################################################################## --> + + <target name="clean"> + + <!-- Delete build directory. --> + <!--delete dir="${build.dir}"/--> + + </target> + + <target name="lang.all"> + <!-- Compile the documentation for a single language in all formats. --> + <antcall target="lang.misc"/> + <!--antcall target="lang.docpdf"/--> + <antcall target="lang.dochtml"/> + <antcall target="lang.dochtmlsingle"/> + <antcall target="lang.doceclipse"/> + </target> + + <target name="lang.docpdf.prepare"> + <!-- Create the XSL/FO temporary file. --> + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}" maxmemory="128m" > + <classpath refid="lib.classpath"/> + <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" + value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> + <sysproperty key="javax.xml.parsers.SAXParserFactory" + value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> + <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" + value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> + <arg value="-o"/> + <arg value="${build.dir}/${lang}/pdf/drools.fo"/> + <arg value="${basedir}/${lang}/master.xml"/> + <arg value="${basedir}/${lang}/styles/${db.style.fopdf}"/> + </java> + + </target> + + <target name="lang.docpdf" depends="lang.docpdf.prepare"> + <!-- Create a PDF from the XSL/FO. --> + <java classname="org.apache.fop.cli.Main" fork="true" dir="${basedir}"> + <classpath refid="lib.classpath"/> + <arg value="-q"/> + <arg value="${build.dir}/${lang}/pdf/drools.fo"/> + <arg value="${build.dir}/${lang}/pdf/${docname}.pdf"/> + </java> + <!--delete> + <fileset dir="${build.dir}/${lang}/pdf" excludes="**/*.pdf"/> + </delete--> + </target> + + <target name="lang.dochtml" + description="Generates the HTML documentation only for a language (set lang)"> + + <mkdir dir="${build.dir}/${lang}/html/"/> + + <copy file="${basedir}/${lang}/index.html" todir="${build.dir}/${lang}/html"/> + + <copy todir="${build.dir}/${lang}/shared/images"> + <fileset dir="${basedir}/${lang}"> + <include name="**/*.png"/> + <include name="**/*.jpg"/> + <include name="**/*.png"/> + </fileset> + </copy> + + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html"> + <classpath refid="lib.classpath"/> + <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" + value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> + <sysproperty key="javax.xml.parsers.SAXParserFactory" + value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> + <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" + value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> + <arg value="${basedir}/${lang}/master.xml"/> + <arg value="${basedir}/${lang}/styles/${db.style.html}"/> + </java> + </target> + + <target name="lang.dochtmlsingle" + description="Generates the single-page HTML documentation only for a language (set lang)"> + + <mkdir dir="${build.dir}/${lang}/html_single/"/> + + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}"> + <classpath refid="lib.classpath"/> + <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" + value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> + <sysproperty key="javax.xml.parsers.SAXParserFactory" + value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> + <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" + value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> + <arg value="-o"/> + <arg value="${build.dir}/${lang}/html_single/index.html"/> + <arg value="${basedir}/${lang}/master.xml"/> + <arg value="${basedir}/${lang}/styles/${db.style.htmlsingle}"/> + </java> + </target> + + <target name="lang.doceclipse" + description="Generates the single-page HTML documentation only for a language (set lang)"> + + <mkdir dir="${build.dir}/${lang}/eclipse/"/> + + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/eclipse"> + <classpath refid="lib.classpath"/> + <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" + value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> + <sysproperty key="javax.xml.parsers.SAXParserFactory" + value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> + <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration" + value="org.apache.xerces.parsers.XIncludeParserConfiguration" /> + <arg value="${basedir}/${lang}/master.xml"/> + <arg value="${basedir}/${lang}/styles/${db.style.eclipse}"/> + </java> + </target> + + <target name="lang.misc"> + + <!-- Copy images and CSS for HTML documentation, language specific. --> + <copy todir="${build.dir}/${lang}/shared/images"> + <fileset dir="${basedir}/${lang}"> + <include name="**/*.png"/> + <include name="**/*.jpg"/> + <include name="**/*.png"/> + </fileset> + </copy> + <copy todir="${build.dir}/${lang}/shared/css"> + <fileset dir="${basedir}/${lang}/styles"> + <include name="**/*.css"/> + </fileset> + </copy> + + <!-- Fix and copy visio svg files --> + <style basedir="${basedir}/${lang}" destdir="${build.dir}/${lang}/shared/images" style="${basedir}/${lang}/styles/visio_svg.xsl" extension=".svg" force="true"> + <classpath refid="lib.classpath"/> + <include name="**/*.svg"/> + </style> + + </target> + + <target name="lang.revdiff" + description="Reports difference between English and translation (set lang)"> + + <taskdef name="revdiff" + classname="org.drools.docproc.revdiff.RevDiffReportTask" + classpathref="lib.classpath"> + + </taskdef> + + <revdiff original="${basedir}/en/master.xml" + copy="${basedir}/${lang}/master.xml" + report="${build.dir}/status_${lang}.html"/> + + </target> + + <target name="lang.section-check" depends="lang.dochtml" + description="Reports missing unique chapter/section identifiers (set lang)"> + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html"> + <classpath refid="lib.classpath"/> + <arg value="${basedir}/${lang}/master.xml"/> + <arg value="${support.dir}/section-check.xsl"/> + </java> + </target> + +</project> |
From: <jbo...@li...> - 2006-05-17 22:46:14
|
Author: KrisVerlaenen Date: 2006-05-17 18:46:09 -0400 (Wed, 17 May 2006) New Revision: 4295 Modified: labs/jbossrules/trunk/build.xml Log: generating eclipse help Modified: labs/jbossrules/trunk/build.xml =================================================================== --- labs/jbossrules/trunk/build.xml 2006-05-17 22:30:13 UTC (rev 4294) +++ labs/jbossrules/trunk/build.xml 2006-05-17 22:46:09 UTC (rev 4295) @@ -399,7 +399,8 @@ </delete> <delete dir="documentation/manual/build" /> - + <delete dir="drools-ide/help/shared" /> + <delete dir="drools-ide/help/eclipse" /> </target> @@ -419,6 +420,14 @@ <target name="manual" unless="skip.manual"> <delete dir="documentation/manual/build" /> <ant dir="documentation/manual" /> + + <delete dir="drools-ide/help/eclipse" /> + <delete dir="drools-ide/help/shared" /> + <replace file="documentation/manual/build/en/eclipse/toc.xml" token="href="" value="href="help/eclipse/" /> + <replace file="documentation/manual/build/en/eclipse/toc.xml" token="topic="" value="topic="help/eclipse/" /> + <copy todir="drools-ide/help"> + <fileset dir="documentation/manual/build/en" includes="shared/** eclipse/**" excludes="**/*.svg **/*.db" /> + </copy> <copy todir="target/docs"> <fileset dir="documentation/manual/build/en" includes="shared/** html/** html_single/**" excludes="**/*.svg **/*.db" /> |
From: <jbo...@li...> - 2006-05-17 22:30:17
|
Author: mar...@jb... Date: 2006-05-17 18:30:13 -0400 (Wed, 17 May 2006) New Revision: 4294 Modified: labs/jbossrules/trunk/build.xml Log: -copy manual, instead of moving it Modified: labs/jbossrules/trunk/build.xml =================================================================== --- labs/jbossrules/trunk/build.xml 2006-05-17 22:19:08 UTC (rev 4293) +++ labs/jbossrules/trunk/build.xml 2006-05-17 22:30:13 UTC (rev 4294) @@ -420,9 +420,9 @@ <delete dir="documentation/manual/build" /> <ant dir="documentation/manual" /> - <move todir="target/docs"> + <copy todir="target/docs"> <fileset dir="documentation/manual/build/en" includes="shared/** html/** html_single/**" excludes="**/*.svg **/*.db" /> - </move> + </copy> </target> <target name="javadocs" depends="build-all" unless="skip.javadocs"> |
From: <jbo...@li...> - 2006-05-17 22:19:13
|
Author: mar...@jb... Date: 2006-05-17 18:19:08 -0400 (Wed, 17 May 2006) New Revision: 4293 Modified: labs/jbossrules/trunk/build.xml Log: -added comments Modified: labs/jbossrules/trunk/build.xml =================================================================== --- labs/jbossrules/trunk/build.xml 2006-05-17 22:12:56 UTC (rev 4292) +++ labs/jbossrules/trunk/build.xml 2006-05-17 22:19:08 UTC (rev 4293) @@ -1,5 +1,5 @@ <project name="Drools" basedir="." xmlns:artifact="urn:maven-artifact-ant" default="help"> - <property name="version" value="3.0-RC-3"/> + <property name="version" value="3.0-RC-3"/> <target name="help"> <echo level="info" message="Drools Build Help" /> @@ -66,6 +66,14 @@ <echo level="info" message="http://labs.jboss.com/portal/jbossrules/docs/index.html" /> </target> + <!-- + ************************************************** + * Utility scripts + * + * init, init-maven and copy-deps + ************************************************** + --> + <target name="init" depends="init-maven"> <mkdir dir="target/dist" /> <mkdir dir="target/docs" /> @@ -89,10 +97,177 @@ <artifact:install> <pom file="pom.xml" /> </artifact:install> + </target> + + <target name="copy-deps" depends="init-maven"> + <artifact:dependencies filesetId="drools-core.dependency.fileset" verbose="false"> + <pom file="drools-core/pom.xml"/> + </artifact:dependencies> + + <artifact:dependencies filesetId="drools-compiler.dependency.fileset" verbose="false"> + <pom file="drools-compiler/pom.xml"/> + </artifact:dependencies> + + <artifact:dependencies filesetId="drools-decisiontables.dependency.fileset" verbose="false"> + <pom file="drools-decisiontables/pom.xml"/> + </artifact:dependencies> + + <artifact:dependencies filesetId="drools-jsr94.dependency.fileset" verbose="false"> + <pom file="drools-jsr94/pom.xml"/> + </artifact:dependencies> + + <copy todir="repository"> + <fileset refid="drools-core.dependency.fileset"/> + <fileset refid="drools-compiler.dependency.fileset"/> + <fileset refid="drools-decisiontables.dependency.fileset"/> + <fileset refid="drools-jsr94.dependency.fileset"/> + </copy> + + <delete> + <fileset dir="drools-ide/lib" includes="*"/> + </delete> + + <copy todir="drools-ide/lib" + flatten="true"> + <fileset dir="repository" includes="**/*.jar" excludes="**/jsr94-sigtest-1.1.jar **/jsr94-tck-1.0.3.jar" /> + </copy> + </target> + <!-- + ************************************************** + * Module build scripts + * + * compile-module, test-module and build-module + * The module build scripts are data driven in that + * a variable, the module name, must be given. + ************************************************** + --> + + + <!-- + ************************************************** + * compile-module + * + * compiled code in src/main/java to target/main/classes + * also copies acros src/main/resources + ************************************************** + --> + <target name="compile-module"> + <mkdir dir="${module}/target"/> + <mkdir dir="${module}/target/classes"/> + + <artifact:dependencies pathId="${module}.dependency.classpath" filesetId="${module}.dependency.fileset" verbose="false"> + <pom file="${module}/pom.xml"/> + </artifact:dependencies> + + <copy todir="${module}/target/classes"> + <fileset dir="${module}/src/main/resources"/> + </copy> + + <javac srcdir="${module}/src/main/java" + destdir="${module}/target/classes" + source="1.4"> + <classpath> + <path refid="${module}.dependency.classpath" /> + <fileset dir="target"> + <include name="drools-*-{version}.jar"/> + </fileset> + </classpath> + </javac> + </target> + + + <!-- + ************************************************** + * test-module + * + * compiles test code in src/test/java to target/test/classes + * also copies acros src/test/resources. + * specifying -Dtest.skip=true from the command line causes + * this task to skip. + ************************************************** + --> + <target name="test-module" unless="test.skip"> + <mkdir dir="${module}/target/test-classes"/> + <mkdir dir="${module}/target/test-reports"/> + + <artifact:dependencies pathId="${module}.dependency.classpath" filesetId="${module}.dependency.fileset" verbose="false"> + <pom file="${module}/pom.xml"/> + </artifact:dependencies> + + <copy todir="${module}/target/test-classes"> + <fileset dir="${module}/src/test/resources"/> + </copy> + + <javac srcdir="${module}/src/test/java" + destdir="${module}/target/test-classes" + source="1.4"> + <classpath> + <path refid="${module}.dependency.classpath" /> + <pathelement location="${module}/target/classes"/> + <fileset dir="target"> + <include name="drools-*-{version}.jar"/> + </fileset> + </classpath> + </javac> + + <junit printsummary="yes" haltonfailure="yes"> + <sysproperty key="jsr94.tck.configuration" value="${module}/target/test-classes/org/drools/jsr94/tck"/> + <classpath> + <path refid="${module}.dependency.classpath"/> + <pathelement location="${module}/target/classes"/> + <pathelement location="${module}/target/test-classes"/> + <fileset dir="target"> + <include name="drools-*-{version}.jar"/> + </fileset> + </classpath> + + <formatter type="plain"/> + + <batchtest fork="no" todir="${module}/target/test-reports"> + <fileset dir="${module}/target/test-classes"> + <include name="**/*Test.class"/> + <exclude name="**/AllTests.class"/> + <exclude name="**/Base*.class"/> + <exclude name="**/ClassLoaderTest.java" /> + <exclude name="**/RuleExecutionSetProviderTest.java" /> + </fileset> + </batchtest> + </junit> </target> - - + + <!-- + ************************************************** + * build-module + * + * Generate a jar or the module and does an install + * to the local maven repository + ************************************************** + --> + <target name="build-module"> + <jar destfile="${module}/target/${module}-${version}.jar" basedir="${module}/target/classes"/> + <copy file="${module}/target/${module}-${version}.jar" todir="target" /> + + <artifact:install file="target/${module}-${version}.jar"> + <pom file="${module}/pom.xml" /> + </artifact:install> + </target> + + <!-- + ************************************************** + * compile, test and build module drivers + * + * Each one of these calls one of the above + * targets, providing the module name as a variable + ************************************************** + --> + + + <!-- + ************************************************** + * drools-core + ************************************************** + --> <target name="compile-core" depends="init"> <antcall target="compile-module"> <param name="module" value="drools-core"/> @@ -115,6 +290,11 @@ <delete dir="drools-core/target"/> </target> + <!-- + ************************************************** + * drools-compiler + ************************************************** + --> <target name="compile-compiler" depends="build-core"> <antcall target="compile-module"> <param name="module" value="drools-compiler"/> @@ -137,6 +317,11 @@ <delete dir="drools-compiler/target"/> </target> + <!-- + ************************************************** + * drools-decisiontables + ************************************************** + --> <target name="compile-decisiontables" depends="build-compiler"> <antcall target="compile-module"> <param name="module" value="drools-decisiontables"/> @@ -165,6 +350,11 @@ </antcall> </target> + <!-- + ************************************************** + * drools-jsr94 + ************************************************** + --> <target name="test-jsr94" depends="compile-jsr94"> <antcall target="test-module"> <param name="module" value="drools-jsr94"/> @@ -181,6 +371,13 @@ <delete dir="drools-jsr94/target"/> </target> + <!-- + ************************************************** + * "all" drivers. Each task performs its actions for + * each of the 4 modules. + ************************************************** + --> + <target name="compile-all" depends="compile-core, compile-compiler, compile-decisiontables, compile-jsr94"> </target> @@ -205,87 +402,19 @@ </target> - <target name="compile-module"> - <mkdir dir="${module}/target"/> - <mkdir dir="${module}/target/classes"/> - - <artifact:dependencies pathId="${module}.dependency.classpath" filesetId="${module}.dependency.fileset" verbose="false"> - <pom file="${module}/pom.xml"/> - </artifact:dependencies> - - <copy todir="${module}/target/classes"> - <fileset dir="${module}/src/main/resources"/> - </copy> - - <javac srcdir="${module}/src/main/java" - destdir="${module}/target/classes" - source="1.4"> - <classpath> - <path refid="${module}.dependency.classpath" /> - <fileset dir="target"> - <include name="drools-*-{version}.jar"/> - </fileset> - </classpath> - </javac> - </target> - - <target name="test-module" unless="test.skip"> - <mkdir dir="${module}/target/test-classes"/> - <mkdir dir="${module}/target/test-reports"/> - - <artifact:dependencies pathId="${module}.dependency.classpath" filesetId="${module}.dependency.fileset" verbose="false"> - <pom file="${module}/pom.xml"/> - </artifact:dependencies> - - <copy todir="${module}/target/test-classes"> - <fileset dir="${module}/src/test/resources"/> - </copy> - - <javac srcdir="${module}/src/test/java" - destdir="${module}/target/test-classes" - source="1.4"> - <classpath> - <path refid="${module}.dependency.classpath" /> - <pathelement location="${module}/target/classes"/> - <fileset dir="target"> - <include name="drools-*-{version}.jar"/> - </fileset> - </classpath> - </javac> - - <junit printsummary="yes" haltonfailure="yes"> - <sysproperty key="jsr94.tck.configuration" value="${module}/target/test-classes/org/drools/jsr94/tck"/> - <classpath> - <path refid="${module}.dependency.classpath"/> - <pathelement location="${module}/target/classes"/> - <pathelement location="${module}/target/test-classes"/> - <fileset dir="target"> - <include name="drools-*-{version}.jar"/> - </fileset> - </classpath> - - <formatter type="plain"/> - - <batchtest fork="no" todir="${module}/target/test-reports"> - <fileset dir="${module}/target/test-classes"> - <include name="**/*Test.class"/> - <exclude name="**/AllTests.class"/> - <exclude name="**/Base*.class"/> - <exclude name="**/ClassLoaderTest.java" /> - <exclude name="**/RuleExecutionSetProviderTest.java" /> - </fileset> - </batchtest> - </junit> - </target> - - <target name="build-module"> - <jar destfile="${module}/target/${module}-${version}.jar" basedir="${module}/target/classes"/> - <copy file="${module}/target/${module}-${version}.jar" todir="target" /> - - <artifact:install file="target/${module}-${version}.jar"> - <pom file="${module}/pom.xml" /> - </artifact:install> - </target> + + <!-- + ************************************************** + * Docoumentation Generation + * + * Javadocs, yDocs and Manual + * + * javadocs is the only target that should be invoked + * It checks the file system to see if ydocs is present, + * if it finds ydocs then it does a ydocs build otherwise + * it defaults to standard javadocs. + ************************************************** + --> <target name="manual" unless="skip.manual"> <delete dir="documentation/manual/build" /> @@ -367,9 +496,16 @@ <param name="-breakiterator"/> </doclet> </javadoc> - </target> + </target> - + <!-- + ************************************************** + * Distribution Builds + * + * dist-all, dist-src, dist-bin, dist-bin-withdeps + ************************************************** + --> + <target name="dist-all" depends="dist-src, dist-bin, dist-bin-withdeps, dist-examples"> </target> @@ -458,42 +594,5 @@ </zip> </target> - - <target name="copy-deps" depends="init-maven"> - <artifact:dependencies filesetId="drools-core.dependency.fileset" verbose="false"> - <pom file="drools-core/pom.xml"/> - </artifact:dependencies> - - <artifact:dependencies filesetId="drools-compiler.dependency.fileset" verbose="false"> - <pom file="drools-compiler/pom.xml"/> - </artifact:dependencies> - - <artifact:dependencies filesetId="drools-decisiontables.dependency.fileset" verbose="false"> - <pom file="drools-decisiontables/pom.xml"/> - </artifact:dependencies> - - <artifact:dependencies filesetId="drools-jsr94.dependency.fileset" verbose="false"> - <pom file="drools-jsr94/pom.xml"/> - </artifact:dependencies> - - <copy todir="repository"> - <fileset refid="drools-core.dependency.fileset"/> - <fileset refid="drools-compiler.dependency.fileset"/> - <fileset refid="drools-decisiontables.dependency.fileset"/> - <fileset refid="drools-jsr94.dependency.fileset"/> - </copy> - - <delete> - <fileset dir="drools-ide/lib" includes="*"/> - </delete> - - <copy todir="drools-ide/lib" - flatten="true"> - <fileset dir="repository" includes="**/*.jar" excludes="**/jsr94-sigtest-1.1.jar **/jsr94-tck-1.0.3.jar" /> - </copy> - </target> - - - - + </project> \ No newline at end of file |
From: <jbo...@li...> - 2006-05-17 22:13:11
|
Author: adamw Date: 2006-05-17 18:12:56 -0400 (Wed, 17 May 2006) New Revision: 4292 Removed: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/tld/forge.tld Modified: labs/shotoku/trunk/shotoku-feeds/project.properties labs/shotoku/trunk/shotoku-feeds/project.xml labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/Substitution.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/web.xml Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-36 Modified: labs/shotoku/trunk/shotoku-feeds/project.properties =================================================================== --- labs/shotoku/trunk/shotoku-feeds/project.properties 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/project.properties 2006-05-17 22:12:56 UTC (rev 4292) @@ -1,7 +1,9 @@ -maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven maven.junit.fork=yes maven.war.src=${basedir}/src/web +maven.final.name=${pom.artifactId} + maven.jar.override=on maven.jar.informa=${shotoku.root.dir}/shotoku-feeds/lib/informa.jar Modified: labs/shotoku/trunk/shotoku-feeds/project.xml =================================================================== --- labs/shotoku/trunk/shotoku-feeds/project.xml 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/project.xml 2006-05-17 22:12:56 UTC (rev 4292) @@ -7,7 +7,7 @@ <project> <pomVersion>3</pomVersion> <extend>../project.xml</extend> - <id>feeds</id> + <id>shotoku-feeds</id> <name>Shotoku Feeds</name> <currentVersion>1.0</currentVersion> <organization> @@ -24,6 +24,12 @@ </dependency> <dependency> + <groupId>shotoku</groupId> + <artifactId>shotoku-aop</artifactId> + <jar>shotoku-aop.jar</jar> + </dependency> + + <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet</artifactId> <jar>javax.servlet.jar</jar> @@ -78,7 +84,7 @@ <dependency> <groupId>xerces</groupId> <artifactId>xmlParserAPIs</artifactId> - <version>2.8.0</version> + <version>2.6.2</version> <properties> <war.bundle>true</war.bundle> </properties> @@ -92,6 +98,12 @@ <war.bundle>true</war.bundle> </properties> </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> </dependencies> <build> Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -22,50 +22,26 @@ package org.jboss.shotoku.feeds; import java.io.IOException; -import java.io.Writer; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Constructor; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; -import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import org.apache.velocity.VelocityContext; import org.apache.xerces.parsers.DOMParser; -import org.jboss.shotoku.tools.XmlTools; -import org.jboss.logging.Logger; +import org.apache.log4j.Logger; import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.feeds.data.Feed; -import org.jboss.shotoku.feeds.tools.RdfDateFormat; -import org.jboss.shotoku.feeds.tools.TextEscaping; -import org.jboss.shotoku.feeds.variables.VariableResolver; -import org.jboss.shotoku.feeds.variables.NullVariableResolver; -import org.jboss.shotoku.feeds.variables.Substitution; import org.jboss.shotoku.feeds.variables.VariableResolverManager; -import org.jboss.shotoku.feeds.tag.FeedDefinition; import org.jboss.shotoku.feeds.tag.FeedTagHandler; import org.jboss.shotoku.feeds.tag.FeedTagHandlerManager; import org.jboss.shotoku.tools.Pair; import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.aop.CacheItem; -import org.jboss.shotoku.search.Search; -import org.jboss.shotoku.search.SearchParameter; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.NamedNodeMap; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -77,28 +53,8 @@ * @author da...@si... */ public class FeedsDescriptor { -/* -# Shotoku feeds properites - search parameters classes -search.shotoku-feed = org.jboss.shotoku.search.Search - -search.and = org.jboss.shotoku.search.AndNodeFilter -search.or = org.jboss.shotoku.search.OrNodeFilter -search.property-value = org.jboss.shotoku.search.PropertyValueParameter - -search.directory = org.jboss.shotoku.search.DirectoryIncludeParameter -search.history = org.jboss.shotoku.search.HistoryIncludeParameter -search.limit = org.jboss.shotoku.search.LimitParameter -search.property-sort = org.jboss.shotoku.search.PropertySortParameter -search.date-sort = org.jboss.shotoku.search.DateSortParameter - -search.search = org.jboss.shotoku.search.Search - -search.parametrized = directory,history,limit,property-sort,property-value -*/ - private static final Logger log = Logger.getLogger(FeedsDescriptor.class); - @CacheItem private static FeedsCache feedsCache; @@ -106,28 +62,38 @@ private static FeedsConfigurationWatcher conf; static synchronized FeedsDescriptor getInstance(String id, String baseServerAddress) { - return feedsCache.get(new Pair<String, String>(id, baseServerAddress)); - } + return feedsCache.get(new Pair<String, String>(id, baseServerAddress)); + } - /** - * Ready feeds: feed name -> (feed type -> feed). - */ - private Map<String, Map<String, Feed>> feeds; + /** + * Ready feeds: feed name -> (feed type -> feed). + */ + private Map<String, Map<String, Feed>> feeds; - /** - * Feed group display name -> set of feed - * names. - */ - private Map<String, Set<String>> feedGroups; + /** + * Feed group display name -> set of feed + * names. + */ + private Map<String, Set<String>> feedGroups; private VariableResolverManager vrm; - private Map<String, FeedTagHandler> feedTagHandlers; + /** + * Feed tag handlers (not yet generated): feed name -> (feed type -> feed + * tag handler). + */ + private Map<String, Map<String, FeedTagHandler>> feedTagHandlers; + /** + * A set of feed names that are currently generated (used to detect looping + * feed definitions). + */ + private Set<String> duringGeneration; + private String baseServerAddress; - public FeedsDescriptor(String id, String baseServerAddress) { - this.baseServerAddress = baseServerAddress; + public FeedsDescriptor(String id, String baseServerAddress) { + this.baseServerAddress = baseServerAddress; // From the global Shotoku configuration, reading the config file // location in Shotoku repositories. @@ -144,93 +110,112 @@ ); vrm = new VariableResolverManager(id, props); - feedTagHandlers = new HashMap<String, FeedTagHandler>(); + feedTagHandlers = new HashMap<String, Map<String, FeedTagHandler>>(); // Creating the maps that will hold the feeds. - feeds = new HashMap<String, Map<String, Feed>>(); - feedGroups = new LinkedHashMap<String, Set<String>>(); + feeds = new HashMap<String, Map<String, Feed>>(); + feedGroups = new LinkedHashMap<String, Set<String>>(); - // Looking for file containing feed definitons and filling the maps. - for (org.jboss.shotoku.Node feedNode : + // Looking for file containing feed definitons and filling the maps. + for (org.jboss.shotoku.Node feedNode : cm.getRootDirectory().getNodes().toList()) { - if (feedNode.getName().endsWith(Constants.NODE_ENDING)) { - try { - addFeedDefinitions(feedNode); - } catch (Exception e) { - // We just don't add the feeds ... and log a warning. - log.warn("Can't add feed definitions from node " + + if (feedNode.getName().endsWith(Constants.NODE_ENDING)) { + try { + addFeedDefinitions(feedNode); + } catch (Exception e) { + // We just don't add the feeds ... and log a warning. + log.warn("Can't add feed definitions from node " + feedNode.getFullName() + ".", e); - } - } - } + } + } + } // Generating the feeds. + duringGeneration = new HashSet<String>(); while (feedTagHandlers.size() > 0) { // Trying to generate any feed found in the feed tag handler map. - generateFeed(feedTagHandlers.keySet().iterator().next(), - new HashSet<String>()); + generateFeed(feedTagHandlers.keySet().iterator().next()); } + + // TODO populate the groups } - private void addFeedDefinitions(org.jboss.shotoku.Node node) throws SAXException, IOException { - DOMParser parser = new DOMParser(); - // Parse the descriptor at the given Shotoku node. - parser.parse(new InputSource(node.getContentInputStream())); - // Get the XML document element of the feed descriptor file. - Node root = parser.getDocument().getDocumentElement(); + private void addFeedDefinitions(org.jboss.shotoku.Node node) throws SAXException, IOException { + DOMParser parser = new DOMParser(); + // Parse the descriptor at the given Shotoku node. + parser.parse(new InputSource(node.getContentInputStream())); + // Get the XML document element of the feed descriptor file. + Node root = parser.getDocument().getDocumentElement(); String group = Tools.getAttributeValue(root, "display-name"); Set<String> feedGroup = new LinkedHashSet<String>(); - // Each feed descriptor file has one feed group. - // Get the name of the feed group for this file. - feedGroups.put(group, feedGroup); + // Each feed descriptor file has one feed group. + // Get the name of the feed group for this file. + feedGroups.put(group, feedGroup); - NodeList nodes = root.getChildNodes(); + NodeList nodes = root.getChildNodes(); - // Iterate through the rest of the feed descriptor - // file to load all feeds for a given feed group. - for (int i = 0; i < nodes.getLength(); i++) { - Node n = nodes.item(i); - feedTagHandlers.putAll(FeedTagHandlerManager.getHandlers(group, n, vrm)); - } - } + // Iterate through the rest of the feed descriptor + // file to load all feeds for a given feed group. + for (int i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + FeedTagHandlerManager.createHandlers(group, n, vrm, this); + } + } /** - * Adds a feed of the given name and type. - * @param name - * @param type - * @param feed - */ - public void addFeed(String name, String type, Feed feed) { - Map<String, Feed> typesMap = feeds.get(name); - if (typesMap == null) { - typesMap = new HashMap<String, Feed>(); - feeds.put(name, typesMap); - } + * Adds a feed tag handler of the given name and type. + * @param name + * @param type + * @param fth + */ + public void addFeedTagHandler(String name, String type, FeedTagHandler fth) { + Map<String, FeedTagHandler> typesMap = feedTagHandlers.get(name); + if (typesMap == null) { + typesMap = new HashMap<String, FeedTagHandler>(); + feedTagHandlers.put(name, typesMap); + } - typesMap.put(type, feed); - } + typesMap.put(type, fth); + } /** + * Adds a ready feed of the given name and type. + * @param name + * @param type + * @param feed + */ + public void addFeed(String name, String type, Feed feed) { + Map<String, Feed> typesMap = feeds.get(name); + if (typesMap == null) { + typesMap = new HashMap<String, Feed>(); + feeds.put(name, typesMap); + } + + typesMap.put(type, feed); + } + + /** * Tries to generate a feed with the given name. If the feed is absent, * or is being already generated (this case indicates a loop in feed * definitions), no actions are taken. * @param name Feed to be generated. - * @param duringGeneration Set of feed names that are being generated - * at the moment (not yet added). * @return True iff generation was successfull. */ - public boolean generateFeed(String name, Set<String> duringGeneration) { + public boolean generateFeed(String name) { if (duringGeneration.contains(name)) { return false; } - FeedTagHandler fth = feedTagHandlers.get(name); - if (fth != null) { + Map<String, FeedTagHandler> typeMap = feedTagHandlers.get(name); + if (typeMap != null) { feedTagHandlers.remove(name); - + duringGeneration.add(name); - boolean ret = fth.generate(this, duringGeneration); + boolean ret = true; + for (FeedTagHandler fth : typeMap.values()) { + ret &= fth.generate(this); + } duringGeneration.remove(name); return ret; @@ -240,97 +225,35 @@ } /** - * In the given <code>map</code>, in its values, replaces each occurence of - * <code>replaceWhat</code> with <code>replaceTo</code>. - * @param map - * @param replaceWhat - * @param replaceTo - * @return <code>map</code> - */ - private Map<String, String> replaceInMapValues(Map<String, String> map, - String replaceWhat, String replaceTo) { - for (String key : map.keySet()) { - map.put(key, map.get(key).replace(replaceWhat, replaceTo)); - } + * Gets a feed of the given type and name. + * @param name Name of the feed to get. + * @param type Type of the feed to get. + * @return Feed with the given name and type. + */ + public Feed getFeed(String name, String type) { + Map<String, Feed> feedTypes = feeds.get(name); + if (feedTypes == null) + return null; - return map; - } + return feedTypes.get(type); + } - /** - * Generates a link to a specified feed. If the link is to be full, an - * absolute address is returned. Otherwise, a relative one. - * @param full - * @param feedName - * @param feedType - * @return - */ - private String generateFeedLink(boolean full, String feedName, - String feedType) { - return (full ? baseServerAddress : "") + "/feeds/" + feedName + "/" - + feedType; - } + public String getBaseServerAddress() { + return baseServerAddress; + } - /** - * Gets a feed of the given type and name. - * @param name Name of the feed to get. - * @param type Type of the feed to get. - * @return Feed with the given name and type. - */ - public Feed getFeed(String name, String type) { - Map<String, Feed> feedTypes = feeds.get(name); - if (feedTypes == null) - return null; + public VariableResolverManager getVariableResolverManager() { + return vrm; + } - return feedTypes.get(type); - } - /** * Releases all feeds - deletes temporary files which contain them. */ public void release() { - + for (Map<String, Feed> feedTypes : feeds.values()) { + for (Feed feed : feedTypes.values()) { + feed.release(); + } + } } - - /** - * Fills the <code>context</code> variable with feed information that is - * to be shown in the portlet. - */ - private void fillContext() { - String[] allFeedTypes = FeedFactory.getAllFeedTypes(); - - context = new DelegateContext(); - for (String feedGroup : feedGroups.keySet()) { - Set<String> feedsInGroup = feedGroups.get(feedGroup); - - if (feedsInGroup.size() > 0) { - DelegateContext groupContext = context.next("groups"); - groupContext.put("name", feedGroup); - - for (String feedName : feedsInGroup) { - Map<String, Feed> feedTypes = feeds.get(feedName); - - if (feedTypes != null) { - DelegateContext feedContext = groupContext - .next("feeds"); - feedContext.put("name", - feedDisplayNames.get(feedName)); - - Set availableTypes = feedTypes.keySet(); - for (String feedType : allFeedTypes) { - DelegateContext typeContext = feedContext - .next("types"); - - if (availableTypes.contains(feedType)) { - typeContext.next("feed"); - typeContext.put("name", feedType); - typeContext.put("link", generateFeedLink(false, - feedName, feedType)); - } - } - } - } - } - } - } - } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -24,11 +24,11 @@ import java.io.IOException; import javax.servlet.ServletException; +import javax.servlet.ServletRequest; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.jboss.forge.common.ForgeHelper; import org.jboss.shotoku.feeds.data.Feed; public class FeedsServlet extends HttpServlet { @@ -37,6 +37,15 @@ response.getWriter().println("The feed you requested is not available."); } + private static String makeAddress(String scheme, String server, int port) { + return scheme + "://" + server + ":" + port; + } + + public static String getBaseServerAddress(ServletRequest request) { + return makeAddress(request.getScheme(), request.getServerName(), + request.getServerPort()); + } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -60,8 +69,8 @@ String type = requestURI.substring(lastSlash+1); String name = requestURI.substring(0, lastSlash); - Feed feed = FeedsDescriptor.getInstance(ForgeHelper.LABS_PORTAL, - ForgeHelper.getBaseServerAddress(request)).getFeed(name, type); + Feed feed = FeedsDescriptor.getInstance("default", + getBaseServerAddress(request)).getFeed(name, type); if (feed == null) { invalidRequest(response); Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -91,4 +91,9 @@ * @return Type of this feed. */ public String getType(); + /** + * Called when this feed is no longer needed, so that any resources can + * be released (like temporary files). + */ + public void release(); } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -131,4 +131,8 @@ public String getType() { return type; } + + public void release() { + file.delete(); + } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -4,120 +4,91 @@ import org.w3c.dom.NodeList; import org.jboss.shotoku.feeds.data.Feed; import org.jboss.shotoku.feeds.FeedFactory; +import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.jboss.shotoku.feeds.Constants; +import org.jboss.shotoku.feeds.variables.Substitution; +import org.jboss.shotoku.tools.Tools; +import org.apache.log4j.Logger; import java.util.*; +import java.io.IOException; /** * @author Adam Warski (ad...@as...) */ public class AggregatedFeedTagHandler extends FeedTagHandler { - public AggregatedFeedTagHandler(String group, Node definition) { - super(group, definition); + private static final Logger log = Logger.getLogger(FeedsDescriptor.class); + + public AggregatedFeedTagHandler(String feedName, String group, Node definition, Substitution s) { + super(feedName, group, definition, s); } - private void generateAggregatedFeeds(Map<String, Node> feedDefs) { - // First building requirements of each feed - that is, whit which - // feeds each aggregated feed is built. - Map<String, Set<String>> requirements = - new HashMap<String, Set<String>>(); - Map<String, String[]> parameters = new HashMap<String, String[]>(); + public boolean generate(FeedsDescriptor fd) { + String feedName = getFeedName(); + String feedType = getFeedType(); + Node definition = getDefinition(); - // Gathering information about defined feeds, their requirements - // (that is, from which other feeds they are composed) and their - // parameters. - for (String feedName : feedDefs.keySet()) { - Node n; - Node feedNode = feedDefs.get(feedName); - NodeList nodes = feedNode.getChildNodes(); + // Reading all attributes and making the substitution on them. + Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition); + getSubstitution().make(attributes); - Set<String> feedRequirements = new HashSet<String>(); - requirements.put(feedName, feedRequirements); - parameters.put(feedName, new String[] { - XmlTools.getAttributeValue(feedNode, "title"), - XmlTools.getAttributeValue(feedNode, "description"), - XmlTools.getAttributeValue(feedNode, "author") }); - feedDisplayNames.put(feedName, XmlTools.getAttributeValue(feedNode, - "display-name")); + // First, getting (and if need be, generating) the feeds to be + // aggregated as written in the tag. + Set<Feed> toAggregate = new HashSet<Feed>(); + NodeList nodes = definition.getChildNodes(); + for (int i=0; i<nodes.getLength(); i++) { + Node n = nodes.item(i); + if ("include".equals(n.getNodeName())) { + String nameAttr = Tools.getAttributeValue(n, "name"); - for (int i = 0; i < nodes.getLength(); i++) { - n = nodes.item(i); - if ("include".equals(n.getNodeName())) { - String nameAttr = XmlTools.getAttributeValue(n, "name"); + // Generating substitutions. + Set<String> variables = FeedTagHandlerManager.getVariablesForNode(n); + Set<Substitution> substitutions = Substitution.newEmptySubstitionsSet(); - String[] siteIds = getSiteIds(); - - for (String siteId : siteIds) { - feedRequirements.add(nameAttr.replace(SITE_PARAM, - siteId)); - } + for (String variable : new HashSet<String>(variables)) { + fd.getVariableResolverManager().instantiateVariableResolver(variable, definition). + expandSubstitutionsSet(variables, substitutions); } - } - } - while (requirements.size() > 0) { - int sizeBefore = requirements.size(); + for (Substitution s : substitutions) { + String name = s.make(nameAttr); + Feed f = fd.getFeed(name, feedType); - for (Iterator<String> iter = requirements.keySet().iterator(); iter - .hasNext();) { - String feedName = iter.next(); - Set<String> feedRequirements = requirements.get(feedName); - String[] feedParameters = parameters.get(feedName); - Set<String> types = null; + if (f == null) { + // Trying to generate the feed. + if (!fd.generateFeed(name)) { + log.error("Cannot find all aggregated feeds or feeds definitions " + + "cycle for feed " + feedName + "."); + return false; + } - // Checking if the all of this feed's requirements are met - // and if so, of what types it can consist. - boolean allRequirementsMet = true; - for (String requirement : feedRequirements) { - Map<String, Feed> feedTypes = feeds.get(requirement); - - if (feedTypes == null) { - // Missing feed - cannot create the aggregated one. - allRequirementsMet = false; - break; + // The feeds have been successfully generated. + f = fd.getFeed(name, feedType); } - // Intersecting the types set with the types of the current - // feed. - if (types == null) { - types = new HashSet<String>(); - types.addAll(feedTypes.keySet()); - } else - types.retainAll(feedTypes.keySet()); + toAggregate.add(f); } + } + } - if (!allRequirementsMet) - continue; + if (toAggregate.size() == 0) { + log.error("Nothing to aggregate in feed " + feedName + "."); + return false; + } - // Gathering the feed parts from which the new feed will be - // composed. - for (String type : types) { - List<Feed> requiredFeeds = new ArrayList<Feed>(); - for (String requirement : feedRequirements) { - requiredFeeds.add(feeds.get(requirement).get(type)); - } + Feed feed = FeedFactory.getNewFeed(feedName, attributes.get(Constants.DISP_NAME_ATTR), + feedType); - Feed newFeed = FeedFactory.getNewFeed(type); - try { - newFeed.generate(requiredFeeds.toArray(new Feed[0]), - feedParameters[0], feedParameters[1], - feedParameters[2], generateFeedLink(true, - feedName, type)); - } catch (Exception e) { - log.warn("Can't add aggregated feed " + feedName - + " : " + type + ".", e); - } + try { + feed.generate(toAggregate.toArray(new Feed[0]), + attributes.get("title"), attributes.get("description"), + attributes.get("author"), generateFeedLink(fd, true, feedName, feedType)); + } catch (IOException e) { + log.error("Can't add aggregated feed " + feedName + " : " + feedType + ".", e); + } - addFeed(feedName, type, newFeed); - } + fd.addFeed(feedName, feedType, feed); - iter.remove(); - } - - if (sizeBefore == requirements.size()) { - log.warn("Aggregation feed definitions cycle, or demanded " - + "feeds are not defined; unable to create feeds."); - return; - } - } + return true; } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -1,34 +1,32 @@ package org.jboss.shotoku.feeds.tag; import org.w3c.dom.Node; -import org.w3c.dom.NamedNodeMap; -import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.feeds.variables.Substitution; -import org.jboss.shotoku.feeds.data.Feed; -import org.jboss.shotoku.feeds.FeedFactory; import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.jboss.shotoku.feeds.Constants; -import java.util.Map; -import java.util.Set; -import java.util.HashSet; -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import java.net.URL; - /** + * A base class for classes which handle generation of various feed types, + * basing on feed description that is contained in an xml node. * @author Adam Warski (ad...@as...) */ public abstract class FeedTagHandler { + private String feedName; private String group; private Node definition; private Substitution s; - public FeedTagHandler(String group, Node definition, Substitution s) { + public FeedTagHandler(String feedName, String group, Node definition, Substitution s) { + this.feedName = feedName; this.group = group; this.definition = definition; this.s = s; } + public String getFeedName() { + return feedName; + } + public String getGroup() { return group; } @@ -41,14 +39,31 @@ return s; } + public String getFeedType() { + return s.getSubstitutionFor(Constants.TYPE_VARIABLE); + } + /** * Generates a feed handled by this instance. The generated feed should * be added to the FeedsDescriptor by calling the FeedsDescriptor.addFeed() * method. * @param fd - * @param duringGeneration A set of feed names that are being generated - * at the moment. * @return True iff the generation was successfull and the feed was added. */ - public abstract boolean generate(FeedsDescriptor fd, Set<String> duringGeneration); + public abstract boolean generate(FeedsDescriptor fd); + + /** + * Generates a link to a specified feed. If the link is to be full, an + * absolute address is returned. Otherwise, a relative one. + * @param fd + * @param full + * @param feedName + * @param feedType + * @return Link to the given feed. + */ + protected String generateFeedLink(FeedsDescriptor fd, boolean full, String feedName, + String feedType) { + return (full ? fd.getBaseServerAddress() : "") + "/feeds/" + feedName + "/" + + feedType; + } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -5,12 +5,11 @@ import org.jboss.shotoku.feeds.FeedsDescriptor; import org.jboss.shotoku.feeds.variables.VariableResolverManager; import org.jboss.shotoku.feeds.variables.Substitution; -import org.jboss.logging.Logger; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import org.apache.log4j.Logger; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.util.Map; import java.util.Set; import java.util.HashSet; @@ -22,16 +21,16 @@ * @author Adam Warski (ad...@as...) */ public class FeedTagHandlerManager { - private static final Logger log = Logger.getLogger(FeedTagHandlerManager.class); + private static final Logger log = Logger.getLogger(FeedsDescriptor.class); /** * Tag name -> tag handler constructor. */ - private static Map<String, Constructor> handlers; + private static final Map<String, Constructor> handlers; private static void addHandler(String tagName, Class handlerClass) { try { - handlers.put(tagName, handlerClass.getConstructor(String.class, Node.class, + handlers.put(tagName, handlerClass.getConstructor(String.class, String.class, Node.class, Substitution.class)); } catch (NoSuchMethodException e) { log.error("No (String, Node) constructor found in tag " + tagName + " handler " + @@ -40,6 +39,8 @@ } static { + handlers = new HashMap<String, Constructor>(); + addHandler(Constants.AGG_FEED_TAG, AggregatedFeedTagHandler.class); addHandler(Constants.REM_FEED_TAG, RemoteFeedTagHandler.class); addHandler(Constants.SHO_FEED_TAG, ShotokuFeedTagHandler.class); @@ -80,13 +81,13 @@ return variables; } - public static Map<String, FeedTagHandler> getHandlers(String group, Node definition, - VariableResolverManager vrm) { + public static void createHandlers(String group, Node definition, + VariableResolverManager vrm, FeedsDescriptor fd) { // Getting an appropriate construtor to the given feed tag type. Constructor handlerConstr = handlers.get(definition.getNodeName()); if (handlerConstr == null) { log.error("Unknown feed tag: " + definition.getNodeName() + "."); - return new HashMap<String, FeedTagHandler>(); + return; } // Reading the feed name attribute. @@ -108,20 +109,15 @@ feedNameAttr + "."); } - // Creating the map which will be returned. - Map<String, FeedTagHandler> ret = new HashMap<String, FeedTagHandler>(); - // For each substitution, adding a tag handler to FeedsDescriptor. for (Substitution s : substitutions) { String feedName = s.make(feedNameAttr); try { - ret.put(feedName, - (FeedTagHandler) handlerConstr.newInstance(group, definition, s)); + fd.addFeedTagHandler(feedName, s.getSubstitutionFor(Constants.TYPE_VARIABLE), + (FeedTagHandler) handlerConstr.newInstance(feedName, group, definition, s)); } catch (Exception e) { log.error("Error constructing feed " + feedName + " tag handler.", e); } } - - return ret; } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -6,55 +6,40 @@ import org.jboss.shotoku.feeds.data.Feed; import org.jboss.shotoku.feeds.FeedFactory; import org.jboss.shotoku.feeds.Constants; +import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.apache.log4j.Logger; -import java.util.Map; -import java.util.Set; -import java.util.HashSet; import java.net.URL; /** * @author Adam Warski (ad...@as...) */ public class RemoteFeedTagHandler extends FeedTagHandler { - public void generate(Map<String, FeedDefinition> feedDefs) { - for (String feedName : feedDefs.keySet()) { - FeedDefinition feedDefinition = feedDefs.get(feedName); - Node feedNode = feedDefinition.definition; + private static final Logger log = Logger.getLogger(FeedsDescriptor.class); - String addressAttr = Tools.getAttributeValue(feedNode, "address"); - String displayNameAttr = Tools.getAttributeValue(feedNode, "display-name"); + public RemoteFeedTagHandler(String feedName, String group, Node definition, Substitution s) { + super(feedName, group, definition, s); + } - Set<String> variables = new HashSet<String>(); - // We always have to substitute the type variable. - variables.add(Constants.TYPE_VARIABLE); - addVariablesFromNode(variables, feedNode); + public boolean generate(FeedsDescriptor fd) { + Substitution s = getSubstitution(); + String feedName = getFeedName(); + String feedType = getFeedType(); - Set<Substitution> substitutions = Substitution.newEmptySubstitionsSet(); + String address = s.make(Tools.getAttributeValue(getDefinition(), "address")); + String displayName = s.make(Tools.getAttributeValue(getDefinition(), + Constants.DISP_NAME_ATTR)); - for (String variable : new HashSet<String>(variables)) { - instantiateVariableResolver(variable, feedNode). - expandSubstitutionsSet(variables, substitutions); - } + try { + Feed feed = FeedFactory.getNewFeed(feedName, displayName, feedType); + feed.generate(new URL(address)); + fd.addFeed(feedName, feedType, feed); + } catch (Exception e) { + log.debug("Can't add feed " + address + " : " + feedType + ".", e); - if (variables.size() > 0) { - log.warn("Unresolved variables left: " + variables.toString() + " in feed " + - feedName + "."); - continue; - } - - for (Substitution s : substitutions) { - String feedNameSub = s.make(feedName); - String feedType = s.getSubstitutionFor(Constants.TYPE_VARIABLE); - try { - Feed feed = FeedFactory.getNewFeed(feedNameSub, - s.make(displayNameAttr), feedType); - feed.generate(new URL(s.make(addressAttr))); - addFeed(feedNameSub, feedType, feed); - } catch (Exception e) { - log.debug("Can't add feed " + s.make(addressAttr) + " : " + feedType - + ".", e); - } - } + return false; } + + return true; } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -2,18 +2,21 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.jboss.shotoku.search.SearchParameter; -import org.jboss.shotoku.search.Search; +import org.jboss.shotoku.search.*; import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.feeds.tools.RdfDateFormat; import org.jboss.shotoku.feeds.tools.TextEscaping; import org.jboss.shotoku.feeds.data.Feed; import org.jboss.shotoku.feeds.FeedFactory; +import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.jboss.shotoku.feeds.Constants; +import org.jboss.shotoku.feeds.variables.Substitution; import org.apache.velocity.VelocityContext; +import org.apache.log4j.Logger; import java.util.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.lang.reflect.Constructor; import java.text.SimpleDateFormat; import java.io.Writer; @@ -21,181 +24,168 @@ * @author Adam Warski (ad...@as...) */ public class ShotokuFeedTagHandler extends FeedTagHandler { - public ShotokuFeedTagHandler(String group, Node definition) { - super(group, definition); + private static final Logger log = Logger.getLogger(FeedsDescriptor.class); + + public ShotokuFeedTagHandler(String feedName, String group, Node definition, Substitution s) { + super(feedName, group, definition, s); } + private static final Map<String, Constructor> paramsParametrized; + private static final Map<String, Constructor> paramsSimple; - /** - * Recursively generates a search parameter basing on its description that is - * contained in the given node. - * @param n Node from which to read the search parameters. - * @param props Properties with directives classes. - * @param parametrized Set of directive names that accept a parameter map - * in their constructor. - * @return A search parameter that is described in the given node. - * @throws IllegalArgumentException - * @throws SecurityException - * @throws InstantiationException - * @throws IllegalAccessException - * @throws java.lang.reflect.InvocationTargetException - * @throws NoSuchMethodException - * @throws ClassNotFoundException - */ - private SearchParameter generateSearchParameter(Node n, Properties props, - Set<String> parametrized, String siteId) - throws IllegalArgumentException, SecurityException, - InstantiationException, IllegalAccessException, - InvocationTargetException, NoSuchMethodException, - ClassNotFoundException { - String paramName = n.getNodeName(); + private static void addParamParametrized(String paramName, Class c) { + try { + paramsParametrized.put(paramName, c.getConstructor(Map.class)); + } catch (NoSuchMethodException e) { + log.error("Error adding a parametrized search parameter class " + + c.getName() + ".", e); + } + } - // Looking for a corresponding class. - String paramClass = props.getProperty(paramName); + private static void addParamSimple(String paramName, Class c) { + try { + paramsSimple.put(paramName, c.getConstructor()); + } catch (NoSuchMethodException e) { + log.error("Error adding a simple search parameter class " + + c.getName() + ".", e); + } + } - if (paramClass == null) - throw new RuntimeException("Unknown parameter name: " + paramName - + "."); + static { + paramsParametrized = new HashMap<String, Constructor>(); + paramsSimple = new HashMap<String, Constructor>(); - SearchParameter param; - if (parametrized.contains(paramName)) { - // Instatiating the class, it should have a constructor accepting a - // map. We take the map from node attributes, and replace - // ${site} and ${site-name} in them. - param = (SearchParameter) Class.forName(paramClass).getConstructor( - new Class[] { Map.class }).newInstance( - new Object[] { replaceInMapValues(replaceInMapValues( - XmlTools.getMapFromNodeAttributes(n), - SITE_PARAM, siteId), SITE_NAME_PARAM, - getSiteName(siteId)) }); - } else { - param = (SearchParameter) Class.forName(paramClass).newInstance(); - } + addParamSimple("and", AndNodeFilter.class); + addParamSimple("or", OrNodeFilter.class); + addParamSimple("property-value", PropertyValueParameter.class); - NodeList nodeList = n.getChildNodes(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node child = nodeList.item(i); + addParamSimple("search", Search.class); + addParamSimple("shotoku-feed", Search.class); - if (child.getNodeType() == Node.ELEMENT_NODE) { - // If the search paramater has child nodes, then the - // corresponding class should have an "add" method. - // Invoking the function recursively and adding the - // resulting parameter. - SearchParameter childParam = generateSearchParameter(child, - props, parametrized, siteId); + addParamParametrized("directory", DirectoryIncludeParameter.class); + addParamParametrized("history", HistoryIncludeParameter.class); + addParamParametrized("limit", LimitParameter.class); + addParamParametrized("property-sort", PropertySortParameter.class); + addParamParametrized("date-sort", DateSortParameter.class); + } - Method[] methods = param.getClass().getMethods(); - for (Method method : methods) { - if ("add".equals(method.getName())) { - method.invoke(param, new Object[] { childParam }); - break; - } - } - } - } + /** + * Recursively generates a search parameter basing on its description that is + * contained in the given node. + * @param n Node from which to read the search parameters. + * @return A search parameter that is described in the given node. + * @throws Exception + */ + private SearchParameter generateSearchParameter(Node n) + throws Exception { + String paramName = n.getNodeName(); - return param; + SearchParameter param; + if (paramsParametrized.containsKey(paramName)) { + // We take the map from node attributes, and replace any variables in them. + Map<String, String> attrs = Tools.getMapFromNodeAttributes(n); + getSubstitution().make(attrs); + param = (SearchParameter) paramsParametrized.get(paramName).newInstance(attrs); + } else { + param = (SearchParameter) paramsSimple.get(paramName).newInstance(); } - private final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z"; + NodeList nodeList = n.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + Node child = nodeList.item(i); - private void generateShotokuFeeds(Map<String, Node> feedDefs, - Properties props) { - Set<String> parametrized = new HashSet<String>(Arrays.asList(props.getProperty( - "parametrized").split("[,]"))); + if (child.getNodeType() == Node.ELEMENT_NODE) { + // If the search parameter has child nodes, then the + // corresponding class should have an "add" method. + // Invoking the function recursively and adding the + // resulting parameter. + SearchParameter childParam = generateSearchParameter(child); - for (String feedName : feedDefs.keySet()) { - Node feedNode = feedDefs.get(feedName); - String templateAttr = XmlTools.getAttributeValue(feedNode, - "template"); - String prefixAttr = XmlTools.getAttributeValue(feedNode, "prefix"); - String idAttr = XmlTools.getAttributeValue(feedNode, "id"); - String typesAttr = XmlTools.getAttributeValue(feedNode, "type"); - String displayNameAttr = XmlTools.getAttributeValue(feedNode, - "display-name"); + param.getClass().getMethod("add", SearchParameter.class).invoke(param, childParam); + } + } - ContentManager cm = ContentManager.getContentManager(idAttr, - prefixAttr); + return param; + } - // Generating the type of feeds that have been requested. - String[] types = getTypes(typesAttr); - // Generating the sites for which the feeds have been requested, - // if any. - String[] siteIds = getSiteIds(); + private final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z"; - Map<String, String> attributes = XmlTools - .getMapFromNodeAttributes(feedNode); + public boolean generate(FeedsDescriptor fd) { + Node definition = getDefinition(); + Substitution s = getSubstitution(); - // Creating a velcoity context with parts that won't change in all - // generated feeds. - VelocityContext vc = new VelocityContext(attributes); + // Reading all attributes and making the substitution on them. + Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition); + s.make(attributes); - String dateFormat = attributes.get("dateFormat"); - vc.put("dateFormat", new SimpleDateFormat( - dateFormat == null ? "MM/dd/yy" : dateFormat)); - vc.put("rssDateFormat", new SimpleDateFormat(RFC_822_DATE)); - vc.put("rdfDateFormat", new RdfDateFormat()); - vc.put("now", Calendar.getInstance().getTime()); - vc.put("baseServerAddress", baseServerAddress); - vc.put("escape", new TextEscaping()); + String template = attributes.get("template"); + String displayName = attributes.get(Constants.DISP_NAME_ATTR); - for (String site : siteIds) { - String feedNameReplaced = feedName.replace(SITE_PARAM, - site); + ContentManager cm = ContentManager.getContentManager(attributes.get("id"), + attributes.get("prefix")); - NodeList feedNodeChildren = feedNode.getChildNodes(); - for (int i = 0; i < feedNodeChildren.getLength(); i++) { - // For each search node, generating and performing the - // search, placing it under the demanded attribute in - // velocity's context. - Node searchNode = feedNodeChildren.item(i); - if ("search".equals(searchNode.getNodeName())) { - try { - Search search = (Search) generateSearchParameter( - searchNode, props, parametrized, site); + // Creating a velocity context with parts that won't change in all + // generated feeds. + VelocityContext vc = new VelocityContext(attributes); - org.jboss.shotoku.NodeList list = cm.search(search); + String dateFormat = attributes.get("dateFormat"); + vc.put("dateFormat", new SimpleDateFormat(dateFormat == null ? "MM/dd/yy" : dateFormat)); + vc.put("rssDateFormat", new SimpleDateFormat(RFC_822_DATE)); + vc.put("rdfDateFormat", new RdfDateFormat()); + vc.put("now", Calendar.getInstance().getTime()); + vc.put("baseServerAddress", fd.getBaseServerAddress()); + vc.put("escape", new TextEscaping()); - String searchNameAttr = XmlTools.getAttributeValue( - searchNode, "name"); - if (searchNameAttr == null) - searchNameAttr = "nodes"; + NodeList feedNodeChildren = definition.getChildNodes(); + for (int i = 0; i < feedNodeChildren.getLength(); i++) { + // For each search node, generating and performing the + // search, placing it under the demanded attribute in + // velocity's context. + Node searchNode = feedNodeChildren.item(i); + if ("search".equals(searchNode.getNodeName())) { + try { + Search search = (Search) generateSearchParameter( + searchNode); - vc.put(searchNameAttr, list); - } catch (Exception e) { - log.warn("Error generating shotoku feed " - + feedName + ".", e); - continue; - } - } + org.jboss.shotoku.NodeList list = cm.search(search); + + String searchNameAttr = Tools.getAttributeValue(searchNode, "name"); + if (searchNameAttr == null) { + searchNameAttr = "nodes"; } - for (String type : types) { - String template = templateAttr.replace(TYPE_PARAM, type); + vc.put(searchNameAttr, list); + } catch (Exception e) { + log.error("Error generating shotoku feed " + getFeedName() + ".", e); - Feed newFeed = FeedFactory.getNewFeed(type); - try { - vc.put("link", generateFeedLink(true, feedNameReplaced, - type)); - - // Now that we have type and site, we can render the - // template. - Writer w = newFeed.getWriter(); - cm.getVelocityEngine().mergeTemplate(template, vc, w); - w.flush(); - w.close(); - - // And add the feed. - addFeed(feedNameReplaced, type, newFeed); - } catch (Exception e) { - log.warn("Cannot merge template " + template + " for " - + feedName + ".", e); - continue; - } - } + return false; } } } + String feedName = getFeedName(); + String feedType = getFeedType(); + Feed newFeed = FeedFactory.getNewFeed(feedName, displayName, feedType); + try { + vc.put("link", generateFeedLink(fd, true, feedName, feedType)); + + // Now that we have type and site, we can render the + // template. + Writer w = newFeed.getWriter(); + cm.getVelocityEngine().mergeTemplate(template, vc, w); + w.flush(); + w.close(); + + // And add the feed. + fd.addFeed(feedName, feedType, newFeed); + } catch (Exception e) { + log.error("Cannot merge template " + template + " for " + + feedName + ".", e); + + return false; + } + + return true; + } } Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/Substitution.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/Substitution.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/Substitution.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -50,6 +50,15 @@ return result.toString(); } + /** + * Makes the substitution in each value of the given map. + */ + public void make(Map<? extends Object, String> m) { + for (Map.Entry<? extends Object, String> e : m.entrySet()) { + e.setValue(make(e.getValue())); + } + } + @Override public Substitution clone() { Substitution ret; Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java 2006-05-17 22:12:56 UTC (rev 4292) @@ -2,7 +2,8 @@ import org.w3c.dom.Node; import org.jboss.shotoku.feeds.Constants; -import org.jboss.logging.Logger; +import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.apache.log4j.Logger; import java.util.HashMap; import java.util.Map; @@ -13,7 +14,7 @@ * @author Adam Warski (ad...@as...) */ public class VariableResolverManager { - private static final Logger log = Logger.getLogger(VariableResolverManager.class); + private static final Logger log = Logger.getLogger(FeedsDescriptor.class); private Map<String, Constructor> varResolversNodeConstructor; private Map<String, Constructor> varResolversEmptyConstructor; @@ -63,7 +64,7 @@ } c = varResolversEmptyConstructor.get(variable); - + if (c != null) { try { return (VariableResolver) c.newInstance(); Deleted: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/tld/forge.tld =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/tld/forge.tld 2006-05-17 21:39:20 UTC (rev 4291) +++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/tld/forge.tld 2006-05-17 22:12:56 UTC (rev 4292) @@ -1,139 +0,0 @@ -<taglib xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" - version="2.0"> - <!-- - JBoss, the OpenSource J2EE webOS - Distributable under LGPL license. - See terms of license at gnu.org. - --> - <tlib-version>1.1</tlib-version> - <jsp-version>2.0</jsp-version> - <shortname>forge</shortname> - <info>Forge tags</info> - - <tag> - <name>pageURL</name> - <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass> - <attribute> - <name>page</name> - ... [truncated message content] |
From: <jbo...@li...> - 2006-05-17 21:39:26
|
Author: KrisVerlaenen Date: 2006-05-17 17:39:20 -0400 (Wed, 17 May 2006) New Revision: 4291 Modified: labs/jbossrules/trunk/build.xml Log: clean-all now also cleans repository dir + fixed error in build help Modified: labs/jbossrules/trunk/build.xml =================================================================== --- labs/jbossrules/trunk/build.xml 2006-05-17 20:54:55 UTC (rev 4290) +++ labs/jbossrules/trunk/build.xml 2006-05-17 21:39:20 UTC (rev 4291) @@ -59,7 +59,7 @@ <echo level="info" message="-Dmanual.skip=true" /> <echo level="info" message=" " /> <echo level="info" message="Targets may be combined:" /> - <echo level="info" message="ant -Dtest.skip clean-all build-all" /> + <echo level="info" message="ant -Dtest.skip=true clean-all build-all" /> <echo level="info" message=" " /> <echo level="info" message="For more help use the build system to generate the manual" /> <echo level="info" message="or you can find the manual online at:" /> @@ -197,8 +197,8 @@ <fileset dir="drools-ide/lib" includes="*"/> </delete> - <delete> - <fileset dir="repository" includes="*"/> + <delete includeEmptyDirs="true"> + <fileset dir="repository" includes="*/**"/> </delete> <delete dir="documentation/manual/build" /> |
Author: wrzep Date: 2006-05-17 16:54:55 -0400 (Wed, 17 May 2006) New Revision: 4290 Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Constants.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Locations.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tags.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tools.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java Removed: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tags.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tools.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusConfWatcher.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusPortlet.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/codelines/CodeLinesPlugin.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java Log: JBLAB-599 further refactoring Pawel Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -35,6 +35,7 @@ import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; @@ -47,8 +48,7 @@ import org.jboss.forge.status.templates.Columns; import org.jboss.forge.status.templates.MatrixTemplate; import org.jboss.forge.status.tools.ScoresManagerSync; -import org.jboss.forge.status.tools.ScoresManagerAsync; -import org.jboss.forge.status.tools.Tags; +import org.jboss.forge.status.tools.ScoresManager; import org.jboss.logging.Logger; import org.jboss.portal.common.context.DelegateContext; @@ -92,12 +92,12 @@ PluginsValues pluginsValues; try { - // Compute and save current scores + // Get current scores - ScoresManagerAsync.init(portalName, serviceConf); - ScoresManagerAsync.save(projects, pluginsConf); + ScoresManager.init(portalName, serviceConf); + ScoresManager.save(projects, pluginsConf); - pluginsValues = ScoresManagerAsync.getCurrentScores(); + pluginsValues = ScoresManager.getCurrentScores(); } catch (ScoresSaveException e) { log.error("Saving scores failed ", e); Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusConfWatcher.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusConfWatcher.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusConfWatcher.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Set; -import org.jboss.forge.status.tools.Tools; +import org.jboss.forge.status.common.Locations; import org.jboss.shotoku.cache.ChangeType; import org.jboss.shotoku.cache.ShotokuResourceWatcher; @@ -40,16 +40,16 @@ String portalName = key; - addWatchedPath(key, Tools.getXmlCmPath(portalName)); - addWatchedPath(key, Tools.getXmlStatusPluginsCmPath(portalName)); - addWatchedPath(key, Tools.getServicePropertiesCmPath(portalName)); + addWatchedPath(key, Locations.getXmlCmPath(portalName)); + addWatchedPath(key, Locations.getXmlStatusPluginsCmPath(portalName)); + addWatchedPath(key, Locations.getServicePropertiesCmPath(portalName)); /* Watch projects.xml file */ - addWatchedPath(key, Tools.getProjectsXmlPath(portalName)); + addWatchedPath(key, Locations.getProjectsXmlPath(portalName)); /* Watch all project.xml files. * We assume that they contain entries used by plugins */ - Set<String> projectXmlPathsSet = Tools.getProjectXmlPathsSet(portalName); + Set<String> projectXmlPathsSet = Locations.getProjectXmlPathsSet(portalName); for (String projectXmlPath : projectXmlPathsSet) { addWatchedPath(key, projectXmlPath); Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusDescriptor.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -25,7 +25,7 @@ import java.util.Map; import java.io.IOException; -import org.jboss.forge.status.tools.Tools; +import org.jboss.forge.status.common.Locations; import org.jboss.portal.common.context.DelegateContext; import org.jboss.shotoku.ContentManager; @@ -53,13 +53,13 @@ public StatusDescriptor(String portalName, ContentManager cm) { try { - String statusPath = Tools.getXmlCmPath(portalName); + String statusPath = Locations.getXmlCmPath(portalName); Node statusRoot = getRoot(cm , statusPath); - String pluginsPath = Tools.getXmlStatusPluginsCmPath(portalName); + String pluginsPath = Locations.getXmlStatusPluginsCmPath(portalName); Node pluginsRoot = getRoot(cm, pluginsPath); - String servicePath = Tools.getServicePropertiesCmPath(portalName); + String servicePath = Locations.getServicePropertiesCmPath(portalName); org.jboss.shotoku.Node serviceNode = cm.getNode(servicePath); status = new Status(portalName, statusRoot, pluginsRoot, Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusPortlet.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusPortlet.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusPortlet.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -28,7 +28,9 @@ import javax.portlet.PortletRequestDispatcher; import org.jboss.forge.common.ForgeHelper; -import org.jboss.forge.status.tools.Tools; +import org.jboss.forge.status.common.Locations; +import org.jboss.forge.status.common.Tools; + import org.jboss.portal.common.context.DelegateContext; import org.jboss.portal.core.servlet.jsp.PortalJsp; @@ -62,17 +64,17 @@ DelegateContext context = null; if ((id != null) && (action.equals(PROJECT_DETAILS_ACTION))) { - jspPath = Tools.getPrjDetailsJspCmPath(); + jspPath = Locations.getPrjDetailsJspCmPath(); context = desc.getProjectContext(id); } if ((id != null) && (action.equals(COLUMN_DETAILS_ACTION))) { - jspPath = Tools.getColumnDetailsJspCmPath(); + jspPath = Locations.getColumnDetailsJspCmPath(); context = desc.getColumnContext(id); } if (id == null) { // Request for main Matrix page - jspPath = Tools.getJspCmPath(); + jspPath = Locations.getJspCmPath(); context = desc.getContext(); } Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Constants.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Constants.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Constants.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -0,0 +1,28 @@ +package org.jboss.forge.status.common; + +/** + * @author Pawel Wrzeszcz + */ +public class Constants { + + + /* The length of time to sleep (in milliseconds) + * if requested scores are not available */ + public static final long SLEEP_TIME = 2000; + public static final int MAX_ATTEMPTS = 10; + + public static final String QUEUE_NAME = "queue/jmm"; + + public static final String NAME_PROPERTY = "name"; + public static final String SAVE_MESSAGE = "save"; + public static final String GET_SCORES_MESSAGE = "get"; + + public static final String STATUS_LOCAL_SERVICE = "Status/LocalScoresService"; + public static final String STATUS_REMOTE_SERVICE = "Status/RemoteScoresService"; + + /** + * This class cannot be instatiated. + */ + private Constants() {}; + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Locations.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Locations.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Locations.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -0,0 +1,106 @@ +package org.jboss.forge.status.common; + +import java.util.HashSet; +import java.util.Set; + +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.common.projects.ProjectsHelper; +import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; +import org.jboss.forge.common.projects.permissions.PermissionsChecker; + +/** + * Common functions. + * @author Pawel Wrzeszcz + */ +public class Locations { + + /** <code>STATUS_XML<code> - file defining the list of watched feeds */ + private final static String STATUS_XML = "status.xml"; + private final static String STATUS_PLUGINS_XML = "plugins.xml"; + private final static String STATUS_SERVICE_PROPERTIES = "service.properties"; + + /** <code>STATUS_DIR</code> - directory in which file <code>STATUS_XML<code> is stored. */ + private final static String STATUS_DIR = "status"; + + private final static String STATUS_JSP = "status.jsp"; + private final static String STATUS_JSP_DIR = "status"; + private final static String PROJECT_DETAILS_JSP = "project_details.jsp"; + private final static String COLUMN_DETAILS_JSP = "column_details.jsp"; + + /** Shotoku directory to store historical scores */ + private static final String SHOTOKU_STATUS_DIR = "status"; + + /** + * Path to the xml file with the Status Matrix properties. + */ + public static String getXmlCmPath(String portalName) { + return portalName + "/" + STATUS_DIR + "/" + STATUS_XML; + } + + /** + * Path to the xml file defining Plugins used in the Matrix. + */ + public static String getXmlStatusPluginsCmPath(String portalName) { + return portalName + "/" + STATUS_DIR + "/" + STATUS_PLUGINS_XML; + } + + /** + * Path to the xml file defining ejb3 service. + */ + public static String getServicePropertiesCmPath(String portalName) { + return portalName + "/" + STATUS_DIR + "/" + Locations.STATUS_SERVICE_PROPERTIES; + } + + /** + * Path to the projects.xml file. + */ + public static String getProjectsXmlPath(String portalName) { + return portalName + "/" + ProjectsHelper.PROJECTS_DESC; + } + + /** + * Set containing paths to project.xml files for all projects. + */ + public static Set<String> getProjectXmlPathsSet(String portalName) { + + Set<String> pathsSet = new HashSet<String>(); + + Projects projects = ProjectsHelper.getProjects(portalName); + Set<String> projectIdsSet = projects.getProjectIds( + (PermissionsChecker) new NullPermissionsChecker(), null); + + for (String projectId : projectIdsSet) { + + String projectXmlPath = portalName + "/" + ProjectsHelper.MEMBERS_DIR + + "/" + projectId + "/" + ProjectsHelper.PROJECT_DESC; + pathsSet.add(projectXmlPath); + } + return pathsSet; + } + + /** + * Path to the jsp file responsible file displaying the Status Matrix. + */ + public static String getJspCmPath() { + return STATUS_JSP_DIR + "/" + STATUS_JSP; + } + + /** + * Path to the jsp file responsible for displaying project details. + */ + public static String getPrjDetailsJspCmPath() { + return STATUS_JSP_DIR + "/" + PROJECT_DETAILS_JSP; + } + + /** + * Path to the jsp file responsible displaying column details. + */ + public static String getColumnDetailsJspCmPath() { + return STATUS_JSP_DIR + "/" + COLUMN_DETAILS_JSP; + } + + public static String getShotokuStatusPath(String portalName) { + return ForgeHelper.DYNAMIC_CONTENT_DIR + "/" + SHOTOKU_STATUS_DIR; + } +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tags.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tags.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tags.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -0,0 +1,87 @@ +/* + * 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.common; + +/** +* @author Pawel Wrzeszcz +* Status Matrix xml tags. +*/ +public class Tags { + + /* status.xml file tags */ + + /* main page */ + public static final String MAIN_PAGE_COLUMNS_TAG = "main-page"; + + public final static String COLUMN_ELEMENT = "column"; + public final static String COLUMNS_ELEMENT = "columns"; + public static final String COLUMN_NAME_ELEMENT = "name"; + public static final String COLUMN_PLUGIN_ELEMENT = "plugin"; + + public final static String ORDER_PLUGIN_ELEMENT = "order-plugin"; + + /* project page */ + public static final String PROJECT_PAGE_COLUMNS_TAG = "project-page"; + + public static final String ROWS_ELEMENT = "rows"; + public static final String ROW_ELEMENT = "row"; + public static final String ROW_NAME_ELEMENT = "name"; + + public static final String CELLS_ELEMENT = "cells"; + public static final String CELL_ELEMENT = "cell"; + public static final String CELL_NAME_ELEMENT = "name"; + + public static final String METRICS_ELEMENT = "metrics"; + public static final String METRIC_ELEMENT = "metric"; + public static final String METRIC_NAME_ELEMENT = "name"; + public static final String METRIC_PLUGIN_ELEMENT = "plugin"; + + /* service.xml tags */ + public static final String SERVICE_REMOTE_ELEMENT = "service.remote"; + + /* plugins.xml tags */ + public final static String PLUGIN_ELEMENT = "plugin"; + + public final static String PLUGIN_ID_ELEMENT = "id"; + public final static String PLUGIN_CLASS_ELEMENT = "class"; + public final static String PLUGIN_PROPERTIES_ELEMENT = "properties"; + + /* project.xml files tags */ + public static final String JIRA_SERVICE_PROPERTY = "jira-service"; + public static final String JIRA_ADRESS_TAG = "jira-address"; + public static final String SVN_SERVICE_PROPERTY = "svn-service"; + + public static final String CC_SERVICE_PROPERTY = "cc-service"; + public static final String CC_ADRESS_TAG = "cc-address"; + + public static final String SVN_REPO_ADRESS_TAG = "svn-repo"; + public static final String SVN_USERNAME_TAG = "svn-username"; + public static final String SVN_PASSWD_TAG = "svn-passwd"; + + public static final String STATUS_SERVICE_NAME = "status:service=scores"; + + /** + * This class cannot be instatiated. + */ + private Tags() {}; +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tools.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tools.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/common/Tools.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -0,0 +1,21 @@ +package org.jboss.forge.status.common; + +import org.jboss.forge.status.StatusDescriptor; +import org.jboss.forge.status.StatusConfWatcher; + +import org.jboss.shotoku.aop.CacheItem; + +/** + * Common functions. + * @author Pawel Wrzeszcz + */ +public class Tools { + + @CacheItem + private static StatusConfWatcher conf; + + public static synchronized StatusDescriptor getDesc(final String portalName) { + return conf.get(portalName); + } + +} Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/cc/CcStatusPlugin.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -25,8 +25,8 @@ import java.util.List; import java.net.MalformedURLException; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.plugins.KosmosStatusPlugin; -import org.jboss.forge.status.tools.Tags; import org.jboss.logging.Logger; import com.caucho.hessian.client.HessianProxyFactory; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/codelines/CodeLinesPlugin.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/codelines/CodeLinesPlugin.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/codelines/CodeLinesPlugin.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -25,8 +25,8 @@ import java.util.Map; import java.util.HashMap; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.plugins.Plugin; -import org.jboss.forge.status.tools.Tags; /** * @author Pawel Wrzeszcz Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/jira/JiraStatusPlugin.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -25,8 +25,8 @@ import java.util.List; import java.net.MalformedURLException; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.plugins.KosmosStatusPlugin; -import org.jboss.forge.status.tools.Tags; import org.jboss.logging.Logger; import com.caucho.hessian.client.HessianProxyFactory; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/svn/SvnStatusPlugin.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -25,8 +25,8 @@ import java.util.List; import java.net.MalformedURLException; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.plugins.KosmosStatusPlugin; -import org.jboss.forge.status.tools.Tags; import org.jboss.logging.Logger; import com.caucho.hessian.client.HessianProxyFactory; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -29,7 +29,6 @@ import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; import org.jboss.forge.status.service.protocol.PluginConf; -import org.jboss.forge.status.service.protocol.PluginValues; import org.jboss.forge.status.service.protocol.PluginsValues; /** @@ -37,12 +36,11 @@ */ public interface ScoresService { - public PluginsValues getPluginsValues(String portalName, - Date date) throws GetScoresException; - public void save(Projects projects, List<PluginConf> pluginsConf, - String portalName) throws ScoresSaveException; - - public PluginValues get(String portalName, String pluginId, Date date) - throws GetScoresException; + String portalName) throws ScoresSaveException; + + public PluginsValues getPluginsValues(String portalName, Date date) + throws GetScoresException; + + public boolean hasPluginsValues(String portalName, Date date); } \ No newline at end of file Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -35,6 +35,7 @@ import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.common.Constants; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; import org.jboss.forge.status.service.protocol.GetScoresRequest; @@ -56,7 +57,7 @@ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", - propertyValue="queue/jmm") + propertyValue=Constants.QUEUE_NAME) }) public class ScoresMDB implements MessageListener { @@ -68,16 +69,17 @@ ObjectMessage message = (ObjectMessage) msg; try { - String requestName = message.getStringProperty("name"); + String requestName = + message.getStringProperty(Constants.NAME_PROPERTY); System.out.println("request name: " + requestName); - if (requestName.equals("save")) { + if (requestName.equals(Constants.SAVE_MESSAGE)) { SaveRequest saveRequest = (SaveRequest) message.getObject(); handleRequest(saveRequest); } - if (requestName.equals("getPluginsValues")) { + if (requestName.equals(Constants.GET_SCORES_MESSAGE)) { GetScoresRequest getScoresRequest = (GetScoresRequest) message.getObject(); Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -43,16 +43,17 @@ import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.common.Constants; +import org.jboss.forge.status.common.Locations; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; import org.jboss.forge.status.service.ScoresService; import org.jboss.forge.status.service.ScoresServiceLocal; import org.jboss.forge.status.service.ScoresServiceRemote; -import org.jboss.forge.status.service.impl.protocol.PluginValuesImpl; import org.jboss.forge.status.service.impl.protocol.PluginsValuesImpl; import org.jboss.forge.status.service.protocol.PluginConf; import org.jboss.forge.status.tools.Plugins; -import org.jboss.forge.status.tools.Tools; import org.jboss.logging.Logger; import org.jboss.shotoku.ContentManager; @@ -66,12 +67,12 @@ * @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) */ -@Service(objectName=Tools.STATUS_SERVICE_NAME) +@Service(objectName=Tags.STATUS_SERVICE_NAME) @Management(ScoresService.class) @Local(ScoresServiceLocal.class) -@LocalBinding(jndiBinding=Tools.STATUS_LOCAL_SERVICE) +@LocalBinding(jndiBinding=Constants.STATUS_LOCAL_SERVICE) @Remote(ScoresServiceRemote.class) -@RemoteBinding(jndiBinding=Tools.STATUS_REMOTE_SERVICE) +@RemoteBinding(jndiBinding=Constants.STATUS_REMOTE_SERVICE) public class ScoresServiceImpl implements ScoresService { private static Logger log = Logger.getLogger(ScoresServiceImpl.class); @@ -99,7 +100,7 @@ // Get directory where we store historical scores Directory rootDir = cm.getRootDirectory(); - String dirName = Tools.getShotokuStatusPath(portalName); + String dirName = Locations.getShotokuStatusPath(portalName); Directory dir = getDir(rootDir, dirName); log.info("Computing scores..."); @@ -181,7 +182,7 @@ Directory dir; try { - dir = rootDir.getDirectory(Tools.getShotokuStatusPath(portalName)); + dir = rootDir.getDirectory(Locations.getShotokuStatusPath(portalName)); } catch (RepositoryException e) { throw new GetScoresException(e); } catch (ResourceDoesNotExist e) { @@ -341,11 +342,16 @@ return getNodeName(today); } - public PluginValuesImpl get(String portalName, String pluginId, Date date) - throws GetScoresException { + public boolean hasPluginsValues(String portalName, Date date) { - PluginsValuesImpl pv = getPluginsValues(portalName, date); - return pv.getPluginValues(pluginId); - } - + PluginsValuesImpl pluginsValues = null; + + try { + pluginsValues = getPluginsValues(portalName, date); + } catch (GetScoresException e) { + return false; + } + + return (pluginsValues != null); + } } Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -27,9 +27,9 @@ import java.util.Properties; import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; import org.jboss.forge.status.service.protocol.PluginConf; -import org.jboss.forge.status.tools.Tags; import org.w3c.dom.Node; /** Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -24,8 +24,8 @@ import java.util.Properties; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.ServiceConf; -import org.jboss.forge.status.tools.Tags; import org.jboss.shotoku.Node; /** Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -26,8 +26,8 @@ import java.util.List; import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.PluginsValues; -import org.jboss.forge.status.tools.Tags; import org.jboss.portal.common.context.DelegateContext; import org.w3c.dom.Node; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -34,11 +34,11 @@ import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; import org.jboss.forge.common.projects.permissions.PermissionsChecker; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.PluginValues; import org.jboss.forge.status.service.protocol.PluginsValues; import org.jboss.forge.status.tools.ProjectsByNameComparator; import org.jboss.forge.status.tools.ProjectsByScoreComparator; -import org.jboss.forge.status.tools.Tags; import org.jboss.portal.common.context.DelegateContext; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -27,8 +27,8 @@ import org.jboss.forge.common.XmlTools; import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.PluginsValues; -import org.jboss.forge.status.tools.Tags; import org.jboss.portal.common.context.DelegateContext; import org.w3c.dom.Node; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -22,9 +22,9 @@ package org.jboss.forge.status.templates; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.PluginValues; import org.jboss.forge.status.service.protocol.PluginsValues; -import org.jboss.forge.status.tools.Tags; import org.jboss.forge.common.XmlTools; import org.jboss.portal.common.context.DelegateContext; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -26,8 +26,8 @@ import java.util.ArrayList; import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.service.protocol.PluginsValues; -import org.jboss.forge.status.tools.Tags; import org.jboss.portal.common.context.DelegateContext; import org.w3c.dom.Node; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -31,6 +31,7 @@ import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.common.Tags; import org.jboss.forge.status.exceptions.InvalidPluginPropertiesException; import org.jboss.forge.status.plugins.Plugin; import org.jboss.forge.status.service.protocol.PluginConf; Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -0,0 +1,183 @@ +/* + * 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.tools; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; +import java.util.Properties; + +import javax.jms.JMSException; +import javax.jms.ObjectMessage; +import javax.jms.Queue; +import javax.jms.QueueConnection; +import javax.jms.QueueConnectionFactory; +import javax.jms.QueueSender; +import javax.jms.QueueSession; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.impl.protocol.GetScoresRequestImpl; +import org.jboss.forge.status.service.impl.protocol.SaveRequestImpl; +import org.jboss.forge.status.service.protocol.GetScoresRequest; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.service.protocol.SaveRequest; +import org.jboss.forge.status.service.protocol.ServiceConf; +import org.jboss.forge.status.common.Constants; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ + +public class ScoresManager { + + private static boolean isRemote; + private static Properties properties; + + public static void init(String portalName, ServiceConf serviceConf) { + + ScoresManagerSync.init(portalName, serviceConf); //TODO inheritance + + isRemote = serviceConf.isRemote(); + System.out.println("remote: " + isRemote); + + properties = serviceConf.getProperties(); + } + + public static void save(Projects projects, List<PluginConf> pluginsConf) + throws ScoresSaveException { + + SaveRequest saveRequest = new SaveRequestImpl(pluginsConf, projects); + //TODO request factory + //conf factory? + + // Send message + try { + sendMessage(Constants.SAVE_MESSAGE, saveRequest); + } catch (Exception e) { + throw new ScoresSaveException(e); + } + } + + public static PluginsValues getScores(Date date, Date toDate) + throws GetScoresException { + //TODO toDate + + Timestamp timestamp = new Timestamp(System.currentTimeMillis()); + + GetScoresRequest getScoresRequest = + new GetScoresRequestImpl(date, toDate, timestamp); + + // Send message + try { + sendMessage(Constants.GET_SCORES_MESSAGE, getScoresRequest); + } catch (Exception e) { + throw new GetScoresException(e); + } + + PluginsValues pluginsValues = null; + int attempts = 0; + + for (;;) { + + pluginsValues = RecordManager.get(timestamp); + + System.out.println("attempt: " + pluginsValues); + + if ((pluginsValues != null) || + ((attempts++) == Constants.MAX_ATTEMPTS)) { + break; + } + + try { + Thread.sleep(Constants.SLEEP_TIME); + } catch (InterruptedException e) { + throw new GetScoresException(e); + } + } + + return pluginsValues; + } + + /** + * For the specified plugin returns historical project score + * from the given <code>date</code> in the past. + * If scores from specified day are not available, + * the next available scores saved at the day before or equal + * to <code>toDate</code> are returned. + * + * Notice that only year, month and day matter in passed dates. + * + * @return project score from the given date for specified plugin + * @throws GetScoresException + */ + public static long getValue(String pluginId, String projectId, + Date date, Date toDate) + throws GetScoresException { + + PluginsValues pluginsValues = getScores(date, toDate); + + return pluginsValues.getPluginValue(pluginId, projectId); + } + + public static PluginsValues getCurrentScores() + throws GetScoresException { + + Date now = new Date(); + + return getScores(now, now); + } + + private static void sendMessage(String name, Serializable request) throws + NamingException, JMSException { + + Queue queue = null; + QueueConnection connection = null; + QueueSession session = null; + QueueSender sender = null; + Context context = new InitialContext(properties); + + queue = (Queue) context.lookup(Constants.QUEUE_NAME); + QueueConnectionFactory factory = + (QueueConnectionFactory) context.lookup("ConnectionFactory"); + connection = factory.createQueueConnection(); + session = connection.createQueueSession(false, + QueueSession.AUTO_ACKNOWLEDGE); + + // Create message + ObjectMessage message = session.createObjectMessage(); + message.setStringProperty("name", name); + message.setObject(request); + + sender = session.createSender(queue); + sender.send(message); + session.close (); + } + +} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -1,185 +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.tools; - -import java.io.Serializable; -import java.sql.Timestamp; -import java.util.Date; -import java.util.List; -import java.util.Properties; - -import javax.jms.JMSException; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueConnection; -import javax.jms.QueueConnectionFactory; -import javax.jms.QueueSender; -import javax.jms.QueueSession; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.status.exceptions.GetScoresException; -import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.impl.protocol.GetScoresRequestImpl; -import org.jboss.forge.status.service.impl.protocol.SaveRequestImpl; -import org.jboss.forge.status.service.protocol.GetScoresRequest; -import org.jboss.forge.status.service.protocol.PluginConf; -import org.jboss.forge.status.service.protocol.PluginsValues; -import org.jboss.forge.status.service.protocol.SaveRequest; -import org.jboss.forge.status.service.protocol.ServiceConf; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -*/ - -public class ScoresManagerAsync { - - private static boolean isRemote; - private static Properties properties; - - public static void init(String portalName, ServiceConf serviceConf) { - - ScoresManagerSync.init(portalName, serviceConf); //TODO inheritance - - isRemote = serviceConf.isRemote(); - System.out.println("remote: " + isRemote); - - properties = serviceConf.getProperties(); - } - - public static void save(Projects projects, List<PluginConf> pluginsConf) - throws ScoresSaveException { - - SaveRequest saveRequest = new SaveRequestImpl(pluginsConf, projects); - //TODO request factory - //conf factory? - - // Send message - try { - sendMessage("save", saveRequest); - } catch (Exception e) { - throw new ScoresSaveException(e); - } - - // TODO poll/wait for results - } - - public static PluginsValues getScores(Date date, Date toDate) - throws GetScoresException { - //TODO toDate - - Timestamp timestamp = new Timestamp(System.currentTimeMillis()); - - GetScoresRequest getScoresRequest = - new GetScoresRequestImpl(date, toDate, timestamp); - - // Send message - try { - sendMessage("getPluginsValues", getScoresRequest); - } catch (Exception e) { - throw new GetScoresException(e); - } - - // poll/wait for results - - PluginsValues pluginsValues = null; - - for (;;) { //TODO when we give up? - - pluginsValues = RecordManager.get(timestamp); - - System.out.println("attempt: " + pluginsValues); - - if (pluginsValues != null) { - break; - } - - try { - Thread.sleep(2000); //TODO const - } catch (InterruptedException e) { - throw new GetScoresException(e); - } - } - - return pluginsValues; - } - - /** - * For the specified plugin returns historical project score - * from the given <code>date</code> in the past. - * If scores from specified day are not available, - * the next available scores saved at the day before or equal - * to <code>toDate</code> are returned. - * - * Notice that only year, month and day matter in passed dates. - * - * @return project score from the given date for specified plugin - * @throws GetScoresException - */ - public static long getValue(String pluginId, String projectId, - Date date, Date toDate) - throws GetScoresException { - - PluginsValues pluginsValues = getScores(date, toDate); - - return pluginsValues.getPluginValue(pluginId, projectId); - } - - public static PluginsValues getCurrentScores() - throws GetScoresException { - - Date now = new Date(); - - return getScores(now, now); - } - - private static void sendMessage(String name, Serializable request) throws - NamingException, JMSException { - - Queue queue = null; - QueueConnection connection = null; - QueueSession session = null; - QueueSender sender = null; - Context context = new InitialContext(properties); - - queue = (Queue) context.lookup("queue/jmm"); //TODO const - QueueConnectionFactory factory = - (QueueConnectionFactory) context.lookup("ConnectionFactory"); - connection = factory.createQueueConnection(); - session = connection.createQueueSession(false, - QueueSession.AUTO_ACKNOWLEDGE); - - // Create message - ObjectMessage message = session.createObjectMessage(); - message.setStringProperty("name", name); - message.setObject(request); - - sender = session.createSender(queue); - sender.send(message); - // sess.commit (); TODO closing vs committing - session.close (); - } - -} Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -32,6 +32,7 @@ import javax.rmi.PortableRemoteObject; import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.common.Constants; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; import org.jboss.forge.status.service.ScoresService; @@ -129,8 +130,8 @@ // Perform look up using JNDI name of ejb object String serviceBinding = - (isRemote ? Tools.STATUS_REMOTE_SERVICE : - Tools.STATUS_LOCAL_SERVICE); + (isRemote ? Constants.STATUS_REMOTE_SERVICE : + Constants.STATUS_LOCAL_SERVICE); Object ref = context.lookup(serviceBinding); // Narrow the reference of the object returned by lookup() method Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tags.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tags.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tags.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -1,85 +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.tools; - -/** -* @author Pawel Wrzeszcz -* Status Matrix xml tags. -*/ -public class Tags { - - /* status.xml file tags */ - - /* main page */ - public static final String MAIN_PAGE_COLUMNS_TAG = "main-page"; - - public final static String COLUMN_ELEMENT = "column"; - public final static String COLUMNS_ELEMENT = "columns"; - public static final String COLUMN_NAME_ELEMENT = "name"; - public static final String COLUMN_PLUGIN_ELEMENT = "plugin"; - - public final static String ORDER_PLUGIN_ELEMENT = "order-plugin"; - - /* project page */ - public static final String PROJECT_PAGE_COLUMNS_TAG = "project-page"; - - public static final String ROWS_ELEMENT = "rows"; - public static final String ROW_ELEMENT = "row"; - public static final String ROW_NAME_ELEMENT = "name"; - - public static final String CELLS_ELEMENT = "cells"; - public static final String CELL_ELEMENT = "cell"; - public static final String CELL_NAME_ELEMENT = "name"; - - public static final String METRICS_ELEMENT = "metrics"; - public static final String METRIC_ELEMENT = "metric"; - public static final String METRIC_NAME_ELEMENT = "name"; - public static final String METRIC_PLUGIN_ELEMENT = "plugin"; - - /* service.xml tags */ - public static final String SERVICE_REMOTE_ELEMENT = "service.remote"; - - /* plugins.xml tags */ - public final static String PLUGIN_ELEMENT = "plugin"; - - public final static String PLUGIN_ID_ELEMENT = "id"; - public final static String PLUGIN_CLASS_ELEMENT = "class"; - public final static String PLUGIN_PROPERTIES_ELEMENT = "properties"; - - /* project.xml files tags */ - public static final String JIRA_SERVICE_PROPERTY = "jira-service"; - public static final String JIRA_ADRESS_TAG = "jira-address"; - public static final String SVN_SERVICE_PROPERTY = "svn-service"; - - public static final String CC_SERVICE_PROPERTY = "cc-service"; - public static final String CC_ADRESS_TAG = "cc-address"; - - public static final String SVN_REPO_ADRESS_TAG = "svn-repo"; - public static final String SVN_USERNAME_TAG = "svn-username"; - public static final String SVN_PASSWD_TAG = "svn-passwd"; - - /** - * This class cannot be instatiated. - */ - private Tags() {}; -} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tools.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tools.java 2006-05-17 17:51:54 UTC (rev 4289) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Tools.java 2006-05-17 20:54:55 UTC (rev 4290) @@ -1,121 +0,0 @@ -package org.jboss.forge.status.tools; - -import java.util.HashSet; -import java.util.Set; - -import org.jboss.forge.common.ForgeHelper; -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.common.projects.ProjectsHelper; -import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; -import org.jboss.forge.common.projects.permissions.PermissionsChecker; -import org.jboss.forge.status.StatusDescriptor; -import org.jboss.forge.status.StatusConfWatcher; - -import org.jboss.shotoku.aop.CacheItem; - -/** - * Common constants and functions. - * @author Pawel Wrzeszcz - */ -public class Tools { - - /** <code>STATUS_XML<code> - file defining the list of watched feeds */ - private final static String STATUS_XML = "status.xml"; - private final static String STATUS_PLUGINS_XML = "plugins.xml"; - private final static String STATUS_SERVICE_PROPERTIES = "service.properties"; - - /** <code>STATUS_DIR</code> - directory in which file <code>STATUS_XML<code> is stored. */ - private final static String STATUS_DIR = "status"; - - private final static String STATUS_JSP = "status.jsp"; - private final static String STATUS_JSP_DIR = "status"; - private final static String PROJECT_DETAILS_JSP = "project_details.jsp"; - private final static String COLUMN_DETAILS_JSP = "column_details.jsp"; - - /** Shotoku directory to store historical scores */ - private static final String SHOTOKU_STATUS_DIR = "status"; - - public static final String STATUS_SERVICE_NAME = "status:service=scores"; - public static final String STATUS_LOCAL_SERVICE = "Status/LocalScoresService"; - public static final String STATUS_REMOTE_SERVICE = "Status/RemoteScoresService"; - - @CacheItem - private static StatusConfWatcher conf; - - public static synchronized StatusDescriptor getDesc(final String portalName) { - return conf.get(portalName); - } - - /** - * Path to the xml file with the Status Matrix properties. - */ - public static String getXmlCmPath(String portalName) { - return portalName + "/" + STATUS_DIR + "/" + STATUS_XML; - } - - /** - * Path to the xml file defining Plugins used in the Matrix. - */ - public static String getXmlStatusPluginsCmPath(String portalName) { - return portalName + "/" + STATUS_DIR + "/" + STATUS_PLUGINS_XML; - } - - /** - * Path to the xml file defining ejb3 service. - */ - public static String getServicePropertiesCmPath(String portalName) { - return portalName + "/" + STATUS_DIR + "/" + STATUS_SERVICE_PROPERTIES; - } - - /** - * Path to the projects.xml file. - */ - public static String getProjectsXmlPath(String portalName) { - return portalName + "/" + ProjectsHelper.PROJECTS_DESC; - } - - /** - * Set containing paths to project.xml files for all projects. - */ - public static Set<String> getProjectXmlPathsSet(String portalName) { - - Set<String> pathsSet = new HashSet<String>(); - - Projects projects = ProjectsHelper.getProjects(portalName); - Set<String> projectIdsSet = projects.getProjectIds( - (PermissionsChecker) new NullPermissionsChecker(), null); - - for (String projectId : projectIdsSet) { - - String projectXmlPath = portalName + "/" + ProjectsHelper.MEMBERS_DIR - + "/" + projectId + "/" + ProjectsHelper.PROJECT_DESC; - pathsSet.add(projectXmlPath); - } - return pathsSet; - } - - /** - * Path to the jsp file responsible file displaying the Status Matrix. - */ - public static String getJspCmPath() { - return STATUS_JSP_DIR + "/" + STATUS_JSP; - } - - /** - * Path to the jsp file responsible for displaying project details. - */ - public static String getPrjDetailsJspCmPath() { - return STATUS_JSP_DIR + "/" + PROJECT_DETAILS_JSP; - } - - /** - * Path to the jsp file responsible displaying column details. - */ - public static String getColumnDetailsJspCmPath() { - return STATUS_JSP_DIR + "/" + COLUMN_DETAILS_JSP; - } - - public static String getShotokuStatusPath(String portalName) { - return ForgeHelper.DYNAMIC_CONTENT_DIR + "/" + SHOTOKU_STATUS_DIR; - } -} |
From: <jbo...@li...> - 2006-05-17 17:52:06
|
Author: adamw Date: 2006-05-17 13:51:54 -0400 (Wed, 17 May 2006) New Revision: 4289 Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Constants.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-36 Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Constants.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Constants.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/Constants.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,56 @@ +package org.jboss.shotoku.feeds; + +/** + * @author Adam Warski (ad...@as...) + */ +public class Constants { + /** + * Node with names ending with this string are parsed and + * feed definitons are read from them. + */ + public final static String NODE_ENDING = "-feeds.xml"; + + /* + * Tag names. + */ + public final static String REM_FEED_TAG = "remote-feed"; + public final static String AGG_FEED_TAG = "aggregated-feed"; + public final static String SHO_FEED_TAG = "shotoku-feed"; + + /* + * Property name, under which content manager id and name of the + * directory which contains the configuration file can be found. + */ + public final static String CONFIGDIR = "shotoku.internal.feeds.configdir"; + public final static String CONFIGID = "shotoku.internal.feeds.configcmid"; + + /* + * Property name suffixes, under which content manager id and name + * of the directory which contains the feed files can be found. + */ + public final static String FEEDDIR = ".xml.directory"; + public final static String FEEDID = ".xml.cmid"; + + /** + * Property name suffix, under which information about available + * variables can be found. + */ + public final static String ALL_VARS = ".variables"; + /** + * Property name middle, under which informatin about a concerete + * variable can be found (should be prepended with an id and followed + * by a property name). + */ + public final static String ONE_VAR = ".variable."; + + /** + * Variable, for which feed type will be substituted. + */ + public final static String TYPE_VARIABLE = "${type}"; + + /* + * Xml node attributes denoting a feed name and display name. + */ + public static final String NAME_ATTR = "name"; + public static final String DISP_NAME_ATTR = "display-name"; +} Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -54,6 +54,10 @@ import org.jboss.shotoku.feeds.variables.VariableResolver; import org.jboss.shotoku.feeds.variables.NullVariableResolver; import org.jboss.shotoku.feeds.variables.Substitution; +import org.jboss.shotoku.feeds.variables.VariableResolverManager; +import org.jboss.shotoku.feeds.tag.FeedDefinition; +import org.jboss.shotoku.feeds.tag.FeedTagHandler; +import org.jboss.shotoku.feeds.tag.FeedTagHandlerManager; import org.jboss.shotoku.tools.Pair; import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.aop.CacheItem; @@ -92,62 +96,9 @@ search.parametrized = directory,history,limit,property-sort,property-value */ - private class FeedDefinition { - FeedDefinition(String group, Node definition) { - this.group = group; - this.definition = definition; - } - - String group; - Node definition; - } - private static final Logger log = Logger.getLogger(FeedsDescriptor.class); - /** - * Node with names ending with this string are parsed and - * feed definitons are read from them. - */ - private final static String NODE_ENDING = "-feeds.xml"; - /* - * Tag names. - */ - private final static String REM_FEED_TAG = "remote-feed"; - private final static String AGG_FEED_TAG = "aggregated-feed"; - private final static String SHO_FEED_TAG = "shotoku-feed"; - - /* - * Property name, under which content manager id and name of the - * directory which contains the configuration file can be found. - */ - private final static String CONFIGDIR = "shotoku.internal.feeds.configdir"; - private final static String CONFIGID = "shotoku.internal.feeds.configcmid"; - - /* - * Property name suffixes, under which content manager id and name - * of the directory which contains the feed files can be found. - */ - private final static String FEEDDIR = ".xml.directory"; - private final static String FEEDID = ".xml.cmid"; - - /** - * Property name suffix, under which information about available - * variables can be found. - */ - private final static String ALL_VARS = ".variables"; - /** - * Property name middle, under which informatin about a concerete - * variable can be found (should be prepended with an id and followed - * by a property name). - */ - private final static String ONE_VAR = ".variable."; - - /** - * Variable, for which feed type will be substituted. - */ - public final static String TYPE_VARIABLE = "${type}"; - @CacheItem private static FeedsCache feedsCache; @@ -169,60 +120,42 @@ */ private Map<String, Set<String>> feedGroups; - /** - * Map variable name -> variable resolver class (read from properties). - */ - private Map<String, Class> varResolvers; + private VariableResolverManager vrm; + private Map<String, FeedTagHandler> feedTagHandlers; + private String baseServerAddress; public FeedsDescriptor(String id, String baseServerAddress) { this.baseServerAddress = baseServerAddress; - Properties props = conf.get(new Pair<String, String>( - ContentManager.getProperty(CONFIGID, ""), - ContentManager.getProperty(CONFIGDIR, "") + + // From the global Shotoku configuration, reading the config file + // location in Shotoku repositories. + Properties props = conf.get(new Pair<String, String>( + ContentManager.getProperty(Constants.CONFIGID, ""), + ContentManager.getProperty(Constants.CONFIGDIR, "") )); + // From properties read from Shotoku, getting the content manager + // configuration for this feeds id. ContentManager cm = ContentManager.getContentManager( - props.getProperty(id + FEEDID), - props.getProperty(id + FEEDDIR) + props.getProperty(id + Constants.FEEDID), + props.getProperty(id + Constants.FEEDDIR) ); - // Creating maps of available variable resolver classes - varResolvers = new HashMap<String, Class>(); - for (String variable : props.getProperty(id + ALL_VARS, "").split("[,]")) { - try { - varResolvers.put(variable, - Class.forName(props.getProperty(id + ONE_VAR + variable))); - } catch (ClassNotFoundException e) { - log.error("Variable resolver class " + props.getProperty(id + - ONE_VAR + variable) + " for variable " + variable + - " not found", e); - } - } + vrm = new VariableResolverManager(id, props); + feedTagHandlers = new HashMap<String, FeedTagHandler>(); // Creating the maps that will hold the feeds. feeds = new HashMap<String, Map<String, Feed>>(); feedGroups = new LinkedHashMap<String, Set<String>>(); - // Preparing maps which will hold feed definitions. - Map<String, FeedDefinition> remoteFeedDefs = new HashMap<String, FeedDefinition>(); - Map<String, FeedDefinition> aggregatedFeedDefs = new HashMap<String, FeedDefinition>(); - Map<String, FeedDefinition> shotokuFeedDefs = new HashMap<String, FeedDefinition>(); - - Map<String, Map<String, FeedDefinition>> allFeedDefs = - new HashMap<String, Map<String, FeedDefinition>>(); - - allFeedDefs.put(REM_FEED_TAG, remoteFeedDefs); - allFeedDefs.put(AGG_FEED_TAG, aggregatedFeedDefs); - allFeedDefs.put(SHO_FEED_TAG, shotokuFeedDefs); - // Looking for file containing feed definitons and filling the maps. for (org.jboss.shotoku.Node feedNode : cm.getRootDirectory().getNodes().toList()) { - if (feedNode.getName().endsWith(NODE_ENDING)) { + if (feedNode.getName().endsWith(Constants.NODE_ENDING)) { try { - addFeedDefinitions(allFeedDefs, feedNode); + addFeedDefinitions(feedNode); } catch (Exception e) { // We just don't add the feeds ... and log a warning. log.warn("Can't add feed definitions from node " + @@ -231,74 +164,44 @@ } } - // Firstly - the remote feeds. - generateRemoteFeeds(remoteFeedDefs); - - // Later, shotoku feeds. - generateShotokuFeeds(shotokuFeedDefs, props); - - // After that, we can create the aggregated feeds. - generateAggregatedFeeds(aggregatedFeedDefs); - } - - /** - * A pattern which matcher variables of the form "${text with numbers}". - */ - private final static Pattern variablesPattern = Pattern.compile( - Pattern.quote("${") + "[a-zA-Z0-9]*" + Pattern.quote("}")); - - /** - * From the given node's attributes, reads all variables (that is, strings - * which match <code>vairablesPattern</code> and adds them to the given - * set. - * @param toFill Set to which found variables should be added. - * @param n Node from which to read the attributes. - */ - private void addVariablesFromNode(Set<String> toFill, Node n) { - NamedNodeMap nnm = n.getAttributes(); - - for (int i=0; i<nnm.getLength(); i++) { - String text = Tools.unmarshallText(nnm.item(i)); - Matcher m = variablesPattern.matcher(text); - - while (m.find()) { - toFill.add(text.substring(m.start(), m.end()+1)); - } + // Generating the feeds. + while (feedTagHandlers.size() > 0) { + // Trying to generate any feed found in the feed tag handler map. + generateFeed(feedTagHandlers.keySet().iterator().next(), + new HashSet<String>()); } } - private VariableResolver instantiateVariableResolver(String variable, Node n) { - Class varResolverClass = varResolvers.get(variable); - if (varResolverClass == null) { - log.error("Unsupported variable found: " + variable + "."); - return new NullVariableResolver(); - } + private void addFeedDefinitions(org.jboss.shotoku.Node node) throws SAXException, IOException { + DOMParser parser = new DOMParser(); + // Parse the descriptor at the given Shotoku node. + parser.parse(new InputSource(node.getContentInputStream())); + // Get the XML document element of the feed descriptor file. + Node root = parser.getDocument().getDocumentElement(); + String group = Tools.getAttributeValue(root, "display-name"); - try { - Constructor c = varResolverClass.getConstructor(Node.class); - try { - return (VariableResolver) c.newInstance(n); - } catch (Exception e) { - log.error("Error instatiating variable resolver " + varResolverClass + ".", e); - } - } catch (NoSuchMethodException e) { - try { - return (VariableResolver) varResolverClass.getConstructor().newInstance(); - } catch (Exception e2) { - log.error("Error instatiating variable resolver " + varResolverClass + ".", e2); - } - } + Set<String> feedGroup = new LinkedHashSet<String>(); + // Each feed descriptor file has one feed group. + // Get the name of the feed group for this file. + feedGroups.put(group, feedGroup); - return new NullVariableResolver(); - } + NodeList nodes = root.getChildNodes(); + // Iterate through the rest of the feed descriptor + // file to load all feeds for a given feed group. + for (int i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + feedTagHandlers.putAll(FeedTagHandlerManager.getHandlers(group, n, vrm)); + } + } + /** * Adds a feed of the given name and type. * @param name * @param type * @param feed */ - private void addFeed(String name, String type, Feed feed) { + public void addFeed(String name, String type, Feed feed) { Map<String, Feed> typesMap = feeds.get(name); if (typesMap == null) { typesMap = new HashMap<String, Feed>(); @@ -308,7 +211,35 @@ typesMap.put(type, feed); } - /** + /** + * Tries to generate a feed with the given name. If the feed is absent, + * or is being already generated (this case indicates a loop in feed + * definitions), no actions are taken. + * @param name Feed to be generated. + * @param duringGeneration Set of feed names that are being generated + * at the moment (not yet added). + * @return True iff generation was successfull. + */ + public boolean generateFeed(String name, Set<String> duringGeneration) { + if (duringGeneration.contains(name)) { + return false; + } + + FeedTagHandler fth = feedTagHandlers.get(name); + if (fth != null) { + feedTagHandlers.remove(name); + + duringGeneration.add(name); + boolean ret = fth.generate(this, duringGeneration); + duringGeneration.remove(name); + + return ret; + } + + return false; + } + + /** * In the given <code>map</code>, in its values, replaces each occurence of * <code>replaceWhat</code> with <code>replaceTo</code>. * @param map @@ -326,326 +257,6 @@ } /** - * Recursively generates a search parameter basing on its description that is - * contained in the given node. - * @param n Node from which to read the search parameters. - * @param props Properties with directives classes. - * @param parametrized Set of directive names that accept a parameter map - * in their constructor. - * @return A search parameter that is described in the given node. - * @throws IllegalArgumentException - * @throws SecurityException - * @throws InstantiationException - * @throws IllegalAccessException - * @throws InvocationTargetException - * @throws NoSuchMethodException - * @throws ClassNotFoundException - */ - private SearchParameter generateSearchParameter(Node n, Properties props, - Set<String> parametrized, String siteId) - throws IllegalArgumentException, SecurityException, - InstantiationException, IllegalAccessException, - InvocationTargetException, NoSuchMethodException, - ClassNotFoundException { - String paramName = n.getNodeName(); - - // Looking for a corresponding class. - String paramClass = props.getProperty(paramName); - - if (paramClass == null) - throw new RuntimeException("Unknown parameter name: " + paramName - + "."); - - SearchParameter param; - if (parametrized.contains(paramName)) { - // Instatiating the class, it should have a constructor accepting a - // map. We take the map from node attributes, and replace - // ${site} and ${site-name} in them. - param = (SearchParameter) Class.forName(paramClass).getConstructor( - new Class[] { Map.class }).newInstance( - new Object[] { replaceInMapValues(replaceInMapValues( - XmlTools.getMapFromNodeAttributes(n), - SITE_PARAM, siteId), SITE_NAME_PARAM, - getSiteName(siteId)) }); - } else { - param = (SearchParameter) Class.forName(paramClass).newInstance(); - } - - NodeList nodeList = n.getChildNodes(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node child = nodeList.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) { - // If the search paramater has child nodes, then the - // corresponding class should have an "add" method. - // Invoking the function recursively and adding the - // resulting parameter. - SearchParameter childParam = generateSearchParameter(child, - props, parametrized, siteId); - - Method[] methods = param.getClass().getMethods(); - for (Method method : methods) { - if ("add".equals(method.getName())) { - method.invoke(param, new Object[] { childParam }); - break; - } - } - } - } - - return param; - } - - private final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z"; - - private void generateShotokuFeeds(Map<String, Node> feedDefs, - Properties props) { - Set<String> parametrized = new HashSet<String>(Arrays.asList(props.getProperty( - "parametrized").split("[,]"))); - - for (String feedName : feedDefs.keySet()) { - Node feedNode = feedDefs.get(feedName); - String templateAttr = XmlTools.getAttributeValue(feedNode, - "template"); - String prefixAttr = XmlTools.getAttributeValue(feedNode, "prefix"); - String idAttr = XmlTools.getAttributeValue(feedNode, "id"); - String typesAttr = XmlTools.getAttributeValue(feedNode, "type"); - String displayNameAttr = XmlTools.getAttributeValue(feedNode, - "display-name"); - - ContentManager cm = ContentManager.getContentManager(idAttr, - prefixAttr); - - // Generating the type of feeds that have been requested. - String[] types = getTypes(typesAttr); - - // Generating the sites for which the feeds have been requested, - // if any. - String[] siteIds = getSiteIds(); - - Map<String, String> attributes = XmlTools - .getMapFromNodeAttributes(feedNode); - - // Creating a velcoity context with parts that won't change in all - // generated feeds. - VelocityContext vc = new VelocityContext(attributes); - - String dateFormat = attributes.get("dateFormat"); - vc.put("dateFormat", new SimpleDateFormat( - dateFormat == null ? "MM/dd/yy" : dateFormat)); - vc.put("rssDateFormat", new SimpleDateFormat(RFC_822_DATE)); - vc.put("rdfDateFormat", new RdfDateFormat()); - vc.put("now", Calendar.getInstance().getTime()); - vc.put("baseServerAddress", baseServerAddress); - vc.put("escape", new TextEscaping()); - - for (String site : siteIds) { - String feedNameReplaced = feedName.replace(SITE_PARAM, - site); - - NodeList feedNodeChildren = feedNode.getChildNodes(); - for (int i = 0; i < feedNodeChildren.getLength(); i++) { - // For each search node, generating and performing the - // search, placing it under the demanded attribute in - // velocity's context. - Node searchNode = feedNodeChildren.item(i); - if ("search".equals(searchNode.getNodeName())) { - try { - Search search = (Search) generateSearchParameter( - searchNode, props, parametrized, site); - - org.jboss.shotoku.NodeList list = cm.search(search); - - String searchNameAttr = XmlTools.getAttributeValue( - searchNode, "name"); - if (searchNameAttr == null) - searchNameAttr = "nodes"; - - vc.put(searchNameAttr, list); - } catch (Exception e) { - log.warn("Error generating shotoku feed " - + feedName + ".", e); - continue; - } - } - } - - for (String type : types) { - String template = templateAttr.replace(TYPE_PARAM, type); - - Feed newFeed = FeedFactory.getNewFeed(type); - try { - vc.put("link", generateFeedLink(true, feedNameReplaced, - type)); - - // Now that we have type and site, we can render the - // template. - Writer w = newFeed.getWriter(); - cm.getVelocityEngine().mergeTemplate(template, vc, w); - w.flush(); - w.close(); - - // And add the feed. - addFeed(feedNameReplaced, type, newFeed); - } catch (Exception e) { - log.warn("Cannot merge template " + template + " for " - + feedName + ".", e); - continue; - } - } - } - } - } - - private void generateRemoteFeeds(Map<String, FeedDefinition> feedDefs) { - for (String feedName : feedDefs.keySet()) { - FeedDefinition feedDefinition = feedDefs.get(feedName); - Node feedNode = feedDefinition.definition; - - String addressAttr = XmlTools.getAttributeValue(feedNode, "address"); - String displayNameAttr = XmlTools.getAttributeValue(feedNode, "display-name"); - - Set<String> variables = new HashSet<String>(); - // We always have to substitute the type variable. - variables.add(TYPE_VARIABLE); - addVariablesFromNode(variables, feedNode); - - Set<Substitution> substitutions = Substitution.newEmptySubstitionsSet(); - - for (String variable : new HashSet<String>(variables)) { - instantiateVariableResolver(variable, feedNode). - expandSubstitutionsSet(variables, substitutions); - } - - if (variables.size() > 0) { - log.warn("Unresolved variables left: " + variables.toString() + " in feed " + - feedName + "."); - continue; - } - - for (Substitution s : substitutions) { - String feedNameSub = s.make(feedName); - String feedType = s.getSubstitutionFor(TYPE_VARIABLE); - try { - Feed feed = FeedFactory.getNewFeed(feedNameSub, - s.make(displayNameAttr), feedType); - feed.generate(new URL(s.make(addressAttr))); - addFeed(feedNameSub, feedType, feed); - } catch (Exception e) { - log.debug("Can't add feed " + s.make(addressAttr) + " : " + feedType - + ".", e); - } - } - } - } - - private void generateAggregatedFeeds(Map<String, Node> feedDefs) { - // First building requirements of each feed - that is, whit which - // feeds each aggregated feed is built. - Map<String, Set<String>> requirements = - new HashMap<String, Set<String>>(); - Map<String, String[]> parameters = new HashMap<String, String[]>(); - - // Gathering information about defined feeds, their requirements - // (that is, from which other feeds they are composed) and their - // parameters. - for (String feedName : feedDefs.keySet()) { - Node n; - Node feedNode = feedDefs.get(feedName); - NodeList nodes = feedNode.getChildNodes(); - - Set<String> feedRequirements = new HashSet<String>(); - requirements.put(feedName, feedRequirements); - parameters.put(feedName, new String[] { - XmlTools.getAttributeValue(feedNode, "title"), - XmlTools.getAttributeValue(feedNode, "description"), - XmlTools.getAttributeValue(feedNode, "author") }); - feedDisplayNames.put(feedName, XmlTools.getAttributeValue(feedNode, - "display-name")); - - for (int i = 0; i < nodes.getLength(); i++) { - n = nodes.item(i); - if ("include".equals(n.getNodeName())) { - String nameAttr = XmlTools.getAttributeValue(n, "name"); - - String[] siteIds = getSiteIds(); - - for (String siteId : siteIds) { - feedRequirements.add(nameAttr.replace(SITE_PARAM, - siteId)); - } - } - } - } - - while (requirements.size() > 0) { - int sizeBefore = requirements.size(); - - for (Iterator<String> iter = requirements.keySet().iterator(); iter - .hasNext();) { - String feedName = iter.next(); - Set<String> feedRequirements = requirements.get(feedName); - String[] feedParameters = parameters.get(feedName); - Set<String> types = null; - - // Checking if the all of this feed's requirements are met - // and if so, of what types it can consist. - boolean allRequirementsMet = true; - for (String requirement : feedRequirements) { - Map<String, Feed> feedTypes = feeds.get(requirement); - - if (feedTypes == null) { - // Missing feed - cannot create the aggregated one. - allRequirementsMet = false; - break; - } - - // Intersecting the types set with the types of the current - // feed. - if (types == null) { - types = new HashSet<String>(); - types.addAll(feedTypes.keySet()); - } else - types.retainAll(feedTypes.keySet()); - } - - if (!allRequirementsMet) - continue; - - // Gathering the feed parts from which the new feed will be - // composed. - for (String type : types) { - List<Feed> requiredFeeds = new ArrayList<Feed>(); - for (String requirement : feedRequirements) { - requiredFeeds.add(feeds.get(requirement).get(type)); - } - - Feed newFeed = FeedFactory.getNewFeed(type); - try { - newFeed.generate(requiredFeeds.toArray(new Feed[0]), - feedParameters[0], feedParameters[1], - feedParameters[2], generateFeedLink(true, - feedName, type)); - } catch (Exception e) { - log.warn("Can't add aggregated feed " + feedName - + " : " + type + ".", e); - } - - addFeed(feedName, type, newFeed); - } - - iter.remove(); - } - - if (sizeBefore == requirements.size()) { - log.warn("Aggregation feed definitions cycle, or demanded " - + "feeds are not defined; unable to create feeds."); - return; - } - } - } - - /** * Generates a link to a specified feed. If the link is to be full, an * absolute address is returned. Otherwise, a relative one. * @param full @@ -660,6 +271,27 @@ } /** + * Gets a feed of the given type and name. + * @param name Name of the feed to get. + * @param type Type of the feed to get. + * @return Feed with the given name and type. + */ + public Feed getFeed(String name, String type) { + Map<String, Feed> feedTypes = feeds.get(name); + if (feedTypes == null) + return null; + + return feedTypes.get(type); + } + + /** + * Releases all feeds - deletes temporary files which contain them. + */ + public void release() { + + } + + /** * Fills the <code>context</code> variable with feed information that is * to be shown in the portlet. */ @@ -701,61 +333,4 @@ } } - /** - * Adds definitions of feeds to the given map, placing child nodes of - * the given node in the appropriate map. - * @param feedDefinitions A map into which feeds will be added. - * @param node The node of the feeds descriptor file. - * @throws SAXException - * @throws IOException - */ - private void addFeedDefinitions(Map<String, Map<String, FeedDefinition>> feedDefinitions, - org.jboss.shotoku.Node node) throws SAXException, IOException { - DOMParser parser = new DOMParser(); - // Parse the descriptor at the given Shotoku node. - parser.parse(new InputSource(node.getContentInputStream())); - // Get the XML document element of the feed descriptor file. - Node root = parser.getDocument().getDocumentElement(); - String groupName = XmlTools.getAttributeValue(root, "display-name"); - - Set<String> feedGroup = new LinkedHashSet<String>(); - // Each feed descriptor file has one feed group. - // Get the name of the feed group for this file. - feedGroups.put(groupName, feedGroup); - - NodeList nodes = root.getChildNodes(); - - // Iterate through the rest of the feed descriptor - // file to load all feeds for a given feed group. - for (int i = 0; i < nodes.getLength(); i++) { - Node n = nodes.item(i); - if (feedDefinitions.get(n.getNodeName()) != null) { - // Get the name of the feed. - String feedName = XmlTools.getAttributeValue(n, "name"); - feedDefinitions.get(n.getNodeName()).put(feedName, - new FeedDefinition(groupName, n)); - } - } - } - - /** - * Gets a feed of the given type and name. - * @param name - * @param type - * @return - */ - public Feed getFeed(String name, String type) { - Map<String, Feed> feedTypes = feeds.get(name); - if (feedTypes == null) - return null; - - return feedTypes.get(type); - } - - /** - * Releases all feeds - deletes temporary files which contain them. - */ - public void release() { - - } } Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,123 @@ +package org.jboss.shotoku.feeds.tag; + +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.jboss.shotoku.feeds.data.Feed; +import org.jboss.shotoku.feeds.FeedFactory; + +import java.util.*; + +/** + * @author Adam Warski (ad...@as...) + */ +public class AggregatedFeedTagHandler extends FeedTagHandler { + public AggregatedFeedTagHandler(String group, Node definition) { + super(group, definition); + } + + private void generateAggregatedFeeds(Map<String, Node> feedDefs) { + // First building requirements of each feed - that is, whit which + // feeds each aggregated feed is built. + Map<String, Set<String>> requirements = + new HashMap<String, Set<String>>(); + Map<String, String[]> parameters = new HashMap<String, String[]>(); + + // Gathering information about defined feeds, their requirements + // (that is, from which other feeds they are composed) and their + // parameters. + for (String feedName : feedDefs.keySet()) { + Node n; + Node feedNode = feedDefs.get(feedName); + NodeList nodes = feedNode.getChildNodes(); + + Set<String> feedRequirements = new HashSet<String>(); + requirements.put(feedName, feedRequirements); + parameters.put(feedName, new String[] { + XmlTools.getAttributeValue(feedNode, "title"), + XmlTools.getAttributeValue(feedNode, "description"), + XmlTools.getAttributeValue(feedNode, "author") }); + feedDisplayNames.put(feedName, XmlTools.getAttributeValue(feedNode, + "display-name")); + + for (int i = 0; i < nodes.getLength(); i++) { + n = nodes.item(i); + if ("include".equals(n.getNodeName())) { + String nameAttr = XmlTools.getAttributeValue(n, "name"); + + String[] siteIds = getSiteIds(); + + for (String siteId : siteIds) { + feedRequirements.add(nameAttr.replace(SITE_PARAM, + siteId)); + } + } + } + } + + while (requirements.size() > 0) { + int sizeBefore = requirements.size(); + + for (Iterator<String> iter = requirements.keySet().iterator(); iter + .hasNext();) { + String feedName = iter.next(); + Set<String> feedRequirements = requirements.get(feedName); + String[] feedParameters = parameters.get(feedName); + Set<String> types = null; + + // Checking if the all of this feed's requirements are met + // and if so, of what types it can consist. + boolean allRequirementsMet = true; + for (String requirement : feedRequirements) { + Map<String, Feed> feedTypes = feeds.get(requirement); + + if (feedTypes == null) { + // Missing feed - cannot create the aggregated one. + allRequirementsMet = false; + break; + } + + // Intersecting the types set with the types of the current + // feed. + if (types == null) { + types = new HashSet<String>(); + types.addAll(feedTypes.keySet()); + } else + types.retainAll(feedTypes.keySet()); + } + + if (!allRequirementsMet) + continue; + + // Gathering the feed parts from which the new feed will be + // composed. + for (String type : types) { + List<Feed> requiredFeeds = new ArrayList<Feed>(); + for (String requirement : feedRequirements) { + requiredFeeds.add(feeds.get(requirement).get(type)); + } + + Feed newFeed = FeedFactory.getNewFeed(type); + try { + newFeed.generate(requiredFeeds.toArray(new Feed[0]), + feedParameters[0], feedParameters[1], + feedParameters[2], generateFeedLink(true, + feedName, type)); + } catch (Exception e) { + log.warn("Can't add aggregated feed " + feedName + + " : " + type + ".", e); + } + + addFeed(feedName, type, newFeed); + } + + iter.remove(); + } + + if (sizeBefore == requirements.size()) { + log.warn("Aggregation feed definitions cycle, or demanded " + + "feeds are not defined; unable to create feeds."); + return; + } + } + } +} Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,54 @@ +package org.jboss.shotoku.feeds.tag; + +import org.w3c.dom.Node; +import org.w3c.dom.NamedNodeMap; +import org.jboss.shotoku.tools.Tools; +import org.jboss.shotoku.feeds.variables.Substitution; +import org.jboss.shotoku.feeds.data.Feed; +import org.jboss.shotoku.feeds.FeedFactory; +import org.jboss.shotoku.feeds.FeedsDescriptor; + +import java.util.Map; +import java.util.Set; +import java.util.HashSet; +import java.util.regex.Pattern; +import java.util.regex.Matcher; +import java.net.URL; + +/** + * @author Adam Warski (ad...@as...) + */ +public abstract class FeedTagHandler { + private String group; + private Node definition; + private Substitution s; + + public FeedTagHandler(String group, Node definition, Substitution s) { + this.group = group; + this.definition = definition; + this.s = s; + } + + public String getGroup() { + return group; + } + + public Node getDefinition() { + return definition; + } + + public Substitution getSubstitution() { + return s; + } + + /** + * Generates a feed handled by this instance. The generated feed should + * be added to the FeedsDescriptor by calling the FeedsDescriptor.addFeed() + * method. + * @param fd + * @param duringGeneration A set of feed names that are being generated + * at the moment. + * @return True iff the generation was successfull and the feed was added. + */ + public abstract boolean generate(FeedsDescriptor fd, Set<String> duringGeneration); +} Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,127 @@ +package org.jboss.shotoku.feeds.tag; + +import org.jboss.shotoku.tools.Tools; +import org.jboss.shotoku.feeds.Constants; +import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.jboss.shotoku.feeds.variables.VariableResolverManager; +import org.jboss.shotoku.feeds.variables.Substitution; +import org.jboss.logging.Logger; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +import java.util.Set; +import java.util.HashSet; +import java.util.HashMap; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +/** + * @author Adam Warski (ad...@as...) + */ +public class FeedTagHandlerManager { + private static final Logger log = Logger.getLogger(FeedTagHandlerManager.class); + + /** + * Tag name -> tag handler constructor. + */ + private static Map<String, Constructor> handlers; + + private static void addHandler(String tagName, Class handlerClass) { + try { + handlers.put(tagName, handlerClass.getConstructor(String.class, Node.class, + Substitution.class)); + } catch (NoSuchMethodException e) { + log.error("No (String, Node) constructor found in tag " + tagName + " handler " + + handlerClass + "."); + } + } + + static { + addHandler(Constants.AGG_FEED_TAG, AggregatedFeedTagHandler.class); + addHandler(Constants.REM_FEED_TAG, RemoteFeedTagHandler.class); + addHandler(Constants.SHO_FEED_TAG, ShotokuFeedTagHandler.class); + } + + /** + * A pattern which matcher variables of the form "${text with numbers}". + */ + private final static Pattern variablesPattern = Pattern.compile( + Pattern.quote("${") + "[a-zA-Z0-9]*" + Pattern.quote("}")); + + /** + * From the given node's attributes, reads all variables (that is, strings + * which match <code>vairablesPattern</code> and adds them to the given + * set. + * @param toFill Set to which found variables should be added. + * @param n Node from which to read the attributes. + */ + private static void addVariablesFromNode(Set<String> toFill, Node n) { + NamedNodeMap nnm = n.getAttributes(); + + for (int i=0; i<nnm.getLength(); i++) { + String text = Tools.unmarshallText(nnm.item(i)); + Matcher m = variablesPattern.matcher(text); + + while (m.find()) { + toFill.add(text.substring(m.start(), m.end()+1)); + } + } + } + + protected static Set<String> getVariablesForNode(Node n) { + Set<String> variables = new HashSet<String>(); + // We always have to substitute the type variable. + variables.add(Constants.TYPE_VARIABLE); + addVariablesFromNode(variables, n); + + return variables; + } + + public static Map<String, FeedTagHandler> getHandlers(String group, Node definition, + VariableResolverManager vrm) { + // Getting an appropriate construtor to the given feed tag type. + Constructor handlerConstr = handlers.get(definition.getNodeName()); + if (handlerConstr == null) { + log.error("Unknown feed tag: " + definition.getNodeName() + "."); + return new HashMap<String, FeedTagHandler>(); + } + + // Reading the feed name attribute. + String feedNameAttr = Tools.getAttributeValue(definition, Constants.NAME_ATTR); + + // Getting all variables that are in the given node. + Set<String> variables = getVariablesForNode(definition); + + // Generating substitutions induced by the found variables. + Set<Substitution> substitutions = Substitution.newEmptySubstitionsSet(); + + for (String variable : new HashSet<String>(variables)) { + vrm.instantiateVariableResolver(variable, definition). + expandSubstitutionsSet(variables, substitutions); + } + + if (variables.size() > 0) { + log.warn("Unresolved variables left: " + variables.toString() + " in feed " + + feedNameAttr + "."); + } + + // Creating the map which will be returned. + Map<String, FeedTagHandler> ret = new HashMap<String, FeedTagHandler>(); + + // For each substitution, adding a tag handler to FeedsDescriptor. + for (Substitution s : substitutions) { + String feedName = s.make(feedNameAttr); + try { + ret.put(feedName, + (FeedTagHandler) handlerConstr.newInstance(group, definition, s)); + } catch (Exception e) { + log.error("Error constructing feed " + feedName + " tag handler.", e); + } + } + + return ret; + } +} Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,60 @@ +package org.jboss.shotoku.feeds.tag; + +import org.w3c.dom.Node; +import org.jboss.shotoku.tools.Tools; +import org.jboss.shotoku.feeds.variables.Substitution; +import org.jboss.shotoku.feeds.data.Feed; +import org.jboss.shotoku.feeds.FeedFactory; +import org.jboss.shotoku.feeds.Constants; + +import java.util.Map; +import java.util.Set; +import java.util.HashSet; +import java.net.URL; + +/** + * @author Adam Warski (ad...@as...) + */ +public class RemoteFeedTagHandler extends FeedTagHandler { + public void generate(Map<String, FeedDefinition> feedDefs) { + for (String feedName : feedDefs.keySet()) { + FeedDefinition feedDefinition = feedDefs.get(feedName); + Node feedNode = feedDefinition.definition; + + String addressAttr = Tools.getAttributeValue(feedNode, "address"); + String displayNameAttr = Tools.getAttributeValue(feedNode, "display-name"); + + Set<String> variables = new HashSet<String>(); + // We always have to substitute the type variable. + variables.add(Constants.TYPE_VARIABLE); + addVariablesFromNode(variables, feedNode); + + Set<Substitution> substitutions = Substitution.newEmptySubstitionsSet(); + + for (String variable : new HashSet<String>(variables)) { + instantiateVariableResolver(variable, feedNode). + expandSubstitutionsSet(variables, substitutions); + } + + if (variables.size() > 0) { + log.warn("Unresolved variables left: " + variables.toString() + " in feed " + + feedName + "."); + continue; + } + + for (Substitution s : substitutions) { + String feedNameSub = s.make(feedName); + String feedType = s.getSubstitutionFor(Constants.TYPE_VARIABLE); + try { + Feed feed = FeedFactory.getNewFeed(feedNameSub, + s.make(displayNameAttr), feedType); + feed.generate(new URL(s.make(addressAttr))); + addFeed(feedNameSub, feedType, feed); + } catch (Exception e) { + log.debug("Can't add feed " + s.make(addressAttr) + " : " + feedType + + ".", e); + } + } + } + } +} Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,201 @@ +package org.jboss.shotoku.feeds.tag; + +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.jboss.shotoku.search.SearchParameter; +import org.jboss.shotoku.search.Search; +import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.feeds.tools.RdfDateFormat; +import org.jboss.shotoku.feeds.tools.TextEscaping; +import org.jboss.shotoku.feeds.data.Feed; +import org.jboss.shotoku.feeds.FeedFactory; +import org.apache.velocity.VelocityContext; + +import java.util.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.text.SimpleDateFormat; +import java.io.Writer; + +/** + * @author Adam Warski (ad...@as...) + */ +public class ShotokuFeedTagHandler extends FeedTagHandler { + public ShotokuFeedTagHandler(String group, Node definition) { + super(group, definition); + } + + + /** + * Recursively generates a search parameter basing on its description that is + * contained in the given node. + * @param n Node from which to read the search parameters. + * @param props Properties with directives classes. + * @param parametrized Set of directive names that accept a parameter map + * in their constructor. + * @return A search parameter that is described in the given node. + * @throws IllegalArgumentException + * @throws SecurityException + * @throws InstantiationException + * @throws IllegalAccessException + * @throws java.lang.reflect.InvocationTargetException + * @throws NoSuchMethodException + * @throws ClassNotFoundException + */ + private SearchParameter generateSearchParameter(Node n, Properties props, + Set<String> parametrized, String siteId) + throws IllegalArgumentException, SecurityException, + InstantiationException, IllegalAccessException, + InvocationTargetException, NoSuchMethodException, + ClassNotFoundException { + String paramName = n.getNodeName(); + + // Looking for a corresponding class. + String paramClass = props.getProperty(paramName); + + if (paramClass == null) + throw new RuntimeException("Unknown parameter name: " + paramName + + "."); + + SearchParameter param; + if (parametrized.contains(paramName)) { + // Instatiating the class, it should have a constructor accepting a + // map. We take the map from node attributes, and replace + // ${site} and ${site-name} in them. + param = (SearchParameter) Class.forName(paramClass).getConstructor( + new Class[] { Map.class }).newInstance( + new Object[] { replaceInMapValues(replaceInMapValues( + XmlTools.getMapFromNodeAttributes(n), + SITE_PARAM, siteId), SITE_NAME_PARAM, + getSiteName(siteId)) }); + } else { + param = (SearchParameter) Class.forName(paramClass).newInstance(); + } + + NodeList nodeList = n.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + Node child = nodeList.item(i); + + if (child.getNodeType() == Node.ELEMENT_NODE) { + // If the search paramater has child nodes, then the + // corresponding class should have an "add" method. + // Invoking the function recursively and adding the + // resulting parameter. + SearchParameter childParam = generateSearchParameter(child, + props, parametrized, siteId); + + Method[] methods = param.getClass().getMethods(); + for (Method method : methods) { + if ("add".equals(method.getName())) { + method.invoke(param, new Object[] { childParam }); + break; + } + } + } + } + + return param; + } + + private final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z"; + + private void generateShotokuFeeds(Map<String, Node> feedDefs, + Properties props) { + Set<String> parametrized = new HashSet<String>(Arrays.asList(props.getProperty( + "parametrized").split("[,]"))); + + for (String feedName : feedDefs.keySet()) { + Node feedNode = feedDefs.get(feedName); + String templateAttr = XmlTools.getAttributeValue(feedNode, + "template"); + String prefixAttr = XmlTools.getAttributeValue(feedNode, "prefix"); + String idAttr = XmlTools.getAttributeValue(feedNode, "id"); + String typesAttr = XmlTools.getAttributeValue(feedNode, "type"); + String displayNameAttr = XmlTools.getAttributeValue(feedNode, + "display-name"); + + ContentManager cm = ContentManager.getContentManager(idAttr, + prefixAttr); + + // Generating the type of feeds that have been requested. + String[] types = getTypes(typesAttr); + + // Generating the sites for which the feeds have been requested, + // if any. + String[] siteIds = getSiteIds(); + + Map<String, String> attributes = XmlTools + .getMapFromNodeAttributes(feedNode); + + // Creating a velcoity context with parts that won't change in all + // generated feeds. + VelocityContext vc = new VelocityContext(attributes); + + String dateFormat = attributes.get("dateFormat"); + vc.put("dateFormat", new SimpleDateFormat( + dateFormat == null ? "MM/dd/yy" : dateFormat)); + vc.put("rssDateFormat", new SimpleDateFormat(RFC_822_DATE)); + vc.put("rdfDateFormat", new RdfDateFormat()); + vc.put("now", Calendar.getInstance().getTime()); + vc.put("baseServerAddress", baseServerAddress); + vc.put("escape", new TextEscaping()); + + for (String site : siteIds) { + String feedNameReplaced = feedName.replace(SITE_PARAM, + site); + + NodeList feedNodeChildren = feedNode.getChildNodes(); + for (int i = 0; i < feedNodeChildren.getLength(); i++) { + // For each search node, generating and performing the + // search, placing it under the demanded attribute in + // velocity's context. + Node searchNode = feedNodeChildren.item(i); + if ("search".equals(searchNode.getNodeName())) { + try { + Search search = (Search) generateSearchParameter( + searchNode, props, parametrized, site); + + org.jboss.shotoku.NodeList list = cm.search(search); + + String searchNameAttr = XmlTools.getAttributeValue( + searchNode, "name"); + if (searchNameAttr == null) + searchNameAttr = "nodes"; + + vc.put(searchNameAttr, list); + } catch (Exception e) { + log.warn("Error generating shotoku feed " + + feedName + ".", e); + continue; + } + } + } + + for (String type : types) { + String template = templateAttr.replace(TYPE_PARAM, type); + + Feed newFeed = FeedFactory.getNewFeed(type); + try { + vc.put("link", generateFeedLink(true, feedNameReplaced, + type)); + + // Now that we have type and site, we can render the + // template. + Writer w = newFeed.getWriter(); + cm.getVelocityEngine().mergeTemplate(template, vc, w); + w.flush(); + w.close(); + + // And add the feed. + addFeed(feedNameReplaced, type, newFeed); + } catch (Exception e) { + log.warn("Cannot merge template " + template + " for " + + feedName + ".", e); + continue; + } + } + } + } + } + +} Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -0,0 +1,79 @@ +package org.jboss.shotoku.feeds.variables; + +import org.w3c.dom.Node; +import org.jboss.shotoku.feeds.Constants; +import org.jboss.logging.Logger; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.lang.reflect.Constructor; + +/** + * @author Adam Warski (ad...@as...) + */ +public class VariableResolverManager { + private static final Logger log = Logger.getLogger(VariableResolverManager.class); + + private Map<String, Constructor> varResolversNodeConstructor; + private Map<String, Constructor> varResolversEmptyConstructor; + + public VariableResolverManager(String id, Properties props) { + // Creating maps of available variable resolver classes + varResolversNodeConstructor = new HashMap<String, Constructor>(); + varResolversEmptyConstructor = new HashMap<String, Constructor>(); + + for (String variable : props.getProperty(id + Constants.ALL_VARS, "").split("[,]")) { + Class varResolverClass; + + try { + varResolverClass = Class.forName(props.getProperty(id + Constants.ONE_VAR + variable)); + } catch (ClassNotFoundException e) { + log.error("Variable resolver class " + props.getProperty(id + + Constants.ONE_VAR + variable) + " for variable " + variable + + " not found", e); + continue; + } + + try { + varResolversNodeConstructor.put(variable, varResolverClass.getConstructor(Node.class)); + } catch (NoSuchMethodException e) { + try { + varResolversEmptyConstructor.put(variable, varResolverClass.getConstructor()); + } catch (NoSuchMethodException e1) { + log.error("No (org.w3c.dom.Node) or () constructor foound for variable " + + props.getProperty(id + Constants.ONE_VAR + variable) + " resolver " + + varResolverClass.getName() + ".", e); + } + } + } + } + + public VariableResolver instantiateVariableResolver(String variable, Node n) { + Constructor c; + c = varResolversNodeConstructor.get(variable); + + if (c != null) { + try { + return (VariableResolver) c.newInstance(n); + } catch (Exception e) { + log.error("Error instatiating variable resolver " + c.getDeclaringClass().getName() + + ".", e); + } + } + + c = varResolversEmptyConstructor.get(variable); + + if (c != null) { + try { + return (VariableResolver) c.newInstance(); + } catch (Exception e) { + log.error("Error instatiating variable resolver " + c.getDeclaringClass().getName() + + ".", e); + } + } + + log.error("Unsupported variable found: " + variable + "."); + return new NullVariableResolver(); + } +} Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java 2006-05-17 17:09:34 UTC (rev 4288) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java 2006-05-17 17:51:54 UTC (rev 4289) @@ -4,6 +4,7 @@ import org.jboss.shotoku.tools.Tools; import org.jboss.shotoku.feeds.FeedFactory; import org.jboss.shotoku.feeds.FeedsDescriptor; +import org.jboss.shotoku.feeds.Constants; import java.util.Set; @@ -29,7 +30,7 @@ } protected String getVarName() { - return FeedsDescriptor.TYPE_VARIABLE; + return Constants.TYPE_VARIABLE; } protected String[] getValues() { |
From: <jbo...@li...> - 2006-05-17 17:09:40
|
Author: jfr...@jb... Date: 2006-05-17 13:09:34 -0400 (Wed, 17 May 2006) New Revision: 4288 Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh Log: Build on dev13 (Solaris 10 i386 with Sun Studio). Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 17:06:06 UTC (rev 4287) +++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 17:09:34 UTC (rev 4288) @@ -21,6 +21,9 @@ OSSLVER="0.9.8b" OSSLURL=http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz +LPNGVER="1.2.10" +LPNGURL=http://kent.dl.sourceforge.net/sourceforge/libpng/libpng-${LPNGVER}.tar.gz + # Platfrom directory and cache TOOLS=$HOME/`uname -s`_`uname -p`_tools CACHE=`uname -s`_`uname -p`_cache @@ -29,6 +32,7 @@ BUILDXML2=false BUILDPSQL=false BUILDOSSL=false +BUILDLPNG=false CC=gcc COMPILER="" @@ -43,13 +47,14 @@ BASE=$1 URL=$2 VER=$3 -if [ ! -f ${BASE}-${VER}.tar.gz ] +FILE=`basename $URL` +if [ ! -f ${FILE} ] then wget ${URL} fi if [ ! -d ${BASE}-${VER} ] then - gzip -dc ${BASE}-${VER}.tar.gz | tar xvf - + gzip -dc ${FILE} | tar xvf - # Check if patches available. if [ -f patch/${BASE}-${VER}.patch ] then @@ -114,7 +119,6 @@ # Solaris dynamic ld exports the symbols so build shared extensions. EXTTYPE=shared ADDCONF="\ - --enable-all=$EXTTYPE \ --with-libxml-dir=$TOOLS/LIBXML2 \ --with-libexpat-dir=/usr/local \ --with-curl=no \ @@ -158,6 +162,9 @@ --with-tidy=no \ --with-curl \ --with-openssl \ + --with-mysqli \ + --with-mysql \ + --with-pdo-mysql \ " ADDFLAGS="-fPIC" ;; @@ -203,6 +210,9 @@ --with-t1lib=no \ --with-curl \ --with-openssl \ + --with-mysqli \ + --with-mysql \ + --with-pdo-mysql \ " ADDFLAGS="-I $JAVA_HOME/include/linux" ;; @@ -210,14 +220,15 @@ BUILDXML2=true BUILDPSQL=true BUILDOSSL=true + BUILDLPNG=true CC=cc export CC COMPILER=solaris-x86-cc ADDCONF="\ --with-libxml-dir=$TOOLS/LIBXML2 \ --with-jpeg-dir \ - --with-png-dir \ - --with-freetype-dir \ + --with-png-dir=$TOOLS/LPNG \ + --with-freetype-dir=/usr/sfw \ --with-t1lib \ \ --with-xpm-dir=no \ @@ -227,6 +238,8 @@ --with-openssl=shared,$TOOLS/SSL \ --with-openssl-dir=$TOOLS/SSL \ --with-curl=no \ + --with-imap=no \ + --with-pspell=no \ " ;; *) @@ -236,11 +249,24 @@ --with-png-dir \ --with-freetype-dir \ --with-t1lib \ + --with-xpm-dir \ + --with-mysqli \ + --with-mysql \ + --with-pdo-mysql \ " ;; esac # +# build lib png if required +if ${BUILDLPNG} +then + Extract libpng ${LPNGURL} ${LPNGVER} + Build libpng-${LPNGVER} ${TOOLS}/LPNG "" +fi + + +# # build libxml2 if required if ${BUILDXML2} then @@ -308,7 +334,6 @@ --with-gd \ --with-zlib-dir \ --enable-gd-native-ttf \ - --with-xpm-dir \ --with-ttf \ --with-bz2 \ --enable-bcmath \ @@ -321,9 +346,6 @@ --with-gettext \ --with-ldap \ --enable-mbstring \ - --with-mysqli \ - --with-mysql \ - --with-pdo-mysql \ --enable-shmop \ --enable-soap \ --enable-sockets \ @@ -333,6 +355,7 @@ --enable-wddx \ --with-xmlrpc \ \ + --with-ncurses=no \ --with-fbsql=no \ --with-fdftk=no \ --with-gmp=no \ |
Author: wrzep Date: 2006-05-17 13:06:06 -0400 (Wed, 17 May 2006) New Revision: 4287 Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java Removed: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ServiceConf.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Column.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ProjectsByScoreComparator.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java Log: JBLAB-599 refactoring Pawel Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -38,15 +38,16 @@ import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.impl.PluginConfImpl; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.PluginsValues; +import org.jboss.forge.status.service.impl.protocol.PluginConfImpl; +import org.jboss.forge.status.service.impl.protocol.ServiceConfImpl; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.service.protocol.ServiceConf; import org.jboss.forge.status.templates.Column; import org.jboss.forge.status.templates.Columns; import org.jboss.forge.status.templates.MatrixTemplate; import org.jboss.forge.status.tools.ScoresManagerSync; import org.jboss.forge.status.tools.ScoresManagerAsync; -import org.jboss.forge.status.tools.ServiceConf; import org.jboss.forge.status.tools.Tags; import org.jboss.logging.Logger; @@ -85,7 +86,7 @@ // Get configuration projects = ProjectsHelper.getProjects(portalName); List<PluginConf> pluginsConf = getPluginsConfList(pluginsRoot); - ServiceConf serviceConf = new ServiceConf(serviceNode); + ServiceConf serviceConf = new ServiceConfImpl(serviceNode); ScoresManagerSync.init(portalName, serviceConf); Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,48 @@ +/* + * 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.service; + +import java.util.Date; +import java.util.List; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginValues; +import org.jboss.forge.status.service.protocol.PluginsValues; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public interface ScoresService { + + public PluginsValues getPluginsValues(String portalName, + Date date) throws GetScoresException; + + public void save(Projects projects, List<PluginConf> pluginsConf, + String portalName) throws ScoresSaveException; + + public PluginValues get(String portalName, String pluginId, Date date) + throws GetScoresException; +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,32 @@ +/* + * 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.service; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ + +public interface ScoresServiceLocal extends ScoresService { + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,31 @@ +/* + * 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.service; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public interface ScoresServiceRemote extends ScoresService { + +} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,63 +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.service.impl; - -import java.sql.Timestamp; -import java.util.Date; - -import org.jboss.forge.status.service.model.GetScoresRequest; - -/** -* @author Pawel Wrzeszcz -*/ -public class GetScoresRequestImpl implements GetScoresRequest { - - private static final long serialVersionUID = 7844595317056960170L; - - private Date date; - private Date toDate; - private Timestamp timestamp; - - public GetScoresRequestImpl(Date date, Date toDate, - Timestamp timestamp) { - - this.date = date; - this.toDate = toDate; - this.timestamp = timestamp; - } - - public Date getDate() { - return date; - } - - public Date getToDate() { - return toDate; - } - - public Timestamp getTimestamp() { - return timestamp; - } - - - -} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,81 +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.service.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.jboss.forge.common.XmlTools; -import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.tools.Tags; -import org.w3c.dom.Node; - -/** -* @author Pawel Wrzeszcz -*/ -public class PluginConfImpl implements PluginConf { - - private static final long serialVersionUID = 8598887068548048511L; - - private Map<String,String> fields = new HashMap<String,String>(); - private Properties properties; - - public PluginConfImpl(Node pluginNode) - throws InvalidPluginsConfigurationException { - - // Parse plugin configuration - parseField(pluginNode, Tags.PLUGIN_ID_ELEMENT); - parseField(pluginNode, Tags.PLUGIN_CLASS_ELEMENT); - - // Parse plugin properties - Node pluginPropertiesNode = - XmlTools.getFirstNodeWithName(pluginNode, - Tags.PLUGIN_PROPERTIES_ELEMENT); - - properties = XmlTools.parseProperties(pluginPropertiesNode); - } - - public String getFieldValue(String fieldName) { - return fields.get(fieldName); - } - - public Properties getProperties() { - return properties; - } - - private void parseField(Node pluginNode, String fieldName) - throws InvalidPluginsConfigurationException { - - String fieldValue = - XmlTools.getChildNodeValue(pluginNode, fieldName); - - if (fieldValue == null) { - throw new InvalidPluginsConfigurationException( - "Missing field: " + fieldName); - } - - fields.put(fieldName, fieldValue); - } -} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,82 +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.service.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.jboss.forge.status.plugins.Plugin; -import org.jboss.forge.status.service.model.PluginValues; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -* A class used to store plugin values in shotoku. -*/ - -public class PluginValuesImpl implements PluginValues { - - private static final long serialVersionUID = 5196364802717262757L; - - private Map<String,Long> values = new HashMap<String,Long>(); - private Map<String,Integer> rates = new HashMap<String,Integer>(); - private Map<String,String> links = new HashMap<String,String>(); - - private String pluginId; - private String linkName; - - public PluginValuesImpl(Plugin plugin, Set<String> projectIds) { - - // Get plugin properties - pluginId = plugin.getId(); - linkName = plugin.getLinkName(); - - // Get plugin values - for (String projectId : projectIds) { - - values.put(projectId, plugin.getValue(projectId)); - rates.put(projectId, new Integer(plugin.getRate(projectId))); - links.put(projectId, plugin.getLink(projectId)); - } - } - - public String getId() { - return pluginId; - } - - public Long getValue(String projectId) { - return values.get(projectId); - } - - public Integer getRate(String projectId) { - return rates.get(projectId); - } - - public String getLink(String projectId) { - return links.get(projectId); - } - - public String getLinkName() { - return linkName; - } -} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,115 +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.service.impl; - -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; - -import org.jboss.forge.status.exceptions.GetScoresException; -import org.jboss.forge.status.plugins.Plugin; -import org.jboss.forge.status.service.model.PluginsValues; -import org.jboss.forge.status.tools.Plugins; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -* A class used to store plugins values in shotoku. -*/ - -public class PluginsValuesImpl implements PluginsValues { - - private static final long serialVersionUID = -1669515339062166738L; - - /** Map : pluginId -> pluginValue */ - private Map<String,PluginValuesImpl> values; - - /** Creation date */ - private Date date; - - /** - * @param projects Projects present in the Status Matrix - * @param plugins Plugins which values will be stored - */ - public PluginsValuesImpl(Projects projects, Plugins plugins) { - - date = Calendar.getInstance().getTime(); - - values = new HashMap<String,PluginValuesImpl>(); - - Set<String> projectIds = - projects.getProjectIds(new NullPermissionsChecker(), null); - - for (Plugin plugin : plugins.getPlugins()) { - - PluginValuesImpl pluginValues = new PluginValuesImpl(plugin, projectIds); - - values.put(plugin.getId(), pluginValues); - } - } - - /** - * For the given plugin and project ids returns stored value. - * - * @param pluginId plugin id - * @param projectId project id - * @return stored plugin value for specified project - * @throws GetScoresException - * Thrown when requested value was not found - */ - public long getPluginValue(String pluginId, String projectId) - throws GetScoresException { - - Long val = null; - PluginValuesImpl pluginValues = values.get(pluginId); - - if (pluginValues != null) { - val = pluginValues.getValue(projectId); - } - - if (val == null) { - throw new GetScoresException(); - } - - return val; - } - - /** - * @return creation date - */ - public Date getDate() { - return date; - } - - public boolean hasPlugin(String pluginId) { - return values.containsKey(pluginId); - } - - public PluginValuesImpl getPluginValues(String pluginId) { - return values.get(pluginId); - } -} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,55 +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.service.impl; - -import java.util.List; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.SaveRequest; - -/** -* @author Pawel Wrzeszcz -*/ -public class SaveRequestImpl implements SaveRequest { - - private static final long serialVersionUID = 7523633911740487129L; - - private List<PluginConf> pluginsConf; - private Projects projects; - - public SaveRequestImpl(List<PluginConf> pluginsConf, Projects projects) { - - this.pluginsConf = pluginsConf; - this.projects = projects; - } - - public List<PluginConf> getPluginsConf() { - return pluginsConf; - } - - public Projects getProjects() { - return projects; - } - -} \ No newline at end of file Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -37,10 +37,10 @@ import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.model.GetScoresRequest; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.PluginsValues; -import org.jboss.forge.status.service.model.SaveRequest; +import org.jboss.forge.status.service.protocol.GetScoresRequest; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.service.protocol.SaveRequest; import org.jboss.forge.status.tools.RecordManager; import org.jboss.forge.status.tools.ScoresManagerSync; @@ -107,8 +107,6 @@ private static void handleRequest(GetScoresRequest getScoresRequest) { - System.out.println("***"); - Date date = getScoresRequest.getDate(); Date toDate = getScoresRequest.getToDate(); Timestamp timestamp = getScoresRequest.getTimestamp(); Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -45,10 +45,12 @@ import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.ScoresService; -import org.jboss.forge.status.service.model.ScoresServiceLocal; -import org.jboss.forge.status.service.model.ScoresServiceRemote; +import org.jboss.forge.status.service.ScoresService; +import org.jboss.forge.status.service.ScoresServiceLocal; +import org.jboss.forge.status.service.ScoresServiceRemote; +import org.jboss.forge.status.service.impl.protocol.PluginValuesImpl; +import org.jboss.forge.status.service.impl.protocol.PluginsValuesImpl; +import org.jboss.forge.status.service.protocol.PluginConf; import org.jboss.forge.status.tools.Plugins; import org.jboss.forge.status.tools.Tools; Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,63 @@ +/* + * 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.service.impl.protocol; + +import java.sql.Timestamp; +import java.util.Date; + +import org.jboss.forge.status.service.protocol.GetScoresRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class GetScoresRequestImpl implements GetScoresRequest { + + private static final long serialVersionUID = 7844595317056960170L; + + private Date date; + private Date toDate; + private Timestamp timestamp; + + public GetScoresRequestImpl(Date date, Date toDate, + Timestamp timestamp) { + + this.date = date; + this.toDate = toDate; + this.timestamp = timestamp; + } + + public Date getDate() { + return date; + } + + public Date getToDate() { + return toDate; + } + + public Timestamp getTimestamp() { + return timestamp; + } + + + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,81 @@ +/* + * 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.service.impl.protocol; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.tools.Tags; +import org.w3c.dom.Node; + +/** +* @author Pawel Wrzeszcz +*/ +public class PluginConfImpl implements PluginConf { + + private static final long serialVersionUID = 8598887068548048511L; + + private Map<String,String> fields = new HashMap<String,String>(); + private Properties properties; + + public PluginConfImpl(Node pluginNode) + throws InvalidPluginsConfigurationException { + + // Parse plugin configuration + parseField(pluginNode, Tags.PLUGIN_ID_ELEMENT); + parseField(pluginNode, Tags.PLUGIN_CLASS_ELEMENT); + + // Parse plugin properties + Node pluginPropertiesNode = + XmlTools.getFirstNodeWithName(pluginNode, + Tags.PLUGIN_PROPERTIES_ELEMENT); + + properties = XmlTools.parseProperties(pluginPropertiesNode); + } + + public String getFieldValue(String fieldName) { + return fields.get(fieldName); + } + + public Properties getProperties() { + return properties; + } + + private void parseField(Node pluginNode, String fieldName) + throws InvalidPluginsConfigurationException { + + String fieldValue = + XmlTools.getChildNodeValue(pluginNode, fieldName); + + if (fieldValue == null) { + throw new InvalidPluginsConfigurationException( + "Missing field: " + fieldName); + } + + fields.put(fieldName, fieldValue); + } +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,82 @@ +/* + * 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.service.impl.protocol; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.jboss.forge.status.plugins.Plugin; +import org.jboss.forge.status.service.protocol.PluginValues; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugin values in shotoku. +*/ + +public class PluginValuesImpl implements PluginValues { + + private static final long serialVersionUID = 5196364802717262757L; + + private Map<String,Long> values = new HashMap<String,Long>(); + private Map<String,Integer> rates = new HashMap<String,Integer>(); + private Map<String,String> links = new HashMap<String,String>(); + + private String pluginId; + private String linkName; + + public PluginValuesImpl(Plugin plugin, Set<String> projectIds) { + + // Get plugin properties + pluginId = plugin.getId(); + linkName = plugin.getLinkName(); + + // Get plugin values + for (String projectId : projectIds) { + + values.put(projectId, plugin.getValue(projectId)); + rates.put(projectId, new Integer(plugin.getRate(projectId))); + links.put(projectId, plugin.getLink(projectId)); + } + } + + public String getId() { + return pluginId; + } + + public Long getValue(String projectId) { + return values.get(projectId); + } + + public Integer getRate(String projectId) { + return rates.get(projectId); + } + + public String getLink(String projectId) { + return links.get(projectId); + } + + public String getLinkName() { + return linkName; + } +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,115 @@ +/* + * 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.service.impl.protocol; + +import java.util.Calendar; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; + +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.plugins.Plugin; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.tools.Plugins; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugins values in shotoku. +*/ + +public class PluginsValuesImpl implements PluginsValues { + + private static final long serialVersionUID = -1669515339062166738L; + + /** Map : pluginId -> pluginValue */ + private Map<String,PluginValuesImpl> values; + + /** Creation date */ + private Date date; + + /** + * @param projects Projects present in the Status Matrix + * @param plugins Plugins which values will be stored + */ + public PluginsValuesImpl(Projects projects, Plugins plugins) { + + date = Calendar.getInstance().getTime(); + + values = new HashMap<String,PluginValuesImpl>(); + + Set<String> projectIds = + projects.getProjectIds(new NullPermissionsChecker(), null); + + for (Plugin plugin : plugins.getPlugins()) { + + PluginValuesImpl pluginValues = new PluginValuesImpl(plugin, projectIds); + + values.put(plugin.getId(), pluginValues); + } + } + + /** + * For the given plugin and project ids returns stored value. + * + * @param pluginId plugin id + * @param projectId project id + * @return stored plugin value for specified project + * @throws GetScoresException + * Thrown when requested value was not found + */ + public long getPluginValue(String pluginId, String projectId) + throws GetScoresException { + + Long val = null; + PluginValuesImpl pluginValues = values.get(pluginId); + + if (pluginValues != null) { + val = pluginValues.getValue(projectId); + } + + if (val == null) { + throw new GetScoresException(); + } + + return val; + } + + /** + * @return creation date + */ + public Date getDate() { + return date; + } + + public boolean hasPlugin(String pluginId) { + return values.containsKey(pluginId); + } + + public PluginValuesImpl getPluginValues(String pluginId) { + return values.get(pluginId); + } +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,55 @@ +/* + * 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.service.impl.protocol; + +import java.util.List; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.SaveRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class SaveRequestImpl implements SaveRequest { + + private static final long serialVersionUID = 7523633911740487129L; + + private List<PluginConf> pluginsConf; + private Projects projects; + + public SaveRequestImpl(List<PluginConf> pluginsConf, Projects projects) { + + this.pluginsConf = pluginsConf; + this.projects = projects; + } + + public List<PluginConf> getPluginsConf() { + return pluginsConf; + } + + public Projects getProjects() { + return projects; + } + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,80 @@ +/* + * 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.service.impl.protocol; + +import java.util.Properties; + +import org.jboss.forge.status.service.protocol.ServiceConf; +import org.jboss.forge.status.tools.Tags; +import org.jboss.shotoku.Node; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public class ServiceConfImpl implements ServiceConf { + + boolean remoteService; + + Properties properties; + + public ServiceConfImpl(Node serviceNode) { + + properties = parseProperties(serviceNode); + + String remoteString = (String) properties.get(Tags.SERVICE_REMOTE_ELEMENT); + remoteService = remoteString.equals("true"); + + System.out.println("remote " + remoteService + "\n props: " + properties); + } + + public boolean isRemote() { + return remoteService; + } + + public Properties getProperties() { + return properties; + } + + private Properties parseProperties(Node serviceNode) { + + if (serviceNode == null) { + return null; + } + + Properties props = new Properties(); + + String propsString = serviceNode.getContent(); + String[] propsArr = propsString.split("\n"); + + for (String propString : propsArr) { + + String[] propArr = propString.split("="); + if ((propArr != null) && (propArr.length == 2)) { + props.put(propArr[0], propArr[1]); + } + + } + + return props; + } +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,40 @@ +/* + * 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.service.protocol; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; + +/** +* @author Pawel Wrzeszcz +*/ +public interface GetScoresRequest extends Serializable { + + public Date getDate(); + + public Date getToDate(); + + public Timestamp getTimestamp(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,36 @@ +/* + * 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.service.protocol; + +import java.io.Serializable; +import java.util.Properties; + +/** +* @author Pawel Wrzeszcz +*/ +public interface PluginConf extends Serializable { + + public String getFieldValue(String fieldName); + + public Properties getProperties(); +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -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.service.protocol; + +import java.io.Serializable; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugin values in shotoku. +*/ + +public interface PluginValues extends Serializable { + + public String getId(); + + public Long getValue(String projectId); + + public Integer getRate(String projectId); + + public String getLink(String projectId); + + public String getLinkName(); + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,60 @@ +/* + * 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.service.protocol; + +import java.util.Date; + +import java.io.Serializable; + +import org.jboss.forge.status.exceptions.GetScoresException; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugins values in shotoku. +*/ + +public interface PluginsValues extends Serializable { + + /** + * For the given plugin and project ids returns stored value. + * + * @param pluginId plugin id + * @param projectId project id + * @return stored plugin value for specified project + * @throws GetScoresException + * Thrown when requested value was not found + */ + public long getPluginValue(String pluginId, String projectId) + throws GetScoresException; + + /** + * @return creation date + */ + public Date getDate(); + + public boolean hasPlugin(String pluginId); + + public PluginValues getPluginValues(String pluginId); + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,39 @@ +/* + * 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.service.protocol; + +import java.io.Serializable; +import java.util.List; + +import org.jboss.forge.common.projects.Projects; + +/** +* @author Pawel Wrzeszcz +*/ +public interface SaveRequest extends Serializable { + + public List<PluginConf> getPluginsConf(); + + public Projects getProjects(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,36 @@ +/* + * 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.service.protocol; + +import java.util.Properties;... [truncated message content] |
From: <jbo...@li...> - 2006-05-17 16:42:14
|
Author: wrzep Date: 2006-05-17 12:41:58 -0400 (Wed, 17 May 2006) New Revision: 4286 Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/GetScoresRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/SaveRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java Removed: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/maven.xml labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/Last7DaysStatusPlugin.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java Log: JBLAB-599 rough MDB implementation Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/maven.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/maven.xml 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/maven.xml 2006-05-17 16:41:58 UTC (rev 4286) @@ -8,21 +8,16 @@ <goal name="all"> <attainGoal name="prj-all" /> - <ant:copy tofile="${local.deploy.dir}/${forge.sar.name}/forge-status.ejb3" file="../${forge.sar.dir}/target/${forge.sar.name}/forge-status.ejb3" /> -<!-- <ant:copy tofile="${local.deploy.dir}/${forge.sar.name}/status-common.jar" file="../${forge.sar.dir}/target/${forge.sar.name}/status-common.jar" /> --> </goal> <goal name="build"> <attainGoal name="prj-war-build" /> <attainGoal name="ejb" /> -<!-- <ant:jar destfile="target/status-common.jar" basedir="target/classes" excludes="${status.portlet.classes} ${status.ejb3.classes}" /> --> </goal> <goal name="deploy"> <attainGoal name="prj-war-deploy" /> - <ant:copy tofile="../${forge.sar.dir}/target/${forge.sar.name}/forge-status.ejb3" file="target/forge-status-1.0.jar" /> -<!-- <ant:copy tofile="../${forge.sar.dir}/target/${forge.sar.name}/status-common.jar" file="target/status-common.jar" /> --> - <!-- <ant:copy tofile="${maven.repo.local}/jboss-forge/jars/status-common.jar" file="target/status-common.jar" /> --> + <ant:copy tofile="${local.deploy.dir}/forge-status.ejb3" file="target/forge-status-1.0.jar" /> </goal> <goal name="clean"> Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -44,7 +44,7 @@ import org.jboss.forge.status.templates.Column; import org.jboss.forge.status.templates.Columns; import org.jboss.forge.status.templates.MatrixTemplate; -import org.jboss.forge.status.tools.ScoresManager; +import org.jboss.forge.status.tools.ScoresManagerSync; import org.jboss.forge.status.tools.ScoresManagerAsync; import org.jboss.forge.status.tools.ServiceConf; import org.jboss.forge.status.tools.Tags; @@ -87,21 +87,17 @@ List<PluginConf> pluginsConf = getPluginsConfList(pluginsRoot); ServiceConf serviceConf = new ServiceConf(serviceNode); - ScoresManager.init(portalName, serviceConf); + ScoresManagerSync.init(portalName, serviceConf); PluginsValues pluginsValues; try { - //<debug> + // Compute and save current scores + ScoresManagerAsync.init(portalName, serviceConf); ScoresManagerAsync.save(projects, pluginsConf); - // </debug> + pluginsValues = ScoresManagerAsync.getCurrentScores(); - // Compute and save current scores - ScoresManager.save(projects, pluginsConf); - - pluginsValues = ScoresManager.getCurrentScores(); - } catch (ScoresSaveException e) { log.error("Saving scores failed ", e); return; Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/Last7DaysStatusPlugin.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/Last7DaysStatusPlugin.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/plugins/Last7DaysStatusPlugin.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -30,7 +30,7 @@ import org.jboss.forge.status.exceptions.InvalidPluginPropertiesException; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.tools.Plugins; -import org.jboss.forge.status.tools.ScoresManager; +import org.jboss.forge.status.tools.ScoresManagerSync; /** * @author Pawel Wrzeszcz (paw...@gm...) @@ -79,7 +79,7 @@ Date prev = cal.getTime(); try { - prevValue = ScoresManager.getValue( + prevValue = ScoresManagerSync.getValue( insidePlugin.getId(), projectId, prev,now); } catch (GetScoresException e) { return 0; Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,63 @@ +/* + * 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.service.impl; + +import java.sql.Timestamp; +import java.util.Date; + +import org.jboss.forge.status.service.model.GetScoresRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class GetScoresRequestImpl implements GetScoresRequest { + + private static final long serialVersionUID = 7844595317056960170L; + + private Date date; + private Date toDate; + private Timestamp timestamp; + + public GetScoresRequestImpl(Date date, Date toDate, + Timestamp timestamp) { + + this.date = date; + this.toDate = toDate; + this.timestamp = timestamp; + } + + public Date getDate() { + return date; + } + + public Date getToDate() { + return toDate; + } + + public Timestamp getTimestamp() { + return timestamp; + } + + + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,55 @@ +/* + * 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.service.impl; + +import java.util.List; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.service.model.PluginConf; +import org.jboss.forge.status.service.model.SaveRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class SaveRequestImpl implements SaveRequest { + + private static final long serialVersionUID = 7523633911740487129L; + + private List<PluginConf> pluginsConf; + private Projects projects; + + public SaveRequestImpl(List<PluginConf> pluginsConf, Projects projects) { + + this.pluginsConf = pluginsConf; + this.projects = projects; + } + + public List<PluginConf> getPluginsConf() { + return pluginsConf; + } + + public Projects getProjects() { + return projects; + } + +} \ No newline at end of file Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -22,40 +22,31 @@ package org.jboss.forge.status.service.impl; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.text.SimpleDateFormat; -import java.util.Calendar; +import java.sql.Timestamp; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.jms.JMSException; -import javax.jms.MapMessage; import javax.jms.Message; import javax.jms.MessageListener; +import javax.jms.ObjectMessage; import org.jboss.forge.common.projects.Projects; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.model.GetScoresRequest; import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.tools.Plugins; -import org.jboss.forge.status.tools.Tools; +import org.jboss.forge.status.service.model.PluginsValues; +import org.jboss.forge.status.service.model.SaveRequest; +import org.jboss.forge.status.tools.RecordManager; +import org.jboss.forge.status.tools.ScoresManagerSync; import org.jboss.logging.Logger; -import org.jboss.shotoku.ContentManager; -import org.jboss.shotoku.Directory; -import org.jboss.shotoku.Node; -import org.jboss.shotoku.aop.Inject; -import org.jboss.shotoku.exceptions.RepositoryException; -import org.jboss.shotoku.exceptions.ResourceDoesNotExist; + /** * @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) */ @@ -69,294 +60,70 @@ }) public class ScoresMDB implements MessageListener { - private static Logger log = Logger.getLogger(ScoresServiceImpl.class); + private static Logger log = Logger.getLogger(ScoresMDB.class); - private Map<String,PluginsValuesImpl> values = new HashMap<String,PluginsValuesImpl>(); - @Inject - private ContentManager cm; - public void onMessage(Message msg) { - MapMessage message = (MapMessage) msg; + ObjectMessage message = (ObjectMessage) msg; try { - String request = message.getString("name"); + String requestName = message.getStringProperty("name"); + System.out.println("request name: " + requestName); - System.out.println("request name: " + request); - } catch (JMSException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } - - /** - * Saves current plugin values. - * - * @param projects Projects for which plugin values will be saved - * @param plugins Plugins for which values will be saved - * @param portalName - * @return true iff saving was successful - */ - public void save(Projects projects, List<PluginConf> pluginsConf, - String portalName) throws ScoresSaveException { - - log.info("Saving..."); - - // Get plugins from conf - Plugins plugins = new Plugins(pluginsConf, portalName, projects); - - // Get directory where we store historical scores - Directory rootDir = cm.getRootDirectory(); - String dirName = Tools.getShotokuStatusPath(portalName); - Directory dir = getDir(rootDir, dirName); - - log.info("Computing scores..."); - - // Get plugin values and save them in proper node - PluginsValuesImpl pluginsValues = new PluginsValuesImpl(projects, plugins); - - // Get node to store scores - String nodeName = getCurrentNodeName(); - Node node = null; - - log.info("Getting shotoku node..."); - - try { - node = dir.getNode(nodeName); - } catch (RepositoryException e) { - log.error("Error while getting shotoku node: " + - dir.getFullName() + "/" + nodeName, e); - throw new ScoresSaveException(e); - } catch (ResourceDoesNotExist e) { - node = createNode(dir, nodeName); - } - - // Save values and store then in cache - values.put(getCurrentNodeName(), pluginsValues); - save(node, pluginsValues); - } - - /** - * Saves plugins values in the given Directory. - * - * @param dir Directory to save values - * @param pluginsValues PluginsValues to save - * @throws ScoresSaveException - */ - private void save(Node node, PluginsValuesImpl pluginsValues) - throws ScoresSaveException { - - try { - OutputStream os = node.getOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(os); - oos.writeObject((PluginsValuesImpl) pluginsValues); - oos.close(); - node.save("update"); /* os is closed inside save() */ - log.info("Saved succesfully"); - } catch (Exception e) { - log.error("Error while saving shotoku node: " + - node.getFullName(), e); - throw new ScoresSaveException(e); - } - } - - /** - * Returns historical scores from the given <code>date</code> in the past. - * - * Notice that only year, month and day matter in passed dates. - * - * @return scores from the given date - * @throws GetScoresException - */ - public PluginsValuesImpl getPluginsValues(String portalName, Date date) - throws GetScoresException { - - log.info("Returning plugins values..."); - - // null date means today - if (date == null) { - Calendar cal = Calendar.getInstance(); - date = cal.getTime(); - } - - String key = getNodeName(date); - PluginsValuesImpl v = values.get(key); - - if (v == null) { // Not in cache => get value and store it - - log.info("Value not in cache..."); - Directory rootDir = cm.getRootDirectory(); - - Directory dir; - try { - dir = rootDir.getDirectory(Tools.getShotokuStatusPath(portalName)); - } catch (RepositoryException e) { - throw new GetScoresException(e); - } catch (ResourceDoesNotExist e) { - throw new GetScoresException(e); + if (requestName.equals("save")) { + + SaveRequest saveRequest = (SaveRequest) message.getObject(); + handleRequest(saveRequest); } + + if (requestName.equals("getPluginsValues")) { - if (dir != null) { - v = getPluginsValues(dir, date); - log.info("Finished."); - values.put(key,v); + GetScoresRequest getScoresRequest = + (GetScoresRequest) message.getObject(); + handleRequest(getScoresRequest); } - } - - return v; - } - - /** - * Returns historical scores from the specified directory. - * - * @param dir Directory to read scores from - * @return - * @throws GetScoresException - */ - private PluginsValuesImpl getPluginsValues(Directory dir, Date date) - throws GetScoresException { + - // Get appropriate node - Node node = null; - String nodeName = getNodeName(date); - - try { - node = dir.getNode(nodeName); - } catch (Exception e) { - log.error("Error while getting shotoku node " + - dir.getFullName() + "/" + nodeName); - throw new GetScoresException(e); + } catch (JMSException e) { + log.error(e); //TODO } - - // Restore values - PluginsValuesImpl values = null; - try { - InputStream is = node.getContentInputStream(); - ObjectInputStream ois = new ObjectInputStream(is); - values = (PluginsValuesImpl) ois.readObject(); - ois.close(); - is.close(); - } catch (Exception e) { - log.error("Error while restoring scores from shotoku node " + - dir.getFullName() + "/" + nodeName); - throw new GetScoresException(e); - } - - return values; } - - /** - * Creates new shotoku Node. - * - * @param dir Directory in which new Node will be created - * @param nodeName name of new Node - * @return Node - * @throws ScoresSaveException - */ - private Node createNode(Directory dir, String nodeName) - throws ScoresSaveException { + + private static void handleRequest(SaveRequest saveRequest) { - Node node = null; + Projects projects = saveRequest.getProjects(); + List<PluginConf> pluginsConf = saveRequest.getPluginsConf(); try { - node = dir.newNode(nodeName); - node.save("create"); - } catch (Exception e) { - log.error("Error while creating shotoku node: " + - dir.getFullName() + "/" + nodeName, e); - throw new ScoresSaveException(e); + ScoresManagerSync.save(projects, pluginsConf); + } catch (ScoresSaveException e) { + log.error(e); //TODO } - return node; - } - - /** - * Gets shotoku Directory with name <code>dirName</code> - * from specified shotoku Directory. - * If requested Directory does not exist it is created. - * - * @param rootDir Directory where search will be performed - * @param dirName name of searched Directory - * @return Directory with the given name - * or null when creating Directory failed. - * @throws ScoresSaveException - */ - private Directory getDir(Directory rootDir, String dirName) - throws ScoresSaveException { + System.out.println("SAVED"); - Directory dir = null; - - try { - dir = rootDir.getDirectory(dirName); - } catch (RepositoryException e) { - log.error("Error while getting shotoku directory " + - rootDir.getFullName() + "/" + dirName); - throw new ScoresSaveException(e); - } catch (ResourceDoesNotExist e) { - dir = createDir(rootDir, dirName); - } - - return dir; } - /** - * Creates new shotoku Directory. - * - * @param rootDir Directory in which new subdirectory will be created - * @param dirName name of new Directory - * @return Directory or null if errors occured - * @throws ScoresSaveException - */ - private Directory createDir(Directory rootDir, String dirName) - throws ScoresSaveException { + private static void handleRequest(GetScoresRequest getScoresRequest) { - Directory dir = null; + System.out.println("***"); + Date date = getScoresRequest.getDate(); + Date toDate = getScoresRequest.getToDate(); + Timestamp timestamp = getScoresRequest.getTimestamp(); + + PluginsValues pluginsValues = null; try { - dir = rootDir.newDirectory(dirName); - dir.save("create"); - } catch (Exception e) { - log.error("Error while creating shotoku directory: " + - rootDir.getFullName() + "/" + dirName, e); - throw new ScoresSaveException(e); + pluginsValues = ScoresManagerSync.getScores(date, toDate); + } catch (GetScoresException e) { + log.error(e); //TODO + return; //?? } - return dir; + RecordManager.add(timestamp, pluginsValues); + System.out.println("added! " + pluginsValues); } - - /** - * Gets name of Node containing saved data from specified datestamp. - * Notice that only year, month and day matter in passed <code>date</code>. - * - * @param date datestamp - * @return Node name - */ - private String getNodeName(Date date) { - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - - return df.format(date); - } - /** - * @return name of Node containging data saved today - */ - private String getCurrentNodeName() { - - Calendar cal = Calendar.getInstance(); - Date today = cal.getTime(); - - return getNodeName(today); - } - - public PluginValuesImpl get(String portalName, String pluginId, Date date) - throws GetScoresException { - - PluginsValuesImpl pv = getPluginsValues(portalName, date); - return pv.getPluginValues(pluginId); - } } Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/GetScoresRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/GetScoresRequest.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/GetScoresRequest.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,40 @@ +/* + * 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.service.model; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; + +/** +* @author Pawel Wrzeszcz +*/ +public interface GetScoresRequest extends Serializable { + + public Date getDate(); + + public Date getToDate(); + + public Timestamp getTimestamp(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/SaveRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/SaveRequest.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/SaveRequest.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,39 @@ +/* + * 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.service.model; + +import java.io.Serializable; +import java.util.List; + +import org.jboss.forge.common.projects.Projects; + +/** +* @author Pawel Wrzeszcz +*/ +public interface SaveRequest extends Serializable { + + public List<PluginConf> getPluginsConf(); + + public Projects getProjects(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,44 @@ +package org.jboss.forge.status.tools; + +import java.sql.Timestamp; +import java.util.ArrayList; +import org.jboss.forge.status.service.model.PluginsValues; + +/** + * @author Pawel Wrzeszcz + */ +public class RecordManager { + + private static ArrayList<TimestampedScore> buff = + new ArrayList<TimestampedScore> (); + + private static int maxSize = 100; + + public static void add (Timestamp sent, PluginsValues pluginsValues) { + + // Remove the earliest item if the cache is full + if (buff.size () > maxSize) { + buff.remove (0); + } + + buff.add(new TimestampedScore(sent, pluginsValues)); + + System.out.println("added " + sent + " " + buff.size()); + } + + public static PluginsValues get(Timestamp sent) { + + System.out.println("get " + sent + " size=" + buff.size()); + + for (int i = 0; i < buff.size (); i++) { + + TimestampedScore ts = buff.get(i); System.out.print("get " + ts + " "); + + if (ts.getTimestamp().equals(sent)) { + return ts.getPluginsValues(); + } + } + return null; + } + +} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManager.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -1,150 +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.tools; - -import java.util.Date; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.rmi.PortableRemoteObject; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.status.exceptions.GetScoresException; -import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.PluginsValues; -import org.jboss.forge.status.service.model.ScoresService; -import org.jboss.forge.status.service.model.ScoresServiceLocal; -import org.jboss.forge.status.service.model.ScoresServiceRemote; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -*/ - -public class ScoresManager { - - private static String portalName; - private static boolean isRemote; - private static Properties properties; - - public static void init(String portalName, ServiceConf serviceConf) { - - ScoresManager.portalName = portalName; - - isRemote = serviceConf.isRemote(); - System.out.println("remote: " + isRemote); - - properties = serviceConf.getProperties(); - } - - public static void save(Projects projects, List<PluginConf> pluginsConf) - throws ScoresSaveException { - - ScoresService service = null; - - try { - service = getService(); - } catch (NamingException e) { - throw new ScoresSaveException(e); - } - - service.save(projects, pluginsConf, portalName); - } - - public static PluginsValues getScores(Date date, Date toDate) - throws GetScoresException { - - PluginsValues pluginsValues = null; - - try { - ScoresService service = getService(); - pluginsValues = service.getPluginsValues(portalName, date); - } catch (Exception e) { - throw new GetScoresException(e); - } - - if (pluginsValues == null) { - throw new GetScoresException(); - } - - return pluginsValues; - } - - /** - * For the specified plugin returns historical project score - * from the given <code>date</code> in the past. - * If scores from specified day are not available, - * the next available scores saved at the day before or equal - * to <code>toDate</code> are returned. - * - * Notice that only year, month and day matter in passed dates. - * - * @return project score from the given date for specified plugin - * @throws GetScoresException - */ - public static long getValue(String pluginId, String projectId, - Date date, Date toDate) - throws GetScoresException { - - PluginsValues pluginsValues = getScores(date, toDate); - - return pluginsValues.getPluginValue(pluginId, projectId); - } - - public static PluginsValues getCurrentScores() - throws GetScoresException { - - Date now = new Date(); - - return getScores(now, now); - } - - private static ScoresService getService() throws NamingException { - - Context context = new InitialContext(properties); - - // Perform look up using JNDI name of ejb object - String serviceBinding = - (isRemote ? Tools.STATUS_REMOTE_SERVICE : - Tools.STATUS_LOCAL_SERVICE); - Object ref = context.lookup(serviceBinding); - - // Narrow the reference of the object returned by lookup() method - ScoresService service = - (ScoresService) PortableRemoteObject.narrow( ref, - (isRemote ? ScoresServiceRemote.class : - ScoresServiceLocal.class)); - - return service; - } - - /* - * java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory - * java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces - * java.naming.provider.url=localhost:1099 - * jnp.disableDiscovery=true - */ -} Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -22,14 +22,14 @@ package org.jboss.forge.status.tools; +import java.io.Serializable; +import java.sql.Timestamp; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Properties; import javax.jms.JMSException; -import javax.jms.MapMessage; +import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; @@ -38,11 +38,16 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; + import org.jboss.forge.common.projects.Projects; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.impl.GetScoresRequestImpl; +import org.jboss.forge.status.service.impl.SaveRequestImpl; +import org.jboss.forge.status.service.model.GetScoresRequest; import org.jboss.forge.status.service.model.PluginConf; import org.jboss.forge.status.service.model.PluginsValues; +import org.jboss.forge.status.service.model.SaveRequest; /** * @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) @@ -50,13 +55,12 @@ public class ScoresManagerAsync { - private static String portalName; private static boolean isRemote; private static Properties properties; public static void init(String portalName, ServiceConf serviceConf) { - ScoresManagerAsync.portalName = portalName; + ScoresManagerSync.init(portalName, serviceConf); //TODO inheritance isRemote = serviceConf.isRemote(); System.out.println("remote: " + isRemote); @@ -67,15 +71,13 @@ public static void save(Projects projects, List<PluginConf> pluginsConf) throws ScoresSaveException { - // Fill arguments - Map<String,Object> args = new HashMap<String,Object>(); - args.put("projects", projects); //TODO store these args names somewhere ;-) - args.put("pluginsConf", pluginsConf); - args.put("portalName", portalName); + SaveRequest saveRequest = new SaveRequestImpl(pluginsConf, projects); + //TODO request factory + //conf factory? // Send message try { - sendMessage("save", args); + sendMessage("save", saveRequest); } catch (Exception e) { throw new ScoresSaveException(e); } @@ -86,27 +88,39 @@ public static PluginsValues getScores(Date date, Date toDate) throws GetScoresException { //TODO toDate - - // Fill arguments - Map<String,Object> args = new HashMap<String,Object>(); - args.put("date", date); - args.put("portalName", portalName); + Timestamp timestamp = new Timestamp(System.currentTimeMillis()); + GetScoresRequest getScoresRequest = + new GetScoresRequestImpl(date, toDate, timestamp); + // Send message try { - sendMessage("getPluginsValues", args); + sendMessage("getPluginsValues", getScoresRequest); } catch (Exception e) { throw new GetScoresException(e); } - // TODO poll/wait for results + // poll/wait for results PluginsValues pluginsValues = null; + + for (;;) { //TODO when we give up? - if (pluginsValues == null) { - throw new GetScoresException(); - } + pluginsValues = RecordManager.get(timestamp); + + System.out.println("attempt: " + pluginsValues); + + if (pluginsValues != null) { + break; + } + + try { + Thread.sleep(2000); //TODO const + } catch (InterruptedException e) { + throw new GetScoresException(e); + } + } return pluginsValues; } @@ -140,7 +154,7 @@ return getScores(now, now); } - private static void sendMessage(String name, Map<String,Object> args) throws + private static void sendMessage(String name, Serializable request) throws NamingException, JMSException { Queue queue = null; @@ -149,19 +163,17 @@ QueueSender sender = null; Context context = new InitialContext(properties); - queue = (Queue) context.lookup("queue/jmm"); + queue = (Queue) context.lookup("queue/jmm"); //TODO const QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup("ConnectionFactory"); connection = factory.createQueueConnection(); session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); - // Copy arguments into message - MapMessage message = session.createMapMessage(); - message.setString("name", name); - for (String argName : args.keySet()) { - message.setObject(argName, args.get(argName)); - } + // Create message + ObjectMessage message = session.createObjectMessage(); + message.setStringProperty("name", name); + message.setObject(request); sender = session.createSender(queue); sender.send(message); Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,150 @@ +/* + * 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.tools; + +import java.util.Date; +import java.util.List; +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.rmi.PortableRemoteObject; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.model.PluginConf; +import org.jboss.forge.status.service.model.PluginsValues; +import org.jboss.forge.status.service.model.ScoresService; +import org.jboss.forge.status.service.model.ScoresServiceLocal; +import org.jboss.forge.status.service.model.ScoresServiceRemote; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ + +public class ScoresManagerSync { + + private static String portalName; + private static boolean isRemote; + private static Properties properties; + + public static void init(String portalName, ServiceConf serviceConf) { + + ScoresManagerSync.portalName = portalName; + + isRemote = serviceConf.isRemote(); + System.out.println("remote: " + isRemote); + + properties = serviceConf.getProperties(); + } + + public static void save(Projects projects, List<PluginConf> pluginsConf) + throws ScoresSaveException { + + ScoresService service = null; + + try { + service = getService(); + } catch (NamingException e) { + throw new ScoresSaveException(e); + } + + service.save(projects, pluginsConf, portalName); + } + + public static PluginsValues getScores(Date date, Date toDate) + throws GetScoresException { + + PluginsValues pluginsValues = null; + + try { + ScoresService service = getService(); + pluginsValues = service.getPluginsValues(portalName, date); + } catch (Exception e) { + throw new GetScoresException(e); + } + + if (pluginsValues == null) { + throw new GetScoresException(); + } + + return pluginsValues; + } + + /** + * For the specified plugin returns historical project score + * from the given <code>date</code> in the past. + * If scores from specified day are not available, + * the next available scores saved at the day before or equal + * to <code>toDate</code> are returned. + * + * Notice that only year, month and day matter in passed dates. + * + * @return project score from the given date for specified plugin + * @throws GetScoresException + */ + public static long getValue(String pluginId, String projectId, + Date date, Date toDate) + throws GetScoresException { + + PluginsValues pluginsValues = getScores(date, toDate); + + return pluginsValues.getPluginValue(pluginId, projectId); + } + + public static PluginsValues getCurrentScores() + throws GetScoresException { + + Date now = new Date(); + + return getScores(now, now); + } + + private static ScoresService getService() throws NamingException { + + Context context = new InitialContext(properties); + + // Perform look up using JNDI name of ejb object + String serviceBinding = + (isRemote ? Tools.STATUS_REMOTE_SERVICE : + Tools.STATUS_LOCAL_SERVICE); + Object ref = context.lookup(serviceBinding); + + // Narrow the reference of the object returned by lookup() method + ScoresService service = + (ScoresService) PortableRemoteObject.narrow( ref, + (isRemote ? ScoresServiceRemote.class : + ScoresServiceLocal.class)); + + return service; + } + + /* + * java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory + * java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces + * java.naming.provider.url=localhost:1099 + * jnp.disableDiscovery=true + */ +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java 2006-05-17 16:21:54 UTC (rev 4285) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java 2006-05-17 16:41:58 UTC (rev 4286) @@ -0,0 +1,30 @@ +package org.jboss.forge.status.tools; + +import java.sql.Timestamp; + +import org.jboss.forge.status.service.model.PluginsValues; + +/** + * @author Pawel Wrzeszcz + */ +public class TimestampedScore { + + private Timestamp timestamp; + private PluginsValues pluginsValues; + + public TimestampedScore(Timestamp timestamp, PluginsValues pluginsValues) { + + this.timestamp = timestamp; + this.pluginsValues = pluginsValues; + } + + public Timestamp getTimestamp() { + return timestamp; + } + + public PluginsValues getPluginsValues() { + return pluginsValues; + } + + +} |
From: <jbo...@li...> - 2006-05-17 16:21:59
|
Author: jfr...@jb... Date: 2006-05-17 12:21:54 -0400 (Wed, 17 May 2006) New Revision: 4285 Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh Log: Allow to build openssl on Solaris. Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 16:14:18 UTC (rev 4284) +++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 16:21:54 UTC (rev 4285) @@ -14,9 +14,13 @@ XML2VER=2.6.24 XML2URL=ftp://xmlsoft.org/libxml2/libxml2-${XML2VER}.tar.gz + PSQLVER=8.1.3 PSQLURL=http://wwwmaster.postgresql.org/redir?ftp%3A%2F%2Fftp2.ch.postgresql.org%2Fpub%2Fpostgresql%2Fsource%2Fv${PSQLVER}%2Fpostgresql-${PSQLVER}.tar.gz +OSSLVER="0.9.8b" +OSSLURL=http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz + # Platfrom directory and cache TOOLS=$HOME/`uname -s`_`uname -p`_tools CACHE=`uname -s`_`uname -p`_cache @@ -24,7 +28,9 @@ # default value for variables. BUILDXML2=false BUILDPSQL=false +BUILDOSSL=false CC=gcc +COMPILER="" # # Fonctions @@ -66,7 +72,7 @@ if [ ${CC} = "cc" ] then # Sun Studio - CC=cc CPPFLAGS="-I/opt/SUNWspro/prod/include/CC/Cstd/rw -I/opt/SUNWspro/prod/include/CC/Cstd" ./configure --prefix=${INSDIR} ${ADDCON} + CC=cc CPPFLAGS="-I/opt/SUNWspro/prod/include/CC/Cstd/rw -I/opt/SUNWspro/prod/include/CC/Cstd -DHUGE_VAL=__builtin_huge_val" ./configure --prefix=${INSDIR} ${ADDCON} else ./configure --prefix=${INSDIR} ${ADDCON} fi @@ -126,6 +132,7 @@ --with-pspell=no \ --with-readline=no \ --with-tidy=no \ + --with-openssl \ " # Make sure the right xml2 is used. # the make install of php (PEAR) uses php and need libxml2. @@ -149,6 +156,8 @@ --with-pdo-pgsql=no \ --with-pspell=no \ --with-tidy=no \ + --with-curl \ + --with-openssl \ " ADDFLAGS="-fPIC" ;; @@ -177,6 +186,8 @@ --with-mysql=no \ --with-mysqli=no \ --with-pdo-mysql=no \ + --with-curl \ + --with-openssl \ " ADDFLAGS="-I $JAVA_HOME/include/linux" ;; @@ -190,16 +201,19 @@ \ --with-xpm-dir=no \ --with-t1lib=no \ + --with-curl \ + --with-openssl \ " ADDFLAGS="-I $JAVA_HOME/include/linux" ;; dev13*) BUILDXML2=true BUILDPSQL=true + BUILDOSSL=true CC=cc export CC + COMPILER=solaris-x86-cc ADDCONF="\ - --enable-all=$EXTTYPE \ --with-libxml-dir=$TOOLS/LIBXML2 \ --with-jpeg-dir \ --with-png-dir \ @@ -210,6 +224,9 @@ --with-t1lib=no \ --with-pgsql=$EXTTYPE,$TOOLS/POSTGRESQL \ --with-pdo-pgsql=$EXTTYPE,$TOOLS/POSTGRESQL \ + --with-openssl=shared,$TOOLS/SSL \ + --with-openssl-dir=$TOOLS/SSL \ + --with-curl=no \ " ;; *) @@ -232,11 +249,37 @@ fi # +# build openssl if required +if ${BUILDOSSL} +then + Extract openssl ${OSSLURL} ${OSSLVER} + # Copied from buildworld.sh + # Do we need --openssldir= + (cd openssl-${OSSLVER} + if [ ${CC} = "cc" ] + then + ./Configure --prefix=${TOOLS}/SSL threads no-zlib no-zlib-dynamic no-gmp no-krb5 no-rc5 no-mdc2 no-idea no-ec shared $COMPILER -I/opt/SUNWspro/prod/include/CC/Cstd/rw -I/opt/SUNWspro/prod/include/CC/Cstd + else + ./Configure --prefix=${TOOLS}/SSL threads no-zlib no-zlib-dynamic no-gmp no-krb5 no-rc5 no-mdc2 no-idea no-ec shared $COMPILER + fi + make clean + make depend + make install + ) +fi + +# # build postgres if required +# postgres needs openssl if ${BUILDPSQL} then Extract postgresql ${PSQLURL} ${PSQLVER} - Build postgresql-${PSQLVER} ${TOOLS}/POSTGRESQL --without-readline + if ${BUILDOSSL} + then + Build postgresql-${PSQLVER} ${TOOLS}/POSTGRESQL "--without-readline LDFLAGS=-L${TOOLS}/SSL/lib" + else + Build postgresql-${PSQLVER} ${TOOLS}/POSTGRESQL --without-readline + fi fi # @@ -270,7 +313,6 @@ --with-bz2 \ --enable-bcmath \ --enable-calendar \ - --with-curl \ --enable-dbase \ --enable-dba \ --enable-exif \ @@ -282,7 +324,6 @@ --with-mysqli \ --with-mysql \ --with-pdo-mysql \ - --with-openssl \ --enable-shmop \ --enable-soap \ --enable-sockets \ |
From: <jbo...@li...> - 2006-05-17 16:14:22
|
Author: KrisVerlaenen Date: 2006-05-17 12:14:18 -0400 (Wed, 17 May 2006) New Revision: 4284 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java Log: Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java 2006-05-17 16:05:52 UTC (rev 4283) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java 2006-05-17 16:14:18 UTC (rev 4284) @@ -61,6 +61,9 @@ final String prefix = stripWhiteSpace(backText); + if (backText.length() < 5) { + return list; + } if (query.matcher(backText).matches()) { list.addAll(adapter.listConditionItems()); |
From: <jbo...@li...> - 2006-05-17 16:05:57
|
Author: KrisVerlaenen Date: 2006-05-17 12:05:52 -0400 (Wed, 17 May 2006) New Revision: 4283 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/DefaultCompletionProcessor.java Log: Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/DefaultCompletionProcessor.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/DefaultCompletionProcessor.java 2006-05-17 15:20:07 UTC (rev 4282) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/DefaultCompletionProcessor.java 2006-05-17 16:05:52 UTC (rev 4283) @@ -128,6 +128,9 @@ /** Looks behind, gets stuff after the white space. Basically ripping out the last word.*/ protected String stripWhiteSpace(String prefix) { + if ("".equals(prefix)) { + return prefix; + } if (prefix.charAt(prefix.length() - 1) == ' ') { return ""; } else { |
From: <jbo...@li...> - 2006-05-17 15:20:15
|
Author: KrisVerlaenen Date: 2006-05-17 11:20:07 -0400 (Wed, 17 May 2006) New Revision: 4282 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/debug/DebugUtil.java Log: fixed nullpointer when opening debug views Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/debug/DebugUtil.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/debug/DebugUtil.java 2006-05-17 14:32:31 UTC (rev 4281) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/debug/DebugUtil.java 2006-05-17 15:20:07 UTC (rev 4282) @@ -63,7 +63,7 @@ if (type instanceof JDIReferenceType) { String[] sourcePaths = ((JDIReferenceType) type) .getSourcePaths(null); - if (sourcePaths.length > 0) { + if (sourcePaths != null && sourcePaths.length > 0) { sourceElement = ((ISourceLookupDirector) locator) .getSourceElement(sourcePaths[0]); } |
From: <jbo...@li...> - 2006-05-17 14:32:37
|
Author: mar...@jb... Date: 2006-05-17 10:32:31 -0400 (Wed, 17 May 2006) New Revision: 4281 Modified: labs/jbossrules/trunk/build.xml labs/jbossrules/trunk/drools-compiler/.classpath labs/jbossrules/trunk/drools-compiler/pom.xml labs/jbossrules/trunk/drools-core/.classpath labs/jbossrules/trunk/drools-decisiontables/.classpath labs/jbossrules/trunk/drools-decisiontables/.project labs/jbossrules/trunk/drools-jsr94/.classpath labs/jbossrules/trunk/drools-jsr94/.project Log: -fixes for incorrect versions Modified: labs/jbossrules/trunk/build.xml =================================================================== --- labs/jbossrules/trunk/build.xml 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/build.xml 2006-05-17 14:32:31 UTC (rev 4281) @@ -12,8 +12,8 @@ <echo level="info" message="drools-jsr94" /> <echo level="info" message=" " /> <echo level="info" message="Further to this there are two Eclipse project:" /> - <echo level="info" message="drools-examples - To use open eclipse and import." /> - <echo level="info" message=" Requires the Drools eclipse plugin." /> + <echo level="info" message="drools-examples - To use open Eclipse and import." /> + <echo level="info" message=" Requires the Drools Eclipse plugin." /> <echo level="info" message=" Either build the plugin from drools-ide" /> <echo level="info" message=" or install from the Eclipse update site" /> <echo level="info" message=" http://anonsvn.labs.jboss.com/labs/jbossrules/updates" /> Modified: labs/jbossrules/trunk/drools-compiler/.classpath =================================================================== --- labs/jbossrules/trunk/drools-compiler/.classpath 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-compiler/.classpath 2006-05-17 14:32:31 UTC (rev 4281) @@ -5,24 +5,24 @@ <classpathentry kind="src" path="src/test/resources" output="target/test-classes"/> <classpathentry kind="output" path="target/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> - <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> - <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> + <classpathentry kind="var" path="M2_REPO/janino/janino/2.4.3/janino-2.4.3.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> + <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.666/core-3.2.0.666.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> <classpathentry kind="src" path="/drools-core"/> <classpathentry kind="var" path="M2_REPO/colt/colt/1.2.0/colt-1.2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/janino/janino/2.4.3/janino-2.4.3.jar"/> + <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-core/1.0-406301/commons-jci-core-1.0-406301.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> + <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.1/commons-io-1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> - <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> - <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.658/core-3.2.0.658.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/> </classpath> \ No newline at end of file Modified: labs/jbossrules/trunk/drools-compiler/pom.xml =================================================================== --- labs/jbossrules/trunk/drools-compiler/pom.xml 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-compiler/pom.xml 2006-05-17 14:32:31 UTC (rev 4281) @@ -67,7 +67,7 @@ <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>core</artifactId> - <version>3.2.0.658</version> + <version>3.2.0.666</version> </dependency> Modified: labs/jbossrules/trunk/drools-core/.classpath =================================================================== --- labs/jbossrules/trunk/drools-core/.classpath 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-core/.classpath 2006-05-17 14:32:31 UTC (rev 4281) @@ -5,12 +5,12 @@ <classpathentry kind="src" path="src/test/resources" output="target/test-classes"/> <classpathentry kind="output" path="target/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/colt/colt/1.2.0/colt-1.2.0.jar"/> + <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> - <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> - <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> - <classpathentry kind="var" path="M2_REPO/colt/colt/1.2.0/colt-1.2.0.jar"/> <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> + <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> </classpath> \ No newline at end of file Modified: labs/jbossrules/trunk/drools-decisiontables/.classpath =================================================================== --- labs/jbossrules/trunk/drools-decisiontables/.classpath 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-decisiontables/.classpath 2006-05-17 14:32:31 UTC (rev 4281) @@ -5,26 +5,26 @@ <classpathentry kind="src" path="src/test/resources" output="target/test-classes"/> <classpathentry kind="output" path="target/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="var" path="M2_REPO/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar"/> - <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.1/commons-io-1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.666/core-3.2.0.666.jar"/> + <classpathentry kind="src" path="/drools-compiler"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-core/1.0-406301/commons-jci-core-1.0-406301.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> + <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> + <classpathentry kind="var" path="M2_REPO/janino/janino/2.4.3/janino-2.4.3.jar"/> <classpathentry kind="src" path="/drools-core"/> - <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"/> - <classpathentry kind="src" path="/drools-compiler"/> - <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.658/core-3.2.0.658.jar"/> - <classpathentry kind="var" path="M2_REPO/janino/janino/2.4.3/janino-2.4.3.jar"/> <classpathentry kind="var" path="M2_REPO/colt/colt/1.2.0/colt-1.2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> - <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.1/commons-io-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> + <classpathentry kind="var" path="M2_REPO/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar"/> <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> - <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-core/1.0-406301/commons-jci-core-1.0-406301.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> + <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> </classpath> \ No newline at end of file Modified: labs/jbossrules/trunk/drools-decisiontables/.project =================================================================== --- labs/jbossrules/trunk/drools-decisiontables/.project 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-decisiontables/.project 2006-05-17 14:32:31 UTC (rev 4281) @@ -2,8 +2,8 @@ <name>drools-decisiontables</name> <comment/> <projects> + <project>drools-compiler</project> <project>drools-core</project> - <project>drools-compiler</project> </projects> <buildSpec> <buildCommand> Modified: labs/jbossrules/trunk/drools-jsr94/.classpath =================================================================== --- labs/jbossrules/trunk/drools-jsr94/.classpath 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-jsr94/.classpath 2006-05-17 14:32:31 UTC (rev 4281) @@ -5,29 +5,29 @@ <classpathentry kind="src" path="src/test/resources" output="target/test-classes"/> <classpathentry kind="output" path="target/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="M2_REPO/jsr94/jsr94/1.1/jsr94-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-core/1.0-406301/commons-jci-core-1.0-406301.jar"/> + <classpathentry kind="var" path="M2_REPO/jsr94/jsr94-tck/1.0.3/jsr94-tck-1.0.3.jar"/> <classpathentry kind="var" path="M2_REPO/colt/colt/1.2.0/colt-1.2.0.jar"/> - <classpathentry kind="src" path="/drools-compiler"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.1/commons-io-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.666/core-3.2.0.666.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> + <classpathentry kind="src" path="/drools-core"/> + <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> + <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> + <classpathentry kind="var" path="M2_REPO/jsr94/jsr94-sigtest/1.1/jsr94-sigtest-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> <classpathentry kind="var" path="M2_REPO/janino/janino/2.4.3/janino-2.4.3.jar"/> - <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> - <classpathentry kind="var" path="M2_REPO/xstream/xstream/1.1.3/xstream-1.1.3.jar"/> - <classpathentry kind="var" path="M2_REPO/jsr94/jsr94/1.1/jsr94-1.1.jar"/> - <classpathentry kind="src" path="/drools-core"/> - <classpathentry kind="var" path="M2_REPO/jsr94/jsr94-tck/1.0.3/jsr94-tck-1.0.3.jar"/> + <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> <classpathentry kind="var" path="M2_REPO/jung/jung/1.7.2/jung-1.7.2.jar"/> + <classpathentry kind="src" path="/drools-compiler"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-janino/2.4.3/commons-jci-janino-2.4.3.jar"/> <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/> - <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/stringtemplate/2.3b6/stringtemplate-2.3b6.jar"/> - <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.0.658/core-3.2.0.658.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-core/1.0-406301/commons-jci-core-1.0-406301.jar"/> - <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.1/commons-io-1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0ea8/antlr-3.0ea8.jar"/> - <classpathentry kind="var" path="M2_REPO/jsr94/jsr94-sigtest/1.1/jsr94-sigtest-1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/> <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-jci-eclipse/3.2.0.666/commons-jci-eclipse-3.2.0.666.jar"/> + <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/> </classpath> \ No newline at end of file Modified: labs/jbossrules/trunk/drools-jsr94/.project =================================================================== --- labs/jbossrules/trunk/drools-jsr94/.project 2006-05-17 14:04:15 UTC (rev 4280) +++ labs/jbossrules/trunk/drools-jsr94/.project 2006-05-17 14:32:31 UTC (rev 4281) @@ -2,8 +2,8 @@ <name>drools-jsr94</name> <comment/> <projects> + <project>drools-core</project> <project>drools-compiler</project> - <project>drools-core</project> </projects> <buildSpec> <buildCommand> |
Author: soh...@jb... Date: 2006-05-17 10:04:15 -0400 (Wed, 17 May 2006) New Revision: 4280 Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/index.xhtml Log: http://jira.jboss.com/jira/browse/JBFORUMS-57 - Edit Category Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-17 07:13:17 UTC (rev 4279) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-05-17 14:04:15 UTC (rev 4280) @@ -37,6 +37,7 @@ public static final String START_EDIT_POST = "startEditPost"; public static final String TOPIC_DELETED = "topicDeleted"; public static final String FEEDBACK = "feedback"; + public static final String EDIT_CATEGORY = "editCategory"; //---------parameter constants-------------------------------------------------------------------------------------------------- public static final String p_categoryId = "c"; public static final String p_forumId = "f"; Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-05-17 07:13:17 UTC (rev 4279) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java 2006-05-17 14:04:15 UTC (rev 4280) @@ -44,6 +44,7 @@ * */ private String categoryName = null; + private Category category = null; /** * ui data associated with "Forum" information @@ -66,8 +67,22 @@ public void setCategoryName(String categoryName) { this.categoryName = categoryName; - } + } /** + * @return Returns the category. + */ + public Category getCategory() + { + return category; + } + /** + * @param category The category to set. + */ + public void setCategory(Category category) + { + this.category = category; + } + /** * @return Returns the forumDescription. */ public String getForumDescription() @@ -101,7 +116,26 @@ * */ public AdminController() - { + { + try + { + //load the selected category if a categoryid is found + //fetch the category to be edited + int categoryId = -1; + String cour = ForumUtil.getParameter(Constants.p_categoryId); + if(cour!=null && cour.trim().length()>0) + { + categoryId = Integer.parseInt(cour); + } + if(categoryId!=-1) + { + this.category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId)); + } + } + catch(Exception e) + { + JSFUtil.handleException(e); + } } //----actions--------------------------------------------------------------------------------------------------------------------------- @@ -134,7 +168,36 @@ return navState; } + /** + * edit category + */ + public String editCategory() + { + String navState = null; + boolean success = false; + try + { + JSFUtil.setMessage(Constants.FEEDBACK,"The Category \""+this.category.getTitle()+"\" was successfully updated."); + navState = Constants.EDIT_CATEGORY; + success = true; + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + finally + { + if(success) + { + //cleanup the state + this.categoryName = null; + } + } + return navState; + } + + /** * adds a new forum * */ Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-17 07:13:17 UTC (rev 4279) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-05-17 14:04:15 UTC (rev 4280) @@ -349,6 +349,10 @@ <managed-bean-scope>request</managed-bean-scope> </managed-bean> <navigation-rule> - <from-view-id>/views/admin/index.xhtml</from-view-id> - </navigation-rule> + <from-view-id>/views/admin/editCategory.xhtml</from-view-id> + <navigation-case> + <from-outcome>editCategory</from-outcome> + <to-view-id>/views/admin/index.xhtml</to-view-id> + </navigation-case> + </navigation-rule> </faces-config> \ No newline at end of file Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml 2006-05-17 07:13:17 UTC (rev 4279) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/editCategory.xhtml 2006-05-17 14:04:15 UTC (rev 4280) @@ -0,0 +1,72 @@ +<!-- +/* +* 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. +*/ +--> + +<div xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb"> + + <ui:composition template="/views/common/common.xhtml"> + <ui:define name="mainContent"> + + <h1>${resource.Edit_Category}</h1> + + <p>${resource.Edit_Category_explain}</p> + + <!-- display the edit category widget --> + <h:form> + <input type="hidden" name="c" value="#{param['c']}"/> + <table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> + <tr> + <th class="thHead" colspan="2">${resource.Edit_Category}</th> + </tr> + <tr> + <td class="row1">${resource.Category}</td> + <td class="row2"> + <h:inputText id="Category" styleClass="post" size="25" value="#{adminController.category.title}" required="true"/> + &nbsp;<h:message for="Category" style="color:red" styleClass="liteoption"/>&nbsp; + </td> + </tr> + <tr> + <td class="catBottom" colspan="2" align="center"> + <h:commandButton value="${resource.Submit}" styleClass="mainoption" action="#{adminController.editCategory}"/> + </td> + </tr> + </table> + </h:form> + + <!-- integrate the jump box --> + <table cellspacing="0" cellpadding="0" border="0" align="right"> + <tr> + <td align="right" valign="top" nowrap="nowrap"> + <ui:include src="/views/jumpbox.xhtml"/> + </td> + </tr> + </table> + + </ui:define> + </ui:composition> +</div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/index.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/index.xhtml 2006-05-17 07:13:17 UTC (rev 4279) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/admin/index.xhtml 2006-05-17 14:04:15 UTC (rev 4280) @@ -58,7 +58,10 @@ </td> <td class="cat" align="center" valign="middle"> <span class="gen"> - <a href="">${resource.Edit}</a> + <h:outputLink value="#{forums:outputLink('/views/admin/editCategory.jsf',true)}"> + <f:param name="c" value="#{category.id}"/> + <h:outputText value="${resource.Edit}"/> + </h:outputLink> </span> </td> <td class="cat" align="center" valign="middle"> |
From: <jbo...@li...> - 2006-05-17 07:13:19
|
Author: jfr...@jb... Date: 2006-05-17 03:13:17 -0400 (Wed, 17 May 2006) New Revision: 4279 Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh Log: Add patch logic. Make sure that Sun Studio compiler are used on Solaris. Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 06:57:16 UTC (rev 4278) +++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-17 07:13:17 UTC (rev 4279) @@ -20,8 +20,11 @@ # Platfrom directory and cache TOOLS=$HOME/`uname -s`_`uname -p`_tools CACHE=`uname -s`_`uname -p`_cache + +# default value for variables. BUILDXML2=false BUILDPSQL=false +CC=gcc # # Fonctions @@ -41,6 +44,11 @@ if [ ! -d ${BASE}-${VER} ] then gzip -dc ${BASE}-${VER}.tar.gz | tar xvf - + # Check if patches available. + if [ -f patch/${BASE}-${VER}.patch ] + then + patch -p0 < patch/${BASE}-${VER}.patch + fi fi } @@ -55,7 +63,13 @@ INSDIR=$2 ADDCON=$3 (cd ${SRCDIR} - ./configure --prefix=${INSDIR} ${ADDCON} + if [ ${CC} = "cc" ] + then + # Sun Studio + CC=cc CPPFLAGS="-I/opt/SUNWspro/prod/include/CC/Cstd/rw -I/opt/SUNWspro/prod/include/CC/Cstd" ./configure --prefix=${INSDIR} ${ADDCON} + else + ./configure --prefix=${INSDIR} ${ADDCON} + fi if [ $? -ne 0 ] then echo "configure in ${SRCDIR} failed" @@ -88,6 +102,8 @@ dev12) BUILDXML2=true BUILDPSQL=true + CC=cc + export CC # -with-libxml-dir=/usr/local but 2.6.11 needed. # Solaris dynamic ld exports the symbols so build shared extensions. EXTTYPE=shared @@ -177,6 +193,25 @@ " ADDFLAGS="-I $JAVA_HOME/include/linux" ;; + dev13*) + BUILDXML2=true + BUILDPSQL=true + CC=cc + export CC + ADDCONF="\ + --enable-all=$EXTTYPE \ + --with-libxml-dir=$TOOLS/LIBXML2 \ + --with-jpeg-dir \ + --with-png-dir \ + --with-freetype-dir \ + --with-t1lib \ + \ + --with-xpm-dir=no \ + --with-t1lib=no \ + --with-pgsql=$EXTTYPE,$TOOLS/POSTGRESQL \ + --with-pdo-pgsql=$EXTTYPE,$TOOLS/POSTGRESQL \ + " + ;; *) EXTTYPE=static ADDCONF="\ @@ -193,7 +228,7 @@ if ${BUILDXML2} then Extract libxml2 ${XML2URL} ${XML2VER} - Build libxml2-${XML2VER} $TOOLS/LIBXML2 "" + Build libxml2-${XML2VER} ${TOOLS}/LIBXML2 "" fi # @@ -201,7 +236,7 @@ if ${BUILDPSQL} then Extract postgresql ${PSQLURL} ${PSQLVER} - Build postgresql-${PSQLVER} $TOOLS/POSTGRESQL --without-readline + Build postgresql-${PSQLVER} ${TOOLS}/POSTGRESQL --without-readline fi # |