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
|
Author: szimano Date: 2006-04-18 17:00:06 -0400 (Tue, 18 Apr 2006) New Revision: 3773 Modified: labs/jbosslabs/trunk/portal-extensions/binaries/maven-repo-addons/jboss/jars/status-common.jar labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/maven.xml labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/project.xml labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java Log: ssl processor fix JBLAB-655 Modified: labs/jbosslabs/trunk/portal-extensions/binaries/maven-repo-addons/jboss/jars/status-common.jar =================================================================== (Binary files differ) Modified: labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/maven.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/maven.xml 2006-04-18 18:54:24 UTC (rev 3772) +++ labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/maven.xml 2006-04-18 21:00:06 UTC (rev 3773) @@ -8,6 +8,8 @@ </goal> <goal name="all"> + <attainGoal name="build" /> + <attainGoal name="deploy" /> </goal> <goal name="clean"> Modified: labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/project.xml =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/project.xml 2006-04-18 18:54:24 UTC (rev 3772) +++ labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/project.xml 2006-04-18 21:00:06 UTC (rev 3773) @@ -8,6 +8,7 @@ <pomVersion>3</pomVersion> <id>portal-attr</id> <name>Portal attributes</name> + <extend>../common.xml</extend> <currentVersion>1.0</currentVersion> <organization> <name>Adam Warski</name> Modified: labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java 2006-04-18 18:54:24 UTC (rev 3772) +++ labs/jbosslabs/trunk/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java 2006-04-18 21:00:06 UTC (rev 3773) @@ -71,7 +71,8 @@ getPlainURL(httpRequest,plainPort.intValue()); //perform the switch from ssl to regular mode - String url = plainURL + "/" + relativeURL; + String url = plainURL + relativeURL; + httpResponse.setContentType("text/html"); httpResponse.sendRedirect(url); return; |
From: <jbo...@li...> - 2006-04-18 18:54:27
|
Author: dam...@jb... Date: 2006-04-18 14:54:24 -0400 (Tue, 18 Apr 2006) New Revision: 3772 Removed: trunk/ Log: Getting rid of top level trunk once and for all. |
From: <jbo...@li...> - 2006-04-18 18:47:16
|
Author: dam...@jb... Date: 2006-04-18 14:47:12 -0400 (Tue, 18 Apr 2006) New Revision: 3770 Added: labs/davcache/trunk/ Removed: trunk/labs/davcache/ Log: Moving davcache. Copied: labs/davcache/trunk (from rev 3769, trunk/labs/davcache) |
From: <jbo...@li...> - 2006-04-18 18:46:51
|
Author: dam...@jb... Date: 2006-04-18 14:46:46 -0400 (Tue, 18 Apr 2006) New Revision: 3769 Added: labs/davcache/tags/ Log: Moving davcache. |
From: <jbo...@li...> - 2006-04-18 18:46:48
|
Author: dam...@jb... Date: 2006-04-18 14:46:41 -0400 (Tue, 18 Apr 2006) New Revision: 3768 Added: labs/davcache/branches/ Log: Moving davcache. |
From: <jbo...@li...> - 2006-04-18 18:46:23
|
Author: dam...@jb... Date: 2006-04-18 14:46:17 -0400 (Tue, 18 Apr 2006) New Revision: 3767 Added: labs/davcache/ Log: Preparing to move davcache for restructuring. |
From: <jbo...@li...> - 2006-04-18 17:21:33
|
Author: unibrew Date: 2006-04-18 13:21:24 -0400 (Tue, 18 Apr 2006) New Revision: 3766 Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml Removed: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/user/ 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/view/ViewTopic.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml Log: [JBFORUMS-38] Adding files for UserView + configuring everything. 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-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/Constants.java 2006-04-18 17:21:24 UTC (rev 3766) @@ -36,6 +36,7 @@ public static final String p_categoryId = "c"; public static final String p_forumId = "f"; public static final String p_topicId = "t"; + public static final String p_userId = "uid"; public static final String p_option = "o"; public static final String p_poll_title = "POLL_TITLE"; public static final String p_poll_delete = "POLL_DELETE"; Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java 2006-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java 2006-04-18 17:21:24 UTC (rev 3766) @@ -0,0 +1,76 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + +package org.jboss.portlet.forums.ui.view; + +import org.jboss.portlet.forums.model.Poster; +import org.jboss.portlet.forums.ui.BaseController; +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.ForumUtil; +import org.jboss.portlet.forums.ui.JSFUtil; + +/** + * @author <a href="mailto:rys...@jb...">Ryszard Kozmik</a> + */ +public class ViewProfile extends BaseController +{ + + private Poster poster; + + + public Poster getPoster() + { + return poster; + } + + /** + * @author Ryszard Kozmik + */ + public ViewProfile() + { + + super(); + try + { + this.execute(); + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + + } + + //ui actions supported by this bean---------------------------------------------------------------------------------------------------- + /** + * This method gets userId from parameters and tries to find Poster with this uid. + */ + private void execute() throws Exception + { + String userId = ForumUtil.getParameter(Constants.p_userId); + if(userId!=null && !userId.trim().equals("")) + { + this.poster = BaseController.getForumsModule().findPosterByUserId(userId); + } + } + +} Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-04-18 17:21:24 UTC (rev 3766) @@ -102,7 +102,7 @@ //ui actions supported by this bean---------------------------------------------------------------------------------------------------- /** - * this generates topic + * This method gets topicId from parameters and tries to find topic with that id. */ private void execute() throws Exception { Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml 2006-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml 2006-04-18 17:21:24 UTC (rev 3766) @@ -0,0 +1,35 @@ +<!-- +/* +* 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:include src="/views/common/common.xhtml"/> + + <h:outputText value="VIEW SHOWING AN EDITOR OF MEESSAGE SENT TO USER" /> + +</div> \ No newline at end of file Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2006-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2006-04-18 17:21:24 UTC (rev 3766) @@ -0,0 +1,143 @@ +<!-- +/* +* 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:include src="/views/common/common.xhtml"/> + + +<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> + <tr> + <%-- <td align="left"><span class="nav"><a href="${n:out("U_INDEX")}" class="nav">${n:out("L_INDEX")}</a></span></td>--%> + <td align="left" valign="middle" width="100%"><span class="nav"> <a href="${n:out("U_VIEW_MAIN_PAGE")}" class="nav">${n:out("MAIN_PAGE_NAME")}</a> + <!---> <a href="${n:out("U_VIEW_CATEGORY")}" class="nav">${n:out("CATEGORY_NAME")}</a> + -> <a href="${n:out("U_VIEW_FORUM")}" class="nav">${n:out("FORUM_NAME")}</a>--></span></td> + </tr> +</table> + +<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center"> + <tr> + <th class="thHead" colspan="2" height="25" nowrap="nowrap">${n:i18n("L_VIEWING_PROFILE")}</th> + </tr> +<%-- <tr> + <td class="catLeft" width="40%" height="28" align="center"><b><span class="gen">${n:i18n("L_AVATAR")}</span></b> + </td> + <td class="catRight" width="60%"><b><span class="gen">${n:i18n("L_ABOUT_USER")}</span></b></td> + </tr>--%> + <tr> + <!--<td class="row1" height="6" valign="top" align="center">${n:out("AVATAR_IMG")}<br/><span + class="postdetails">${n:out("POSTER_RANK")}</span></td>--> + <td class="row1" rowspan="3" valign="top"> + <table width="100%" border="0" cellspacing="1" cellpadding="3"> + <tr> + <td valign="middle" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_JOINED")}: </span> + </td> + <td width="100%"><b><span class="gen">${n:out("JOINED")}</span></b></td> + </tr> + <tr> + <td valign="top" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_TOTAL_POSTS")}: </span> + </td> + <td valign="top"><b><span class="gen">${n:out("POSTS")}</span></b><%--<br/><span + class="genmed">[${n:out("POST_PERCENT_STATS")} / ${n:out("POST_DAY_STATS")}]</span> <br/><span + class="genmed"><a href="${n:out("U_SEARCH_USER")}" class="genmed">${n:i18n("L_SEARCH_USER_POSTS")}</a></span>--%> + </td> + </tr> + <tr> + <td valign="middle" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_LOCATION")}: </span> + </td> + <td><b><span class="gen">${n:out("LOCATION")}</span></b></td> + </tr> + <tr> + <td valign="middle" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_WEBSITE")}: </span> + </td> + <td><span class="gen"><b>${n:out("WWW")}</b></span></td> + </tr> + <tr> + <td valign="middle" align="right" nowrap="nowrap"><span + class="gen">${n:i18n("L_OCCUPATION")}: </span></td> + <td><b><span class="gen">${n:out("OCCUPATION")}</span></b></td> + </tr> + <tr> + <td valign="top" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_INTERESTS")}:</span></td> + <td><b><span class="gen">${n:out("INTERESTS")}</span></b></td> + </tr> + </table> + </td> + </tr> + <tr> + <td class="catLeft" align="center" height="28"><b><span + class="gen">${n:i18n("L_CONTACT")}: ${n:out("USERNAME")} </span></b></td> + </tr> + <tr> + <td class="row1" valign="top"> + <table width="100%" border="0" cellspacing="1" cellpadding="3"> + <tr> + <td valign="middle" align="right" nowrap="nowrap"><span class="gen">${n:i18n("L_EMAIL_ADDRESS")}:</span> + </td> + <td class="row1" valign="middle" width="100%"><b><span class="gen">${n:out("EMAIL_IMG")}</span></b></td> + </tr> + <tr> + <td valign="middle" nowrap="nowrap" align="right"><span class="gen">${n:i18n("L_SKYPE")}:</span></td> + <td class="row1" valign="middle"<span class="gen">${n:out("SKYPE_IMG")}</span></td> + </tr> + <tr> + <td valign="middle" nowrap="nowrap" align="right"><span class="gen">${n:i18n("L_MESSENGER")}:</span></td> + <td class="row1" valign="middle"><span class="gen">${n:out("MSN_IMG")}</span></td> + </tr> + <tr> + <td valign="middle" nowrap="nowrap" align="right"><span class="gen">${n:i18n("L_YAHOO")}:</span></td> + <td class="row1" valign="middle"><span class="gen">${n:out("YIM_IMG")}</span></td> + </tr> + <tr> + <td valign="middle" nowrap="nowrap" align="right"><span class="gen">${n:i18n("L_AIM")}:</span></td> + <td class="row1" valign="middle"><span class="gen">${n:out("AIM_IMG")}</span></td> + </tr> + <tr> + <td valign="middle" nowrap="nowrap" align="right"><span class="gen">${n:i18n("L_ICQ_NUMBER")}:</span></td> + <td class="row1"><script language="JavaScript" type="text/javascript"><!-- + + if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 ) + document.write(' ${n:out("ICQ_IMG")}'); + else + document.write('<table cellspacing="0" cellpadding="0" border="0"><tr><td nowrap="nowrap"><div style="position:relative;height:18px"><div style="position:absolute">${n:out("ICQ_IMG")}</div><div style="position:absolute;left:3px;top:-1px">${n:out("ICQ_STATUS_IMG")}</div></div></td></tr></table>'); + + //--></script><noscript>${n:out("ICQ_IMG")}</noscript></td> + </tr> + </table> + </td> + </tr> +</table> + +<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> + <tr> + <td align="right"><span class="nav"><br/>${n:out("JUMPBOX")}</span></td> + </tr> +</table> + + +</div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-04-18 13:54:52 UTC (rev 3765) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-04-18 17:21:24 UTC (rev 3766) @@ -274,7 +274,7 @@ <tr> <td valign="middle" nowrap="nowrap"> - <h:outputLink value="#{forums:outputLink(shared.links['user'],true)}" style="text-decoration: none;"> + <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}" style="text-decoration: none;"> <f:param name="uid" value="#{postrow.poster.user.id}"/> <f:verbatim> |
From: <jbo...@li...> - 2006-04-18 13:55:06
|
Author: mar...@jb... Date: 2006-04-18 09:54:52 -0400 (Tue, 18 Apr 2006) New Revision: 3765 Added: labs/jbossesb/trunk/Readme.txt Log: Added: labs/jbossesb/trunk/Readme.txt =================================================================== --- labs/jbossesb/trunk/Readme.txt 2006-04-18 12:51:35 UTC (rev 3764) +++ labs/jbossesb/trunk/Readme.txt 2006-04-18 13:54:52 UTC (rev 3765) @@ -0,0 +1,5 @@ +This is the source code repository for JBossESB. This is a work in progress, so the structure may change. + +We are currently at the design and proof-of-concept phase. Check out the JBossESB labs page or developer +forum for more details. + |
From: <jbo...@li...> - 2006-04-18 12:40:34
|
Author: mar...@jb... Date: 2006-04-18 08:40:29 -0400 (Tue, 18 Apr 2006) New Revision: 3763 Added: labs/jbossesb/trunk/JBI/classes/ labs/jbossesb/trunk/JBI/classes/org/ labs/jbossesb/trunk/JBI/classes/org/jboss/ labs/jbossesb/trunk/JBI/classes/org/jboss/soa/ Log: |
From: <jbo...@li...> - 2006-04-18 10:28:30
|
Author: mic...@jb... Date: 2006-04-18 06:28:16 -0400 (Tue, 18 Apr 2006) New Revision: 3762 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: more documentation goodness Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 09:26:20 UTC (rev 3761) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 10:28:16 UTC (rev 3762) @@ -22,7 +22,7 @@ <para>A rule must have a name, and be a unique name for a rule package. If a rule name is to have spaces, then it will need to be in double quotes (its - best to always use double quotes.</para> + best to always use double quotes).</para> <para>Attributes are optional, and are described below (they are best kept as one per line).</para> @@ -35,8 +35,8 @@ <section> <title>Left Hand Side</title> - <para>The Left Hand Side (LHS) is a common the conditional part of the - rule.</para> + <para>The Left Hand Side (LHS) is a common name for the conditional part + of the rule.</para> <para>To interpret the following diagram, refer to the sections below for the details.</para> @@ -235,6 +235,13 @@ effectively caches the results of its matching inbetween invocations to make it faster).</para> + <para>Note that if primitive types are used for a field, Drools will + autobox them to their corresponding object types (even if you are using + java 1.4). On the whole, it is probably best to use the non primitive + types in the model objects you are using in your rules. If you use Java + 5, then you get the best of both worlds (you can let the compiler + autobox for you - much neater).</para> + <section> <title>Operators</title> @@ -521,7 +528,8 @@ </indexterm>Predicate constraint can use any valid Java expression as long as it evaluated to a primitive boolean. Previously bound declarations can be used in the expression. All bound primitive - declarations are boxed, there is currently no auto-unboxing.</para> + declarations are boxed, there is currently no auto-unboxing (if you + use java 5, this is all automatic).</para> <para>This example will find all pairs of male/femal people where the male is 2 years older than the female.</para> @@ -561,7 +569,9 @@ primitives. Previously bound declarations can be used in the expression. All bound primitive declarations are boxed, there is currently no auto-unboxing. The returned value must be boxed if its a - primitive.</para> + primitive (unless you are using Java 5, in which case you don't have + to worry. If you are stuck on Java 1.4, I can recommend some headache + tablets).</para> <para>Like the Predicate example this will find all pairs of male/femal people where the male is 2 years older than the female. @@ -582,7 +592,10 @@ <section> <title>Conditional Elements</title> - <para>uuuere</para> + <para>Conditional elements work on one or more Columns (which were + described above). The most common one is "and" which is implicit when you + have multiple Columns in the LHS of a rule that are not connected in + anyway.</para> <section> <title>'and'</title> @@ -657,11 +670,15 @@ <example> <title>or with binding</title> - <programlisting>pensioner : ( Person( sex == "f", age > 60 ) || Person( sex == "m", age > 65 ) ) -pensioner : ( Person( sex == "f", age > 60 ) or Person( sex == "m", age > 65 ) )</programlisting> + <programlisting>pensioner : Person( sex == "f", age > 60 ) || pensioner : Person( sex == "m", age > 65 ) +pensioner : Person( sex == "f", age > 60 ) or pensioner : Person( sex == "m", age > 65 )</programlisting> </example> - <para></para> + <para>Care must be taken when binding with an "or" conditional element, + as this may yield apparently unpredictable results if both conditions + match (its not XOR). Also, you may accidentally refer to a variable that + is bound to a column that does not exist in a given activation (giving + null pointer exceptions, and the associated headaches).</para> </section> <section> @@ -683,11 +700,24 @@ <para>valid children : none</para> + <para>Eval is essentially a catch all which allows any semantic code + (that returns a boolean) to be executed. This can refer to variables + that were bound in the LHS of the rule, and functions in the rule + package. An eval should be the last conditional element in the LHS of a + rule.</para> + <para>Evals cannot be indexed and thus are not as optimal as using Field Constraints. However this makes them ideal for being used when functions return values that change over time, which is not allowed within Field Constraints.</para> + <para>For folks who are familiar with Drools 2.x lineage, the old Drools + paramater and condition tags are equivalent to:</para> + + <para>p1 : Parameter() p2 : Parameter() </para> + + <para>eval( /* your condition here, involving the parameters */)</para> + <example> <title>or</title> @@ -750,16 +780,22 @@ <para>valid children: Column</para> <para>Future versions of Drools will allow 'and' and 'or' to be nested - in 'not'</para> + in 'not'.</para> + <para>Think of exist as meaning "at least one..". It is different from + just having the Column on its own. If you had the column on its on, its + kind of like saying "for each one of...". if you use exist with a + Column, then the rule will only activate once regardless of how much + data there is in working memory that matches that condition.</para> + <example> - <title>Atleast one Busses</title> + <title>Atleast one Bus</title> <programlisting>exists Bus()</programlisting> </example> <example> - <title>Atleast one red Busses</title> + <title>Atleast one red Bus</title> <programlisting>exists Bus(color == "red")</programlisting> </example> @@ -782,7 +818,8 @@ </mediaobject> </figure> - <para></para> + <para>Grouping is similar to using parentheses in algebra, it makes the + order of operations explicit. </para> </section> </section> </section> \ No newline at end of file |
From: <jbo...@li...> - 2006-04-18 09:26:37
|
Author: mic...@jb... Date: 2006-04-18 05:26:20 -0400 (Tue, 18 Apr 2006) New Revision: 3761 Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/manners/LeapsMannersTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/waltz/LeapsWaltzTest.java Log: uncommented the tests Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/manners/LeapsMannersTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/manners/LeapsMannersTest.java 2006-04-18 08:41:37 UTC (rev 3760) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/manners/LeapsMannersTest.java 2006-04-18 09:26:20 UTC (rev 3761) @@ -25,7 +25,7 @@ public class LeapsMannersTest extends BaseMannersTest { - public void xxxtestManners() throws Exception { + public void testManners() throws Exception { final org.drools.leaps.RuleBaseImpl ruleBase = new org.drools.leaps.RuleBaseImpl(); ruleBase.addPackage( this.pkg ); Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/waltz/LeapsWaltzTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/waltz/LeapsWaltzTest.java 2006-04-18 08:41:37 UTC (rev 3760) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/examples/waltz/LeapsWaltzTest.java 2006-04-18 09:26:20 UTC (rev 3761) @@ -37,7 +37,7 @@ */ public class LeapsWaltzTest extends BaseWaltzTest { - public void xxxtestWaltz() throws Exception { + public void testWaltz() throws Exception { final org.drools.leaps.RuleBaseImpl ruleBase = new org.drools.leaps.RuleBaseImpl(); ruleBase.addPackage( this.pkg ); |
From: <jbo...@li...> - 2006-04-18 08:41:47
|
Author: mic...@jb... Date: 2006-04-18 04:41:37 -0400 (Tue, 18 Apr 2006) New Revision: 3760 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/FunctionFixer.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/KnowledgeHelperFixer.java labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/semantics/java/FunctionFixerTest.java Log: JBRULES-184 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/FunctionFixer.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/FunctionFixer.java 2006-04-18 05:15:49 UTC (rev 3759) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/FunctionFixer.java 2006-04-18 08:41:37 UTC (rev 3760) @@ -55,8 +55,8 @@ if (post != null) { post = fix(post); } - - return pre + matcher.replaceAll(ucFirst(function) + "." + function + "(" + params + ")" ) + post; + String target = ucFirst(function) + "." + function + "(" + params + ")"; + return pre + matcher.replaceAll( KnowledgeHelperFixer.replace( target, "$", "\\$", 128 )) + post; } return raw; } Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/KnowledgeHelperFixer.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/KnowledgeHelperFixer.java 2006-04-18 05:15:49 UTC (rev 3759) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/KnowledgeHelperFixer.java 2006-04-18 08:41:37 UTC (rev 3760) @@ -147,10 +147,10 @@ /** - * Simple replacer. + * Simple non regex replacer. * jakarta commons provided the inspiration for this. */ - private String replace(String text, + static String replace(String text, String repl, String with, int max) Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/semantics/java/FunctionFixerTest.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/semantics/java/FunctionFixerTest.java 2006-04-18 05:15:49 UTC (rev 3759) +++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/semantics/java/FunctionFixerTest.java 2006-04-18 08:41:37 UTC (rev 3760) @@ -57,6 +57,12 @@ FunctionFixer fixer = new FunctionFixer(); assertEquals( "\n\t\n\tAddFive.addFive(list) ;", fixer.fix( "\n\t\n\taddFive ( list ) ;" ) ); - } + } + + public void testWithDollarSigns() { + FunctionFixer fixer = new FunctionFixer(); + assertEquals( "\nFoo.foo($list);", + fixer.fix( "\nfoo($list);" ) ); + } } \ No newline at end of file |
From: <jbo...@li...> - 2006-04-18 05:15:57
|
Author: mic...@jb... Date: 2006-04-18 01:15:49 -0400 (Tue, 18 Apr 2006) New Revision: 3759 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsIDEPlugin.java labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java Log: JBRULES-215 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsIDEPlugin.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsIDEPlugin.java 2006-04-18 05:14:11 UTC (rev 3758) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsIDEPlugin.java 2006-04-18 05:15:49 UTC (rev 3759) @@ -1,4 +1,19 @@ package org.drools.ide; +/* + * Copyright 2005 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.util.HashMap; import java.util.Iterator; Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java 2006-04-18 05:14:11 UTC (rev 3758) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java 2006-04-18 05:15:49 UTC (rev 3759) @@ -1,4 +1,19 @@ package org.drools.ide; +/* + * Copyright 2005 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.net.MalformedURLException; import java.net.URL; |
From: <jbo...@li...> - 2006-04-18 03:52:59
|
Author: mic...@jb... Date: 2006-04-17 23:52:54 -0400 (Mon, 17 Apr 2006) New Revision: 3755 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: update the date documentation Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 03:14:20 UTC (rev 3754) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 03:52:54 UTC (rev 3755) @@ -224,7 +224,7 @@ "getXXX" or "isXXX" methods (these are methods that take no arguments, and return something). You can access fields either by using the bean-name convention (so "getType" can be accessed as "type") or by - specifying the whole method name (without any brackets). </para> + specifying the whole method name (without any brackets).</para> <para>For example, refering to our Cheese class, the following are equivalent: Cheese(type == ...), and Cheese(getType == ...). This means @@ -334,8 +334,11 @@ <simplesect> <title>Date</title> - <para>Currently only "dd-mmm-yyyy" date format is supported. There - are plans to make this configurable in the future.</para> + <para>Currently only "dd-mmm-yyyy" date format is supported by + default. You can customise this by providing an alternative date + format mask as a System property ("drools.dateformat" is the name of + the property). If more control is required, use the predicate + constraint.</para> <para>Valid operators:</para> |
From: <jbo...@li...> - 2006-04-18 03:14:25
|
Author: mic...@jb... Date: 2006-04-17 23:14:20 -0400 (Mon, 17 Apr 2006) New Revision: 3754 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: more goodness Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 02:38:39 UTC (rev 3753) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 03:14:20 UTC (rev 3754) @@ -271,6 +271,10 @@ </indexterm>Literal Constraint which allows the user to constrain a field to a given value.</para> + <para>A note on nulls: you can do checks against fields that are or + maybe null, using == and != as you would expect, and the literal + "null" keyword, like: Cheese(type != null).</para> + <figure> <title>Literal Constraints</title> @@ -467,7 +471,7 @@ </mediaobject> </figure> - <para>Variables can be found to Facts and and Fields and then used in + <para>Variables can be bound to Facts and and Fields and then used in subsequent Field Constraints. A bound variable is called a <indexterm> <primary>declaration</primary> </indexterm>Declaration. Declarations cannot be used with |
From: <jbo...@li...> - 2006-04-18 02:38:44
|
Author: mic...@jb... Date: 2006-04-17 22:38:39 -0400 (Mon, 17 Apr 2006) New Revision: 3753 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: more documentation goodness Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 01:53:46 UTC (rev 3752) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-18 02:38:39 UTC (rev 3753) @@ -18,7 +18,7 @@ <para>The Rule construct is where is all happens. Rules are of the form "IF" something "THEN" action (of course we chose the keywords "when" and "then") - - in the style of production rules. </para> + - in the style of production rules.</para> <para>A rule must have a name, and be a unique name for a rule package. If a rule name is to have spaces, then it will need to be in double quotes (its @@ -35,6 +35,9 @@ <section> <title>Left Hand Side</title> + <para>The Left Hand Side (LHS) is a common the conditional part of the + rule.</para> + <para>To interpret the following diagram, refer to the sections below for the details.</para> @@ -171,13 +174,13 @@ Cheese( type == "stilton", price < 10 )</programlisting> </example> - <para>A Column is what Drools refers calls a list of constraints on an - Object type. The above cases refer to constraints against instances of a - Cheese object. In the first case, there are obviously no constraints, so - this Column will match all instances of Cheese that it finds in working - memory. In the latter case, there are 2 constraints on "fields" that must - be met before the Cheese object will be matched (they are seperated by a - comma, which implicitly means "and").</para> + <para>A Column is what Drools calls a list of constraints on an Object + type. The above cases refer to constraints against instances of a Cheese + object. In the first case, there are obviously no constraints, so this + Column will match all instances of Cheese that it finds in working memory. + In the latter case, there are 2 constraints on "fields" that must be met + before the Cheese object will be matched (they are seperated by a comma, + which implicitly means "and").</para> <figure> <title>Column</title> @@ -201,11 +204,37 @@ <programlisting>cheapStilton : Cheese( type == "stilton", price < 10 )</programlisting> </example> + <para>This is similar to the previous case, but in this case we are + binding a variable to that instance of Cheese that the rule engine will + match. This means you can use cheapStilton in another condition, or + perhaps in the consequence part of the rule. You can also eat it, but I + wouldn't.</para> + <section> <title>Field Constraints</title> - <para>uuuere</para> + <para>Field constraints place constraints on the Fact objects for the + rule engine to match/select out of working memory. They work + comparing/evaluating "field" values from the fact object + instances.</para> + <para>A "field" is not a field in the sense of a public or private + member of a class. A field is an accessible method. If your model + objects follow the java bean pattern, then fields are accessed via + "getXXX" or "isXXX" methods (these are methods that take no arguments, + and return something). You can access fields either by using the + bean-name convention (so "getType" can be accessed as "type") or by + specifying the whole method name (without any brackets). </para> + + <para>For example, refering to our Cheese class, the following are + equivalent: Cheese(type == ...), and Cheese(getType == ...). This means + that you can use model objects that aren't strictly java beans. However, + make sure that you are accessing methods that take no parameters, and + are infact "accessors" (as in, they don't change the state of the object + in a way that may effect the rules - remember that the rule engine + effectively caches the results of its matching inbetween invocations to + make it faster).</para> + <section> <title>Operators</title> @@ -228,7 +257,10 @@ </indexterm>opreators that can be used with the various <indexterm> <primary>Field Constraint</primary> </indexterm>Field Constraints. Valid operators are dependent on the - field type.</para> + field type. Generally they are self explanatory based on the type of + data: for instance, for date fields, "<" means "before" and so on. + "Matches" is only applicable to string fields, and "contains" is only + applicable to Collection type fields.</para> </section> <section> |
From: <jbo...@li...> - 2006-04-18 01:53:54
|
Author: mar...@jb... Date: 2006-04-17 21:53:46 -0400 (Mon, 17 Apr 2006) New Revision: 3752 Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.png labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.vsd Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml Log: -Initial Rework of "What is a rule engine", not finished. Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.png =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.vsd =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Rule_Engine.vsd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml 2006-04-18 00:13:18 UTC (rev 3751) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml 2006-04-18 01:53:46 UTC (rev 3752) @@ -2,49 +2,153 @@ <section> <title>What is a Rule Engine</title> - <para>At the simplest level a <indexterm> - <primary>Rule Engine</primary> - </indexterm>Rule Engine executes a <indexterm> + <para>A <indexterm> + <primary>Rule</primary> + </indexterm>Rule is the codification of business knowledge. A Rule has + attributes, a Left Hand Side (LHS) and a Right Hand Side (RHS). The allowed + attributes are:</para> + + <itemizedlist> + <listitem> + <para>salience</para> + </listitem> + + <listitem> + <para>agenda-group</para> + </listitem> + + <listitem> + <para>no-loop</para> + </listitem> + + <listitem> + <para>auto-focus</para> + </listitem> + + <listitem> + <para>duration</para> + </listitem> + </itemizedlist> + + <programlisting>rule “<name>” + <attribute> <value> + when + <LHS> + then + <RHS> +end +</programlisting> + + <para>The LHS of the Rule consists of one or more Conditions. As the Rule + Engine is made aware of new data or changes to existing data it matches the + data against the Conditions, when all the Conditions are met and true the + RHS, and its actions, are executed; the RHS, called the <indexterm> <primary>Consequence</primary> - </indexterm>Consequence when a set of conditions are true.</para> + </indexterm>Consequence.</para> - <programlisting>when - Cheese( type == "cheddar" ) -then - System.out.println( "cheddar" )</programlisting> + <para>Rules are associated with a namespace via the + <literal>package</literal> keyword. A Package declares imports, global + variables, functions and rules.</para> - <para>The example above is similar to : </para> + <programlisting>package com.sample - <programlisting>if ( cheese.getType().equals("cheddar") { - System.out.println( "cheddar" ) -}</programlisting> +import java.util.List +import com.sample.Cheese - <para>Each Rule consists of a Left Hand Side (LHS) and a Right Hand Side - (RHS)</para> +global List cheeses - <programlisting>when - LHS -then - RHS</programlisting> +function void exampleFunction(Cheese cheese) { + System.out.println( cheese ); +} - <para>The RHS is the Consequence, This is the part of the rule that executes - when all the Patterns in the LHS are matched and true. Pattern is the - terminology used for the various rule constructs that be used to define when - a Rule is true and can fire.</para> +rule “A Cheesy Rule” + when + cheese : Cheese( type == "stilton" ) + then + exampleFunction( cheese ); + cheeses.add( cheese ); +end</programlisting> - <para>Each <indexterm> - <primary>Rule</primary> - </indexterm>Rule is the codification of business knowledge known as the + <para>The process of matching the new or existing modified data against + rules is called <indexterm> + <primary>Pattern Matching</primary> + </indexterm> Pattern Matching, the engine which does this matching is the <indexterm> + <primary>Inference Engine</primary> + </indexterm>Inference Engine. The Rule's are referred to as the <indexterm> <primary>Production Memory</primary> - </indexterm>Production Memory. The Rule Engine is made aware of Business - Objects when they are asserted, as <indexterm> - <primary>Fact</primary> - </indexterm>Facts, into the <indexterm> - <primary>Working Memory</primary> - </indexterm>Working Memory . The Working Memory is the Rule Engine's - repository of all known Facts.</para> + </indexterm>Production Memory and the data that the Inference Engine + matches against is the <indexterm> + <primary>WorkingMemory</primary> + </indexterm>Working Memory. the Agenda manages the execution of the + matched Rules. There are a number of algorithms used for Pattern Matching by + Inference Engines including:</para> + <itemizedlist> + <listitem> + <para>Linear</para> + </listitem> + + <listitem> + <para>Rete</para> + </listitem> + + <listitem> + <para>Treat</para> + </listitem> + + <listitem> + <para>Leaps</para> + </listitem> + </itemizedlist> + + <para>Drools has implementations for both Rete and Leaps; Leaps is still + considered experiment. The Drools <indexterm> + <primary>Rete</primary> + </indexterm>Rete implementation is called ReteOO signifying that this + Drools has an enhanced and optimised implementation of the Rete + algorithm.</para> + + <figure> + <title>A Basic Rete network</title> + + <mediaobject> + <imageobject> + <imagedata align="center" fileref="Rule_Engine.svg" format="SVG" /> + </imageobject> + + <imageobject> + <imagedata align="center" fileref="Rule_Engine.png" format="PNG" /> + </imageobject> + </mediaobject> + </figure> + + <para>The LHS of a rule is made up of <indexterm> + <primary>Conditional Element</primary> + </indexterm>iConditional Elements and <indexterm> + <primary>Field Constraint</primary> + </indexterm>iField Constraints. The following example shows a <indexterm> + <primary>Literal Field Constraint</primary> + </indexterm>iLiteral Field Constraint used with a Cheese Fact; the + combination of Field Constraints on a Fact is known as a <indexterm> + <primary>Column</primary> + </indexterm>iColumn.</para> + + <programlisting>rule "Cheddar Cheese" + when + Cheese( type == "cheddar" ) + then + System.out.println( "cheddar" ); +end</programlisting> + + <para>The example above is similar to :</para> + + <programlisting>public void cheddarCheese(Cheese cheese) { + if ( cheese.getType().equals("cheddar") { + System.out.println( "cheddar" ); + } +}</programlisting> + <para>Rule engines are a complete de-coupling of data from the logic. Rules cannot be called directly as they are not methods or functions instead Rules fire in response to changes in Working Memory's data, It may help to think @@ -80,12 +184,12 @@ <mediaobject> <imageobject> <imagedata align="center" fileref="A_Basic_Rete_Network.svg" - format="SVG" /> + format="SVG" /> </imageobject> <imageobject> <imagedata align="center" fileref="A_Basic_Rete_Network.png" - format="PNG" /> + format="PNG" /> </imageobject> </mediaobject> </figure> |
From: <jbo...@li...> - 2006-04-18 00:13:30
|
Author: mar...@jb... Date: 2006-04-17 20:13:18 -0400 (Mon, 17 Apr 2006) New Revision: 3751 Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/BaseAbstractHandler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Configuration.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/DefaultConfiguration.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Dummy.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/FunctionHandler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalDummy.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalHandler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Handler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportEntryDummy.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportHandler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageHandler.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageReader.java Log: JBRULES-61 XML Parser -Migrate RuleSetReader to work as PackageReader Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/BaseAbstractHandler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/BaseAbstractHandler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/BaseAbstractHandler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,30 @@ +package org.drools.xml; + +import java.util.Set; + +/** + * @author mproctor + * + */ +abstract class BaseAbstractHandler +{ + protected PackageReader packageReader; + protected Set validPeers; + protected Set validParents; + protected boolean allowNesting; + + public Set getValidParents() + { + return this.validParents; + } + + public Set getValidPeers() + { + return this.validPeers; + } + + public boolean allowNesting() + { + return this.allowNesting; + } +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Configuration.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Configuration.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Configuration.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,88 @@ +package org.drools.xml; + +/** + * Configuration passed to a configurable <code>SemanticComponent</code>. + * + * <p> + * A <code>Configuration</code> may actually form a tree-shaped structure in + * order to hold complex configuration data. Each node in the tree is + * represented by a <code>Configuration</code> object that has a name and may + * contain attributes, children and text. + * </p> + * + * @author <a href="mailto:bo...@we...">bob mcwhirter </a> + * + * @version $Id: Configuration.java,v 1.5 2005/01/23 18:16:20 mproctor Exp $ + */ +public interface Configuration +{ + // ---------------------------------------------------------------------- + // Constants + // ---------------------------------------------------------------------- + + /** Empty <code>Configuration</code> array. */ + Configuration[] EMPTY_ARRAY = new Configuration[0]; + + // ---------------------------------------------------------------------- + // Interface + // ---------------------------------------------------------------------- + + /** + * Retrieve the node name. + * + * @return The node name. + */ + String getName(); + + /** + * Retrieve the node text. + * + * @return The node text. + */ + String getText(); + + /** + * Retrieve an attribute value. + * + * @param name The attribute name. + * + * @return The attribute value or <code>null</code> if no attribute + * matches the specified name. + */ + String getAttribute(String name); + + /** + * Retrieve all attribute names. + * + * @return The attribute names. + */ + String[] getAttributeNames(); + + /** + * Retrieve a child node. + * + * @param name The child name. + * + * @return The first child matching the specified name, otherwise + * <code>null</code> if none match. + */ + Configuration getChild(String name); + + /** + * Retrieve children nodes. + * + * @param name The child name. + * + * @return All children matching the specified name, otherwise an empty + * array if none match. + */ + Configuration[] getChildren(String name); + + /** + * Retrieve all children nodes. + * + * @return All children nodes, otherwise an empty array if this node + * contains no children. + */ + Configuration[] getChildren(); +} Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/DefaultConfiguration.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/DefaultConfiguration.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/DefaultConfiguration.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,159 @@ +package org.drools.xml; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Default implementation of <code>Configuration</code>. + * + * @author <a href="mailto:bo...@we...">bob mcwhirter </a> + * + * @version $Id: DefaultConfiguration.java,v 1.2 2004/09/17 00:25:09 mproctor + * Exp $ + */ +public class DefaultConfiguration + implements + Configuration { + // ---------------------------------------------------------------------- + // Class members + // ---------------------------------------------------------------------- + + /** Empty <code>String</code> array. */ + private static final String[] EMPTY_STRING_ARRAY = new String[0]; + + // ---------------------------------------------------------------------- + // Instance members + // ---------------------------------------------------------------------- + + /** Node name. */ + private String name; + + /** Node text. */ + private String text = ""; + + /** Node attributes. */ + private Map attrs; + + /** Children nodes. */ + private List children; + + // ---------------------------------------------------------------------- + // Constructors + // ---------------------------------------------------------------------- + + /** + * Construct. + * + * @param name + * The name of the node. + */ + public DefaultConfiguration(String name) { + this.name = name; + this.attrs = new HashMap(); + this.children = new ArrayList(); + } + + /** + * @see Configuration + */ + public String getName() { + return this.name; + } + + /** + * Set the node text. + * + * @param text + * The text. + */ + public void setText(String text) { + this.text = text; + } + + /** + * @see Configuration + */ + public String getText() { + return this.text; + } + + /** + * Set an attribute value. + * + * @param name + * The attribute name. + * @param value + * The attribute value. + */ + public void setAttribute(String name, + String value) { + this.attrs.put( name, + value ); + } + + /** + * @see Configuration + */ + public String getAttribute(String name) { + return (String) this.attrs.get( name ); + } + + /** + * @see Configuration + */ + public String[] getAttributeNames() { + return (String[]) this.attrs.keySet().toArray( EMPTY_STRING_ARRAY ); + } + + /** + * Add a child <code>Configuration</code>. + * + * @param config + * The child. + */ + public void addChild(Configuration config) { + this.children.add( config ); + } + + /** + * @see Configuration + */ + public Configuration getChild(String name) { + for ( Iterator childIter = this.children.iterator(); childIter.hasNext(); ) { + Configuration eachConfig = (Configuration) childIter.next(); + + if ( eachConfig.getName().equals( name ) ) { + return eachConfig; + } + } + + return null; + } + + /** + * @see Configuration + */ + public Configuration[] getChildren(String name) { + List result = new ArrayList(); + + for ( Iterator childIter = this.children.iterator(); childIter.hasNext(); ) { + Configuration eachConfig = (Configuration) childIter.next(); + + if ( eachConfig.getName().equals( name ) ) { + result.add( eachConfig ); + } + } + + return (Configuration[]) result.toArray( Configuration.EMPTY_ARRAY ); + } + + /** + * @see Configuration + */ + public Configuration[] getChildren() { + return (Configuration[]) this.children.toArray( Configuration.EMPTY_ARRAY ); + } +} Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Dummy.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Dummy.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Dummy.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,5 @@ +package org.drools.xml; + +public class Dummy { + +} Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/FunctionHandler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/FunctionHandler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/FunctionHandler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,86 @@ +package org.drools.xml; + +import java.util.HashSet; + +import org.drools.lang.descr.FunctionDescr; +import org.drools.lang.descr.PackageDescr; +import org.drools.lang.descr.RuleDescr; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * @author mproctor + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +class FunctionHandler extends BaseAbstractHandler implements Handler +{ + FunctionHandler( PackageReader packageReader ) + { + this.packageReader = packageReader; + + if ( (this.validParents == null) && (validPeers == null) ) + { + this.validParents = new HashSet( ); + this.validParents.add( Package.class ); + + this.validPeers = new HashSet( ); + this.validPeers.add( null ); + this.validPeers.add( ImportEntryDummy.class ); + this.validPeers.add( GlobalDummy.class ); + this.validPeers.add( FunctionDescr.class ); + this.validPeers.add( RuleDescr.class ); + + this.allowNesting = false; + } + } + + public Object start( String uri, String localName, Attributes attrs ) throws SAXException + { + packageReader.startConfiguration( localName, attrs ); + return null; + } + + public Object end( String uri, String localName ) throws SAXException + { + Configuration config = packageReader.endConfiguration( ); + + String name = config.getAttribute( "name" ); + if ( name == null || name.trim( ).equals( "" ) ) + { + throw new SAXParseException( + "<function> requires a 'name' attribute", packageReader.getLocator( ) ); + } + + String returnType = config.getAttribute( "returnType" ); + if ( returnType == null || returnType.trim( ).equals( "" ) ) + { + throw new SAXParseException( + "<function> requires a 'returnType' attribute", packageReader.getLocator( ) ); + } + + + FunctionDescr functionDescr = new FunctionDescr(name, returnType); + + Configuration[] parameters = config.getChildren( "parameter" ); + + for ( int i = 0, length = parameters.length; i < length; i++ ) { + functionDescr.addParameter( parameters[i].getAttribute( "identifier" ), parameters[i].getAttribute( "text" ) ); + } + + functionDescr.setText( config.getText() ); + + PackageDescr packageDescr = this.packageReader.getPackageDescr(); + + packageDescr.addFunction( functionDescr ); + + return functionDescr; + } + + public Class generateNodeFor() + { + return FunctionDescr.class; + } +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalDummy.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalDummy.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalDummy.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,5 @@ +package org.drools.xml; + +public class GlobalDummy extends Dummy { + +} Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalHandler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalHandler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/GlobalHandler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,60 @@ +package org.drools.xml; + +import java.util.HashSet; + +import org.drools.lang.descr.FunctionDescr; +import org.drools.lang.descr.PackageDescr; +import org.drools.lang.descr.RuleDescr; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * @author mproctor + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +class GlobalHandler extends BaseAbstractHandler implements Handler +{ + GlobalHandler( PackageReader packageReader ) + { + this.packageReader = packageReader; + + if ( (this.validParents == null) && (validPeers == null) ) + { + this.validParents = new HashSet( ); + this.validParents.add( Package.class ); + + this.validPeers = new HashSet( ); + this.validPeers.add( null ); + this.validPeers.add( ImportEntryDummy.class ); + this.validPeers.add( GlobalDummy.class ); + this.validPeers.add( FunctionDescr.class ); + this.validPeers.add( RuleDescr.class ); + + this.allowNesting = false; + } + } + + public Object start( String uri, String localName, Attributes attrs ) throws SAXException + { + packageReader.startConfiguration( localName, attrs ); + return null; + } + + public Object end( String uri, String localName ) throws SAXException + { + Configuration config = packageReader.endConfiguration( ); + + PackageDescr packageDescr = this.packageReader.getPackageDescr(); + + packageDescr.addGlobal( config.getAttribute( "identifier" ), config.getText() ); + + return new GlobalDummy(); + } + + public Class generateNodeFor() + { + return GlobalDummy.class; + } +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Handler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Handler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/Handler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,28 @@ +package org.drools.xml; + +import java.util.Set; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * @author mproctor + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +interface Handler +{ + + Object start( String uri, String localName, Attributes attrs ) throws SAXException; + + Object end( String uri, String localName ) throws SAXException; + + Set getValidParents(); + + Set getValidPeers(); + + boolean allowNesting(); + + Class generateNodeFor(); +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportEntryDummy.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportEntryDummy.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportEntryDummy.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,5 @@ +package org.drools.xml; + +public class ImportEntryDummy extends Dummy { + +} Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportHandler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportHandler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/ImportHandler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,60 @@ +package org.drools.xml; + +import java.util.HashSet; + +import org.drools.lang.descr.FunctionDescr; +import org.drools.lang.descr.PackageDescr; +import org.drools.lang.descr.RuleDescr; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * @author mproctor + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +class ImportHandler extends BaseAbstractHandler implements Handler +{ + ImportHandler( PackageReader packageReader ) + { + this.packageReader = packageReader; + + if ( (this.validParents == null) && (validPeers == null) ) + { + this.validParents = new HashSet( ); + this.validParents.add( Package.class ); + + this.validPeers = new HashSet( ); + this.validPeers.add( null ); + this.validPeers.add( ImportEntryDummy.class ); + this.validPeers.add( GlobalDummy.class ); + this.validPeers.add( FunctionDescr.class ); + this.validPeers.add( RuleDescr.class ); + + this.allowNesting = false; + } + } + + public Object start( String uri, String localName, Attributes attrs ) throws SAXException + { + packageReader.startConfiguration( localName, attrs ); + return null; + } + + public Object end( String uri, String localName ) throws SAXException + { + Configuration config = packageReader.endConfiguration( ); + + PackageDescr packageDescr = this.packageReader.getPackageDescr(); + + packageDescr.addImport( config.getText() ); + + return new ImportEntryDummy(); + } + + public Class generateNodeFor() + { + return ImportEntryDummy.class; + } +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageHandler.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageHandler.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageHandler.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,61 @@ +package org.drools.xml; + +import java.util.HashSet; + +import org.drools.lang.descr.PackageDescr; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * @author mproctor + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +class PackageHandler extends BaseAbstractHandler implements Handler +{ + PackageHandler( PackageReader packageReader ) + { + this.packageReader = packageReader; + + if ( (this.validParents == null) && (validPeers == null) ) + { + this.validParents = new HashSet( ); + this.validParents.add( null ); + + this.validPeers = new HashSet( ); + this.validPeers.add( null ); + + this.allowNesting = false; + } + } + + public Object start( String uri, String localName, Attributes attrs ) throws SAXException + { + + String ruleSetName = attrs.getValue( "name" ); + + if ( ruleSetName == null || ruleSetName.trim( ).equals( "" ) ) + { + throw new SAXParseException( + "<package> requires a 'name' attribute", packageReader.getLocator( ) ); + } + + PackageDescr packageDescr = new PackageDescr( ruleSetName.trim( ) ); + + + packageReader.setPackageDescr( packageDescr ); + return packageDescr; + } + + public Object end( String uri, String localName ) throws SAXException + { + return null; + } + + public Class generateNodeFor() + { + return PackageDescr.class; + } +} \ No newline at end of file Added: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageReader.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageReader.java 2006-04-17 23:56:20 UTC (rev 3750) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/xml/PackageReader.java 2006-04-18 00:13:18 UTC (rev 3751) @@ -0,0 +1,708 @@ +package org.drools.xml; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.net.URL; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.ListIterator; +import java.util.Map; +import java.util.Set; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.drools.lang.descr.PackageDescr; +import org.drools.lang.descr.RuleDescr; +import org.xml.sax.Attributes; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * <code>RuleSet</code> loader. + * + * Note you can override the default entity resolver by setting the System property of: + * <code>org.drools.io.EntityResolve</code> to your own custom entity resolver. + * This can be done using -Dorg.drools.io.EntityResolver=YourClassHere on the command line, for instance. + * + * @author <a href="mailto:bo...@we...">bob mcwhirter </a> + */ +public class PackageReader extends DefaultHandler { + // ---------------------------------------------------------------------- + // Constants + // ---------------------------------------------------------------------- + public static final String ENTITY_RESOLVER_PROPERTY_NAME = "org.drools.io.EntityResolver"; + + /** Namespace URI for the general tags. */ + public static final String RULES_NAMESPACE_URI = "http://drools.org/rules"; + + private static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + + private static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; + + // ---------------------------------------------------------------------- + // Instance members + // ---------------------------------------------------------------------- + /** SAX parser. */ + private SAXParser parser; + + /** isValidating */ + private boolean isValidating = true; + + /** Locator for errors. */ + private Locator locator; + + // private Map repo; + + /** Stack of configurations. */ + private LinkedList configurationStack; + + /** Current configuration text. */ + private StringBuffer characters; + + private Map handlers; + + private boolean lastWasEndElement; + + private LinkedList parents; + + private Object peer; + + private Object current; + + private PackageDescr packageDescr; + + private boolean inHandledRuleSubElement; + + private MessageFormat message = new MessageFormat( "({0}: {1}, {2}): {3}" ); + + private Map namespaces = new HashMap(); + + EntityResolver entityResolver; + + // ---------------------------------------------------------------------- + // Constructors + // ---------------------------------------------------------------------- + + /** + * Construct. + * + * <p> + * Uses the default JAXP SAX parser and the default classpath-based + * <code>DefaultSemanticModule</code>. + * </p> + */ + public PackageReader() { + // init + this.configurationStack = new LinkedList(); + this.parents = new LinkedList(); + + this.handlers = new HashMap(); + this.handlers.put( "PackageDescr", + null ); + this.handlers.put( "RuleDescr", + null ); + this.handlers.put( "QueryDescr", + null ); + this.handlers.put( "AttributeDescr", + null ); + + this.handlers.put( "FunctionDescr", + null ); + + // Conditional Elements + this.handlers.put( "AndDescr", + null ); + this.handlers.put( "OrDescr", + null ); + this.handlers.put( "NotDescr", + null ); + this.handlers.put( "ExistsDescr", + null ); + + this.handlers.put( "ColumnDescr", + null ); + + // Field Constraints + this.handlers.put( "LiteralDescr", + null ); + this.handlers.put( "PredicateDescr", + null ); + this.handlers.put( "ReturnValueDescr", + null ); + this.handlers.put( "BoundVariableDescr", + null ); + + initEntityResolver(); + + } + + /** + * Construct. + * + * <p> + * Uses the default classpath-based <code>DefaultSemanticModule</code>. + * </p> + * + * @param parser + * The SAX parser. + */ + public PackageReader(SAXParser parser) { + this.parser = parser; + } + + // ---------------------------------------------------------------------- + // Instance methods + // ---------------------------------------------------------------------- + + /** + * Read a <code>RuleSet</code> from a <code>Reader</code>. + * + * @param reader + * The reader containing the rule-set. + * + * @return The rule-set. + */ + public PackageDescr read(Reader reader) throws SAXException, + IOException { + return read( new InputSource( reader ) ); + } + + /** + * Read a <code>RuleSet</code> from an <code>InputStream</code>. + * + * @param inputStream + * The input-stream containing the rule-set. + * + * @return The rule-set. + */ + public PackageDescr read(InputStream inputStream) throws SAXException, + IOException { + return read( new InputSource( inputStream ) ); + } + + /** + * Read a <code>RuleSet</code> from an <code>InputSource</code>. + * + * @param in + * The rule-set input-source. + * + * @return The rule-set. + */ + public PackageDescr read(InputSource in) throws SAXException, + IOException { + SAXParser localParser = null; + if ( this.parser == null ) { + SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware( true ); + + String isValidatingString = System.getProperty( "drools.schema.validating" ); + if ( System.getProperty( "drools.schema.validating" ) != null ) { + this.isValidating = Boolean.getBoolean( "drools.schema.validating" ); + } + + if ( this.isValidating == true ) { + factory.setValidating( true ); + try { + localParser = factory.newSAXParser(); + } catch ( ParserConfigurationException e ) { + throw new RuntimeException( e.getMessage() ); + } + + try { + localParser.setProperty( JAXP_SCHEMA_LANGUAGE, + W3C_XML_SCHEMA ); + } catch ( SAXNotRecognizedException e ) { + boolean hideWarnings = Boolean.getBoolean( "drools.schema.hidewarnings" ); + if ( !hideWarnings ) { + System.err.println( "Your SAX parser is not JAXP 1.2 compliant - turning off validation." ); + } + localParser = null; + } + } + + if ( localParser == null ) { + // not jaxp1.2 compliant so turn off validation + try { + this.isValidating = false; + factory.setValidating( this.isValidating ); + localParser = factory.newSAXParser(); + } catch ( ParserConfigurationException e ) { + throw new RuntimeException( e.getMessage() ); + } + } + } else { + localParser = this.parser; + } + + if ( !localParser.isNamespaceAware() ) { + throw new RuntimeException( "parser must be namespace-aware" ); + } + + localParser.parse( in, + this ); + + return this.packageDescr; + } + + void setPackageDescr(PackageDescr packageDescr) { + this.packageDescr = packageDescr; + } + + PackageDescr getPackageDescr() { + return this.packageDescr; + } + /** + * @see org.xml.sax.ContentHandler + */ + public void setDocumentLocator(Locator locator) { + this.locator = locator; + } + + /** + * Get the <code>Locator</code>. + * + * @return The locator. + */ + public Locator getLocator() { + return this.locator; + } + + public void startDocument() { + this.isValidating = true; + this.packageDescr = null; + this.current = null; + this.peer = null; + this.lastWasEndElement = false; + this.parents.clear(); + this.characters = null; + this.configurationStack.clear(); + this.namespaces.clear(); + } + + /** + * @param uri + * @param localName + * @param qname + * @param attrs + * @throws SAXException + * @see org.xml.sax.ContentHandler + * + * @todo: better way to manage unhandled elements + */ + public void startElement(String uri, + String localName, + String qname, + Attributes attrs) throws SAXException { + // going down so no peer + if ( !this.lastWasEndElement ) { + this.peer = null; + } + + Handler handler = getHandler( localName ); + + if ( (handler != null) && (!this.parents.isEmpty() && this.parents.getLast() instanceof RuleDescr) ) { + this.inHandledRuleSubElement = true; + } + + if ( handler == null ) { + if ( ((this.inHandledRuleSubElement == false) && (this.parents.getLast() instanceof RuleDescr)) || (this.parents.getLast() instanceof PackageDescr) ) { + throw new SAXParseException( "unknown tag '" + localName + "' in namespace '" + uri + "'", + getLocator() ); + } + // no handler so build up the configuration + startConfiguration( localName, + attrs ); + return; + } + + validate( uri, + localName, + handler ); + + Object node = handler.start( uri, + localName, + attrs ); + + if ( node != null ) { + this.parents.add( node ); + this.current = node; + } + this.lastWasEndElement = false; + } + + /** + * @param uri + * @param localName + * @param qname + * @throws SAXException + * @see org.xml.sax.ContentHandler + */ + public void endElement(String uri, + String localName, + String qname) throws SAXException { + Handler handler = getHandler( localName ); + + if ( (handler != null) && (!this.parents.isEmpty() && this.parents.getLast() instanceof RuleDescr) ) { + this.inHandledRuleSubElement = false; + } + + if ( handler == null ) { + if ( this.configurationStack.size() >= 1 ) { + endConfiguration(); + } + return; + } + + this.current = getParent( handler.generateNodeFor() ); + + Object node = handler.end( uri, + localName ); + + // next + if ( node != null && !this.lastWasEndElement ) { + this.peer = node; + } + // up or no children + else if ( this.lastWasEndElement || (this.parents.getLast()).getClass().isInstance( this.current ) ) { + this.peer = this.parents.removeLast(); + } + + this.lastWasEndElement = true; + } + + private void validate(String uri, + String localName, + Handler handler) throws SAXParseException { + boolean validParent = false; + boolean validPeer = false; + boolean invalidNesting = false; + + Set validParents = handler.getValidParents(); + Set validPeers = handler.getValidPeers(); + boolean allowNesting = handler.allowNesting(); + + // get parent + Object parent; + if ( this.parents.size() != 0 ) { + parent = this.parents.getLast(); + } else { + parent = null; + } + + // check valid parents + // null parent means localname is rule-set + // dont process if elements are the same + // instead check for allowed nesting + Class nodeClass = getHandler( localName ).generateNodeFor(); + if ( !nodeClass.isInstance( parent ) ) { + Object allowedParent; + Iterator it = validParents.iterator(); + while ( !validParent && it.hasNext() ) { + allowedParent = it.next(); + if ( parent == null && allowedParent == null ) { + validParent = true; + } else if ( allowedParent != null && ((Class) allowedParent).isInstance( parent ) ) { + validParent = true; + } + } + if ( !validParent ) { + throw new SAXParseException( "<" + localName + "> has an invalid parent element", + getLocator() ); + } + } + + // check valid peers + // null peer means localname is rule-set + Object peer = this.peer; + + Object allowedPeer; + Iterator it = validPeers.iterator(); + while ( !validPeer && it.hasNext() ) { + allowedPeer = it.next(); + if ( peer == null && allowedPeer == null ) { + validPeer = true; + } else if ( allowedPeer != null && ((Class) allowedPeer).isInstance( peer ) ) { + validPeer = true; + } + } + if ( !validPeer ) { + throw new SAXParseException( "<" + localName + "> is after an invalid element", + getLocator() ); + } + + if ( !allowNesting ) { + it = this.parents.iterator(); + while ( !invalidNesting && it.hasNext() ) { + if ( nodeClass.isInstance( it.next() ) ) { + invalidNesting = true; + } + } + } + if ( invalidNesting ) { + throw new SAXParseException( "<" + localName + "> may not be nested", + getLocator() ); + } + + } + + /** + * Start a configuration node. + * + * @param name + * Tag name. + * @param attrs + * Tag attributes. + */ + protected void startConfiguration(String name, + Attributes attrs) { + this.characters = new StringBuffer(); + + DefaultConfiguration config = new DefaultConfiguration( name ); + + int numAttrs = attrs.getLength(); + + for ( int i = 0; i < numAttrs; ++i ) { + config.setAttribute( attrs.getLocalName( i ), + attrs.getValue( i ) ); + } + + // lets add the namespaces as attributes + for ( Iterator iter = namespaces.entrySet().iterator(); iter.hasNext(); ) { + Map.Entry entry = (Map.Entry) iter.next(); + String ns = (String) entry.getKey(); + String value = (String) entry.getValue(); + if ( ns == null || ns.length() == 0 ) { + ns = "xmlns"; + } else { + ns = "xmlns:" + ns; + } + config.setAttribute( ns, + value ); + } + + if ( this.configurationStack.isEmpty() ) { + this.configurationStack.addLast( config ); + } else { + ((DefaultConfiguration) this.configurationStack.getLast()).addChild( config ); + this.configurationStack.addLast( config ); + } + } + + Handler getHandler(String localName) { + return (Handler) this.handlers.get( localName ); + } + + /** + * @param chars + * @param start + * @param len + * @see org.xml.sax.ContentHandler + */ + public void characters(char[] chars, + int start, + int len) { + if ( this.characters != null ) { + this.characters.append( chars, + start, + len ); + } + } + + /** + * End a configuration node. + * + * @return The configuration. + */ + protected Configuration endConfiguration() { + DefaultConfiguration config = (DefaultConfiguration) this.configurationStack.removeLast(); + if ( this.characters != null ) { + config.setText( this.characters.toString() ); + } + + this.characters = null; + + return config; + } + + LinkedList getParents() { + return this.parents; + } + + Object getParent(Class parent) { + ListIterator it = this.parents.listIterator( this.parents.size() ); + Object node = null; + while ( it.hasPrevious() ) { + node = it.previous(); + if ( parent.isInstance( node ) ) break; + } + return node; + } + + Object getPeer() { + return this.peer; + } + + Object getCurrent() { + return this.current; + } + + public InputSource resolveEntity(String publicId, + String systemId) throws SAXException { + try { + InputSource inputSource = resolveSchema( publicId, + systemId ); + if ( inputSource != null ) { + return inputSource; + } + if ( entityResolver != null ) { + return entityResolver.resolveEntity( publicId, + systemId ); + } + } catch ( IOException ioe ) { + } + return null; + } + + public void startPrefixMapping(String prefix, + String uri) throws SAXException { + super.startPrefixMapping( prefix, + uri ); + namespaces.put( prefix, + uri ); + } + + public void endPrefixMapping(String prefix) throws SAXException { + super.endPrefixMapping( prefix ); + namespaces.remove( prefix ); + } + + private void print(SAXParseException x) { + String msg = this.message.format( new Object[]{x.getSystemId(), new Integer( x.getLineNumber() ), new Integer( x.getColumnNumber() ), x.getMessage()} ); + System.out.println( msg ); + } + + public void warning(SAXParseException x) { + print( x ); + } + + public void error(SAXParseException x) { + print( x ); + } + + public void fatalError(SAXParseException x) throws SAXParseException { + print( x ); + throw x; + } + + private InputSource resolveSchema(String publicId, + String systemId) throws SAXException, + IOException { + // Schema files must end with xsd + if ( !systemId.toLowerCase().endsWith( "xsd" ) ) { + return null; + } + + // try the actual location given by systemId + try { + URL url = new URL( systemId ); + return new InputSource( url.openStream() ); + } catch ( Exception e ) { + } + + // Try and get the index for the filename, else return null + String xsd; + int index = systemId.lastIndexOf( "/" ); + if ( index == -1 ) { + index = systemId.lastIndexOf( "\\" ); + } + if ( index != -1 ) { + xsd = systemId.substring( index + 1 ); + } else { + xsd = systemId; + } + + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + + if ( cl == null ) { + cl = PackageReader.class.getClassLoader(); + } + + // Try looking in META-INF + try { + return new InputSource( cl.getResourceAsStream( "META-INF/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try looking in /META-INF + try { + return new InputSource( cl.getResourceAsStream( "/META-INF/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try looking at root of classpath + try { + return new InputSource( cl.getResourceAsStream( "/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try current working directory + try { + return new InputSource( new BufferedInputStream( new FileInputStream( xsd ) ) ); + } catch ( Exception e ) { + } + + cl = ClassLoader.getSystemClassLoader(); + + // Try looking in META-INF + try { + return new InputSource( cl.getResourceAsStream( "META-INF/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try looking in /META-INF + try { + return new InputSource( cl.getResourceAsStream( "/META-INF/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try looking at root of classpath + try { + return new InputSource( cl.getResourceAsStream( "/" + xsd ) ); + } catch ( Exception e ) { + } + + // Try current working directory + try { + return new InputSource( new BufferedInputStream( new FileInputStream( xsd ) ) ); + } catch ( Exception e ) { + } + return null; + } + + /** + * Intializes EntityResolver that is configured via system property ENTITY_RESOLVER_PROPERTY_NAME. + */ + private void initEntityResolver() { + String entityResolveClazzName = System.getProperty( ENTITY_RESOLVER_PROPERTY_NAME ); + if ( entityResolveClazzName != null && entityResolveClazzName.length() > 0 ) { + try { + Class entityResolverClazz = Thread.currentThread().getContextClassLoader().loadClass( entityResolveClazzName ); + entityResolver = (EntityResolver) entityResolverClazz.newInstance(); + } catch ( Exception ignoreIt ) { + } + } + } + +} |
From: <jbo...@li...> - 2006-04-17 23:56:27
|
Author: unibrew Date: 2006-04-17 19:56:20 -0400 (Mon, 17 Apr 2006) New Revision: 3750 Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/jumpbox.xhtml Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml Log: [JBFORUMS-37] Adding Jumpbox feature to TopicView and ForumsView. Added: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java 2006-04-17 23:17:35 UTC (rev 3749) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java 2006-04-17 23:56:20 UTC (rev 3750) @@ -0,0 +1,59 @@ +/* +* 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.view; + +import java.util.List; + +import org.jboss.portlet.forums.ui.BaseController; +import org.jboss.portlet.forums.ui.Constants; +import org.jboss.portlet.forums.ui.ForumUtil; +import org.jboss.portlet.forums.ui.JSFUtil; + +/** + * @author <a href="mailto:rys...@jb...">Ryszard Kozmik</a> + */ +public class ViewJumpbox extends BaseController +{ + + /** + * @author Ryszard Kozmik + */ + public ViewJumpbox () { + super(); + } + + public List getCategories() + { + try + { + return getForumsModule().findCategories(); + } + catch(Exception e) + { + JSFUtil.handleException(e); + } + return null ; + } + + +} 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-04-17 23:17:35 UTC (rev 3749) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-04-17 23:56:20 UTC (rev 3750) @@ -160,4 +160,9 @@ <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewTopic</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> + <managed-bean> + <managed-bean-name>jumpbox</managed-bean-name> + <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewJumpbox</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> </faces-config> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2006-04-17 23:17:35 UTC (rev 3749) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2006-04-17 23:56:20 UTC (rev 3750) @@ -319,6 +319,7 @@ </td> <td align="right"> <span class="gensmall"> + <ui:include src="/views/jumpbox.xhtml"/> <!-- TODO: hookup real data here...need to extract out the hardcoded html code from the original portlet --> <!-- S_AUTH_LIST --> </span> Added: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/jumpbox.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/jumpbox.xhtml 2006-04-17 23:17:35 UTC (rev 3749) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/jumpbox.xhtml 2006-04-17 23:56:20 UTC (rev 3750) @@ -0,0 +1,64 @@ +<!-- +/* +* 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"> + + <form method="post" name="jumpbox" + action="#{forums:outputLink(shared.links['forum'],true)}" + onSubmit="if(document.jumpbox.f.value == -1){return false;}"> + <table cellspacing="0" cellpadding="0" border="0" align="right"> + <tr> + <td nowrap="nowrap" valign="top" align="right"> + <span class="gensmall" align="right"> + ${resource.Jump_to}:&nbsp; + <select name="f" + onchange="if(this.options[this.selectedIndex].value != -1){ forms['jumpbox'].submit() }" > + <option value="-1">${resource.Select_forum}</option> + <c:forEach items="${jumpbox.categories}" + var="category"> + <option value="-1"></option> + <option value="-1">${category.title}</option> + <option value="-1">----------------</option> + <c:forEach items="${category.forums}" + var="forum"> + <option value="${forum.id}"> + ${forum.name} + </option> + </c:forEach> + </c:forEach> + </select> + &nbsp; + <input type="submit" value="${resource.Go}" + class="liteoption"/> + </span> + </td> + </tr> + </table> + </form> +</div> \ No newline at end of file Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-04-17 23:17:35 UTC (rev 3749) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2006-04-17 23:56:20 UTC (rev 3750) @@ -535,55 +535,57 @@ <br/> </td> --> - <script language='JavaScript' type='text/javascript'> - <!-- - function checkForm() - { - formErrors = false; - if (document.post.message.value.length < 2) - { - formErrors = 'Vous devez entrer un message avant de poster.'; - } - if (formErrors) - { - alert(formErrors); - return false; - } - else - { - return true; - } - } - --> - </script> + <script language='JavaScript' type='text/javascript'> + <!-- + function checkForm() + { + formErrors = false; + if (document.post.message.value.length < 2) + { + formErrors = 'Vous devez entrer un message avant de poster.'; + } + if (formErrors) + { + alert(formErrors); + return false; + } + else + { + return true; + } + } + --> + </script> <!-- TODO: SECURITY CHECK NEEDED--> + <!-- TODO: THIS INSTANT REPLY BOX IS WAITING FOR POSTINGVIEW UPDATE TO SUPPORT REPLYING <td> - <!--form action='${n:out("U_REPLY_SUBMIT")}' method="post" name="post" - onsubmit="return checkForm(this)"> + <h:form name="post" onsubmit="return checkForm(this)" > <span class="genmed"> - <b>${n:i18n("Instant_reply")}</b> + <b>${resource.Instant_reply}</b> <br/> <br/> - <textarea class="post" name="message" rows="10" cols="50" - wrap="virtual"></textarea> + <h:inputTextarea class="post" name="message" rows="10" cols="50" wrap="virtual"> + </h:inputTextarea> <br/> - ${n:out("S_INSTANT_REPLY_HIDDEN_FORM_FIELDS")} <br/> + <input type="hidden" name="f" value="#{newTopic.forumId}"/> + <input type="hidden" name="t" value="#{newTopic.topicId}"/> <input type="submit" name="preview" class="liteoption" value='${n:i18n("Preview")}'/> &nbsp; <input type="submit" name="post" class="mainoption" value='${n:i18n("Submit")}'/> </span> - </form--> - </td> - <!--td align="right" valign="top" nowrap="nowrap"> - ${n:out("JUMPBOX")} - <span class="gensmall">${n:out("S_AUTH_LIST")}</span> - </td--> + </form> + </td>--> + <!-- TODO: IN THIS PLACE THE JUMPBOXVIEW SHOULD BE INCLUDED--> + <td align="right" valign="top" nowrap="nowrap"> + <ui:include src="/views/jumpbox.xhtml"/> + <!--<span class="gensmall">${n:out("S_AUTH_LIST")}</span>--> + </td> </tr> - <!-- TODO: SECURITY CHECK NEEDED AND REIMPLEMENTATION OF HARDCODED HTML IN PORTLET + <!-- TODO: SECURITY CHECK NEEDED, REIMPLEMENTATION OF HARDCODED HTML IN PORTLET WHICH NEEDS MODERATOR VIEWS <tr> <td> ${n:out("S_TOPIC_ADMIN")} |
From: <jbo...@li...> - 2006-04-17 23:17:39
|
Author: soh...@jb... Date: 2006-04-17 19:17:35 -0400 (Mon, 17 Apr 2006) New Revision: 3749 Modified: labs/jbossforums/trunk/forums/build.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-ear/META-INF/application.xml Log: fixed classnotfound issues with the war file Modified: labs/jbossforums/trunk/forums/build.xml =================================================================== --- labs/jbossforums/trunk/forums/build.xml 2006-04-17 23:06:50 UTC (rev 3748) +++ labs/jbossforums/trunk/forums/build.xml 2006-04-17 23:17:35 UTC (rev 3749) @@ -196,13 +196,13 @@ <!-- portal-forums-ui.jar --> <jar jarfile="${build.lib}/portal-forums-ui.jar"> <fileset dir="${build.classes}"/> - </jar> + </jar> <!-- portal-forums.war --> <jar jarfile="${build.lib}/portal-forums.war" manifest="${build.etc}/portal-forums-war.mf"> <fileset dir="${build.resources}/portal-forums-war"/> <fileset dir="${source.bin}/portal-forums-war"/> - </jar> + </jar> <!-- portal-forums.sar --> <jar jarfile="${build.lib}/portal-forums.sar"> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-ear/META-INF/application.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-ear/META-INF/application.xml 2006-04-17 23:06:50 UTC (rev 3748) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-ear/META-INF/application.xml 2006-04-17 23:17:35 UTC (rev 3749) @@ -2,9 +2,12 @@ <application> <display-name>JBoss Forums</display-name> <module> + <java>portal-forums-ui.jar</java> + </module> + <module> <web> <web-uri>portal-forums.war</web-uri> <!--context-root>/forums</context-root--> </web> - </module> + </module> </application> |
From: <jbo...@li...> - 2006-04-17 23:06:54
|
Author: KrisVerlaenen Date: 2006-04-17 19:06:50 -0400 (Mon, 17 Apr 2006) New Revision: 3748 Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java Log: removed some unused imports Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java 2006-04-17 23:04:51 UTC (rev 3747) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java 2006-04-17 23:06:50 UTC (rev 3748) @@ -10,7 +10,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.drools.ide.editors.completion.RuleCompletionProposal; import org.drools.lang.dsl.template.NLGrammar; import org.drools.lang.dsl.template.NLMappingItem; import org.eclipse.core.resources.IFile; 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-04-17 23:04:51 UTC (rev 3747) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java 2006-04-17 23:06:50 UTC (rev 3748) @@ -7,18 +7,10 @@ import org.drools.ide.DroolsIDEPlugin; import org.drools.ide.editors.DRLRuleEditor; import org.drools.ide.editors.DSLAdapter; -import org.eclipse.core.resources.IProject; -import org.eclipse.jdt.core.CompletionRequestor; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.part.FileEditorInput; - - /** * For handling within rules, including DSLs. * At present this provides a fixed list, plus what is available |
Author: KrisVerlaenen Date: 2006-04-17 19:04:51 -0400 (Mon, 17 Apr 2006) New Revision: 3747 Added: labs/jbossrules/trunk/drools-ide/icons/class_obj.gif labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/AbstractCompletionProcessor.java Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java 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/RuleCompletionProcessor.java labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProposal.java labs/jbossrules/trunk/drools-ide/src/test/java/org/drools/ide/editors/completion/DRLCompletionProcessorTest.java Log: updated code completion Added: labs/jbossrules/trunk/drools-ide/icons/class_obj.gif =================================================================== (Binary files differ) Property changes on: labs/jbossrules/trunk/drools-ide/icons/class_obj.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java 2006-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/DroolsPluginImages.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -27,6 +27,8 @@ public static final String CREATE_ACTIVATION = "CreateActivation"; public static final String CANCEL_ACTIVATION = "CancelActivation"; public static final String EXECUTE_ACTIVATION = "ExecuteActivation"; + public static final String CLASS = "Class"; + public static final String PACKAGE = "Package"; private static ImageRegistry imageRegistry; private static final String PATH_SUFFIX = "/icons/"; @@ -47,6 +49,8 @@ declareRegistryImage(CREATE_ACTIVATION, "arrowright.GIF"); declareRegistryImage(CANCEL_ACTIVATION, "arrowleft.GIF"); declareRegistryImage(EXECUTE_ACTIVATION, "bluediamond.GIF"); + declareRegistryImage(CLASS, "class_obj.gif"); + declareRegistryImage(PACKAGE, "package_obj.gif"); } /** Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java 2006-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/DSLAdapter.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -107,20 +107,18 @@ List conditions = grammar.getMappings( "when" ); List consequences = grammar.getMappings( "then" ); - conditionProposals = new ArrayList(conditions.size()); - consequenceProposals = new ArrayList(consequences.size()); - - buildProposals( conditions, conditionProposals ); - buildProposals( consequences, consequenceProposals ); - + conditionProposals = buildProposals(conditions); + consequenceProposals = buildProposals(consequences); } - private void buildProposals(List suggestions, List proposals) { - for ( Iterator iter = suggestions.iterator(); iter.hasNext(); ) { - NLMappingItem text = (NLMappingItem) iter.next(); - RuleCompletionProposal proposal = new RuleCompletionProposal(text.getNaturalTemplate()); - proposals.add(proposal); + private List buildProposals(List suggestions) { + List result = new ArrayList(suggestions.size()); + Iterator iterator = suggestions.iterator(); + while (iterator.hasNext()) { + NLMappingItem text = (NLMappingItem) iterator.next(); + result.add(text.getNaturalTemplate()); } + return result; } private void closeStream(InputStream stream) { Added: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/AbstractCompletionProcessor.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/AbstractCompletionProcessor.java 2006-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/AbstractCompletionProcessor.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -0,0 +1,113 @@ +package org.drools.ide.editors.completion; + +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.contentassist.CompletionProposal; +import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.text.contentassist.IContextInformation; +import org.eclipse.jface.text.contentassist.IContextInformationValidator; +import org.eclipse.ui.part.EditorPart; + + +/** + * + * @author <a href="mailto:kri...@ho...">kris verlaenen </a> + */ +public abstract class AbstractCompletionProcessor implements IContentAssistProcessor { + + private EditorPart editor; + + public AbstractCompletionProcessor(EditorPart editor) { + this.editor = editor; + } + + protected EditorPart getEditor() { + return editor; + } + + public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { + List proposals = getCompletionProposals(viewer, documentOffset); + if (proposals == null) { + return new ICompletionProposal[0]; + } + Collections.sort(proposals, new RuleCompletionProposal.RuleCompletionProposalComparator()); + ICompletionProposal[] result = makeProposals(proposals, documentOffset); + return result; + } + + /** + * Returns a list of RuleCompletionProposals. + * + * @param viewer + * @param documentOffset + * @return + */ + protected abstract List getCompletionProposals(ITextViewer viewer, int documentOffset); + + protected ICompletionProposal[] makeProposals(List props, int documentOffset) { + ICompletionProposal[] result = new ICompletionProposal[props.size()]; + Iterator iterator = props.iterator(); + int i = 0; + while (iterator.hasNext()) { + RuleCompletionProposal proposal = (RuleCompletionProposal) iterator.next(); + result[i++] = new CompletionProposal(proposal.getContent(), + documentOffset - proposal.getReplacementLength(), proposal.getReplacementLength(), + proposal.getCursorPosition(), proposal.getImage(), proposal.getDisplay(), null, null); + } + return result; + } + + /** + * Filter out the proposals whose content does not start with the given prefix. + */ + protected void filterProposalsOnPrefix(String prefix, List props) { + if (prefix != null) { + Iterator iterator = props.iterator(); + while ( iterator.hasNext() ) { + RuleCompletionProposal item = (RuleCompletionProposal) iterator.next(); + if (!item.getContent().startsWith(prefix)) { + iterator.remove(); + } + } + } + } + + /* + * @see IContentAssistProcessor + */ + public char[] getCompletionProposalAutoActivationCharacters() { + return null; + } + + /* + * @see IContentAssistProcessor + */ + public char[] getContextInformationAutoActivationCharacters() { + return null; + } + + /* + * @see IContentAssistProcessor + */ + public IContextInformationValidator getContextInformationValidator() { + return null; + } + + /* + * @see IContentAssistProcessor + */ + public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { + return null; + } + + /* + * @see IContentAssistProcessor + */ + public String getErrorMessage() { + return null; + } +} 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-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/DefaultCompletionProcessor.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -1,11 +1,11 @@ package org.drools.ide.editors.completion; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.regex.Pattern; import org.drools.ide.DroolsIDEPlugin; +import org.drools.ide.DroolsPluginImages; import org.eclipse.core.resources.IProject; import org.eclipse.jdt.core.CompletionRequestor; import org.eclipse.jdt.core.IJavaProject; @@ -13,12 +13,6 @@ import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jface.text.contentassist.CompletionProposal; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.part.EditorPart; @@ -29,100 +23,47 @@ * partition. * The provides the content assistance for basic rule assembly stuff. * - * Subclasses enhance this when a user is actually editing a rule. - * * This processor will also read behind the current editing position, to provide some context to * help provide the pop up list. * * @author Michael Neale */ -public class DefaultCompletionProcessor implements IContentAssistProcessor { +public class DefaultCompletionProcessor extends AbstractCompletionProcessor { private static final String NEW_RULE_TEMPLATE = "rule \"new rule\"\n\n\twhen\n\n\tthen\n\nend"; private static final String NEW_QUERY_TEMPLATE = "query \"query name\"\n\t#conditions\nend"; private static final String NEW_FUNCTION_TEMPLATE = "function void yourFunction(Type arg) {\n\t/* code goes here*/\n}"; private static final Pattern IMPORT_PATTERN = Pattern.compile(".*\\Wimport\\W[^;]*", Pattern.DOTALL); - private EditorPart editor; - - public DefaultCompletionProcessor() { - } - public DefaultCompletionProcessor(EditorPart editor) { - this.editor = editor; + super(editor); } - /** Subclasses *should* override this to change the list. */ - protected List getPossibleProposals(ITextViewer viewer, String backText) { - List list = new ArrayList(); - list.add(new RuleCompletionProposal("rule", NEW_RULE_TEMPLATE, 6)); - list.add(new RuleCompletionProposal("import")); - list.add(new RuleCompletionProposal("expander")); - list.add(new RuleCompletionProposal("global")); - list.add(new RuleCompletionProposal("package")); - list.add(new RuleCompletionProposal("query", NEW_QUERY_TEMPLATE)); - list.add(new RuleCompletionProposal("function", NEW_FUNCTION_TEMPLATE)); - return list; - } - - - /** - * This will filter based on what was typed in previously. - */ - public ICompletionProposal[] computeCompletionProposals( - ITextViewer viewer, - int documentOffset) { - -// partitionDebug( viewer, -// documentOffset ); - - Offset offset = new Offset(documentOffset); - - + protected List getCompletionProposals(ITextViewer viewer, int documentOffset) { try { - IDocument doc = viewer.getDocument(); - - - String backText = readBackwards( offset, - doc ); - - //System.out.println("back text: " + backText); - - if (doesPrefixExist(backText)) { - String prefix = stripWhiteSpace(backText); - offset.prefix = prefix; - } - - List props = null; - if (IMPORT_PATTERN.matcher(backText).matches()) { - String classNameStart = backText.substring(backText.lastIndexOf("import") + 7); - props = getAllClassProposals(classNameStart); - } else { - props = getPossibleProposals(viewer, backText); - props = filterProposals(offset, props); - } - Collections.sort(props, new RuleCompletionProposal.RuleCompletionProposalComparator()); - - ICompletionProposal[] result = new ICompletionProposal[props.size()]; - for (int i = 0; i < props.size(); i++) { - result[i] = makeProposal( documentOffset, - offset, - props, - i ); - } - return result; - - } catch (BadLocationException e) { + IDocument doc = viewer.getDocument(); + String backText = readBackwards( documentOffset, doc ); + + String prefix = ""; + prefix = stripWhiteSpace(backText); + + List props = null; + if (IMPORT_PATTERN.matcher(backText).matches()) { + String classNameStart = backText.substring(backText.lastIndexOf("import") + 7); + props = getAllClassProposals(classNameStart, documentOffset); + } else { + props = getPossibleProposals(viewer, documentOffset, backText, prefix); + } + return props; + } catch (Throwable t) { + DroolsIDEPlugin.log(t); } - return null; - } - - private List getAllClassProposals(String classNameStart) { + private List getAllClassProposals(final String classNameStart, final int documentOffset) { final List list = new ArrayList(); - IEditorInput input = editor.getEditorInput(); + IEditorInput input = getEditor().getEditorInput(); if (input instanceof IFileEditorInput) { IProject project = ((IFileEditorInput) input).getFile().getProject(); IJavaProject javaProject = JavaCore.create(project); @@ -130,13 +71,22 @@ CompletionRequestor requestor = new CompletionRequestor() { public void accept(org.eclipse.jdt.core.CompletionProposal proposal) { String className = new String(proposal.getCompletion()); - String completion = className + (proposal.getKind() == org.eclipse.jdt.core.CompletionProposal.PACKAGE_REF ? "." : ";"); - list.add(new RuleCompletionProposal(className, completion)); + System.out.println(className); + if (proposal.getKind() == org.eclipse.jdt.core.CompletionProposal.PACKAGE_REF) { + RuleCompletionProposal prop = new RuleCompletionProposal(classNameStart.length(), className, className + "."); + prop.setImage(DroolsPluginImages.getImage(DroolsPluginImages.PACKAGE)); + list.add(prop); + } else if (proposal.getKind() == org.eclipse.jdt.core.CompletionProposal.TYPE_REF) { + RuleCompletionProposal prop = new RuleCompletionProposal(classNameStart.length(), className, className + ";"); + prop.setImage(DroolsPluginImages.getImage(DroolsPluginImages.CLASS)); + list.add(prop); + } + // ignore all other proposals } }; try { - javaProject.newEvaluationContext().codeComplete("import " + classNameStart, classNameStart.length() + 7, requestor); + javaProject.newEvaluationContext().codeComplete(classNameStart, classNameStart.length(), requestor); } catch (Throwable t) { DroolsIDEPlugin.log(t); } @@ -144,163 +94,54 @@ return list; } - /** - * Just used for debugging, when it all gets to much. - */ - private void partitionDebug(ITextViewer viewer, - int documentOffset) { - try { - ITypedRegion region = viewer.getDocument().getPartition(documentOffset); - System.out.println("Region type: " + region.getType()); - System.out.println("Offset: " + documentOffset); - System.out.println("Region offset: " + region.getOffset()); - System.out.println("Region length: " + region.getLength()); - - - } - catch ( BadLocationException e1 ) { - - e1.printStackTrace(); - } + protected List getPossibleProposals(ITextViewer viewer, int documentOffset, String backText, final String prefix) { + List list = new ArrayList(); + list.add(new RuleCompletionProposal(prefix.length(), "rule", NEW_RULE_TEMPLATE, 6)); + list.add(new RuleCompletionProposal(prefix.length(), "import", "import ")); + list.add(new RuleCompletionProposal(prefix.length(), "expander", "expander ")); + list.add(new RuleCompletionProposal(prefix.length(), "global", "global ")); + list.add(new RuleCompletionProposal(prefix.length(), "package", "package ")); + list.add(new RuleCompletionProposal(prefix.length(), "query", NEW_QUERY_TEMPLATE)); + list.add(new RuleCompletionProposal(prefix.length(), "function", NEW_FUNCTION_TEMPLATE)); + filterProposalsOnPrefix(prefix, list); + return list; } - - protected CompletionProposal makeProposal(int documentOffset, - Offset offset, - List props, - int i) { - RuleCompletionProposal proposal = (RuleCompletionProposal) props.get(i); - -// return new CompletionProposal(replacement, -// documentOffset - offset.getPrefixLength(), offset.getPrefixLength(), replacement.length()); - return new CompletionProposal(proposal.getContent(), - documentOffset - offset.getPrefixLength(), offset.getPrefixLength(), proposal.getOffset(), - null, proposal.getDisplay(), null, null); - - } - - - - - /** Filter the proposals based on what was typed. */ - private List filterProposals(Offset offset, List props) throws BadLocationException { - if (offset.prefix != null) { - props = filterList(props, offset.prefix); - } - return props; - } - - /** * Read some text from behind the cursor position. * This provides context to both filter what is shown based * on what the user has typed in, and also to provide more information for the * list of suggestions based on context. */ - private String readBackwards(Offset offset, - IDocument doc) throws BadLocationException { - int startPart = doc.getPartition(offset.documentOffset).getOffset(); + protected String readBackwards(int documentOffset, IDocument doc) throws BadLocationException { + int startPart = doc.getPartition(documentOffset).getOffset(); if (startPart == 0) { - if (offset.documentOffset < 32) { + if (documentOffset < 32) { startPart = 0; } else { - startPart = offset.documentOffset - 32; + startPart = documentOffset - 32; } } - String prefix = doc.get(startPart, - offset.documentOffset - startPart); + String prefix = doc.get(startPart, documentOffset - startPart); return prefix; } - - /** Filter the list by prefix */ - List filterList(List list, String prefix) { - - List result = new ArrayList(); - for ( int i = 0; i < list.size(); i++ ) { - RuleCompletionProposal item = (RuleCompletionProposal) list.get(i); - if (item.getDisplay().startsWith(prefix)) { - result.add(item); - } - } - return result; - } - - boolean doesPrefixExist(String s) { - if (s.length() == 0) return false; - return !(s.charAt(s.length() - 1) == ' '); - } - /** Looks behind, gets stuff after the white space. Basically ripping out the last word.*/ - String stripWhiteSpace(String prefix) { - - char[] c = prefix.toCharArray(); - - int start = 0; - for (int i = c.length - 1; i >=0; i-- ) { - if (Character.isWhitespace(c[i])) { - start = i + 1; - break; - } - } - - prefix = prefix.substring(start, prefix.length()); - return prefix; + protected String stripWhiteSpace(String prefix) { + if (prefix.charAt(prefix.length() - 1) == ' ') { + return ""; + } else { + char[] c = prefix.toCharArray(); + int start = 0; + for (int i = c.length - 1; i >=0; i-- ) { + if (Character.isWhitespace(c[i])) { + start = i + 1; + break; + } + } + prefix = prefix.substring(start, prefix.length()); + return prefix; + } } - - /* (non-Javadoc) - * Method declared on IContentAssistProcessor - */ - public char[] getCompletionProposalAutoActivationCharacters() { - return null; - } - - /* (non-Javadoc) - * Method declared on IContentAssistProcessor - */ - public char[] getContextInformationAutoActivationCharacters() { - return null; - } - - // For Context information - /* (non-Javadoc) - * Method declared on IContentAssistProcessor - */ - public IContextInformationValidator getContextInformationValidator() { - return null; - } - - /* (non-Javadoc) - * Method declared on IContentAssistProcessor - */ - public IContextInformation[] computeContextInformation( - ITextViewer viewer, - int documentOffset) { - return null; - } - - /* (non-Javadoc) - * Method declared on IContentAssistProcessor - */ - public String getErrorMessage() { - return null; - } - - - /** used to track where to drop in replacement stuff */ - static class Offset { - - public int documentOffset; - public String prefix; - public Offset(int documentOffset) { - this.documentOffset = documentOffset; - } - - - public int getPrefixLength() { - if (prefix == null) return 0; - return prefix.length(); - } - } } 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-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProcessor.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -4,9 +4,17 @@ import java.util.List; import java.util.regex.Pattern; +import org.drools.ide.DroolsIDEPlugin; import org.drools.ide.editors.DRLRuleEditor; import org.drools.ide.editors.DSLAdapter; +import org.eclipse.core.resources.IProject; +import org.eclipse.jdt.core.CompletionRequestor; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.part.FileEditorInput; @@ -25,53 +33,88 @@ */ public class RuleCompletionProcessor extends DefaultCompletionProcessor { - static final Pattern condition = Pattern.compile(".*\\Wwhen\\W.*", Pattern.DOTALL); + private static final Pattern condition = Pattern.compile(".*\\Wwhen\\W.*", Pattern.DOTALL); + private static final Pattern consequence = Pattern.compile(".*\\Wthen\\W.*", Pattern.DOTALL); + private static final Pattern query = Pattern.compile(".*\\Wquery\\W.*", Pattern.DOTALL); - static final Pattern consequence = Pattern.compile(".*\\Wthen\\W.*", Pattern.DOTALL); - static final Pattern query = Pattern.compile(".*\\Wquery\\W.*", Pattern.DOTALL); - - private DRLRuleEditor editor; - public RuleCompletionProcessor(DRLRuleEditor editor) { super(editor); - this.editor = editor; } - protected List getPossibleProposals(ITextViewer viewer, String backText) { - - List list = new ArrayList(); - DSLAdapter adapter = getDSLAdapter(viewer, editor); - - if (query.matcher( backText ).matches()) { - list.addAll(adapter.listConditionItems()); - } else if (consequence.matcher(backText).matches()) { - list.addAll(adapter.listConsequenceItems()); - if (!adapter.hasConsequences()) { - list.add(new RuleCompletionProposal("modify", "modify( );")); - list.add(new RuleCompletionProposal("retract", "retract( );")); - list.add(new RuleCompletionProposal("assert", "assert( );")); - } - } else if (condition.matcher(backText).matches()) { - list.addAll(adapter.listConditionItems()); - if (!adapter.hasConditions()) { - list.add( new RuleCompletionProposal("exists") ); - list.add( new RuleCompletionProposal("not") ); - list.add( new RuleCompletionProposal("and") ); - list.add( new RuleCompletionProposal("or") ); - list.add( new RuleCompletionProposal("eval", "eval( )") ); - } - list.add(new RuleCompletionProposal("then", "then\n\t")); - } else { - //we are in rule header - list.add(new RuleCompletionProposal("salience")); - list.add(new RuleCompletionProposal("no-loop")); - list.add(new RuleCompletionProposal("agenda-group")); - list.add(new RuleCompletionProposal("duration")); - list.add(new RuleCompletionProposal("auto-focus")); - list.add(new RuleCompletionProposal("when", "when\n\t")); + protected DRLRuleEditor getDRLEditor() { + return (DRLRuleEditor) getEditor(); + } + + protected List getCompletionProposals(ITextViewer viewer, final int documentOffset) { + try { + final List list = new ArrayList(); + DSLAdapter adapter = getDSLAdapter(viewer); + + IDocument doc = viewer.getDocument(); + String backText = readBackwards(documentOffset, doc); + + final String prefix = stripWhiteSpace(backText); + + if (query.matcher(backText).matches()) { + list.addAll(adapter.listConditionItems()); + } else if (consequence.matcher(backText).matches()) { + list.addAll(adapter.listConsequenceItems()); + if (!adapter.hasConsequences()) { + list.add(new RuleCompletionProposal(prefix.length(), "modify", "modify( );")); + list.add(new RuleCompletionProposal(prefix.length(), "retract", "retract( );")); + list.add(new RuleCompletionProposal(prefix.length(), "assert", "assert( );")); + filterProposalsOnPrefix(prefix, list); + +// IEditorInput input = getEditor().getEditorInput(); +// if (input instanceof IFileEditorInput) { +// IProject project = ((IFileEditorInput) input).getFile().getProject(); +// IJavaProject javaProject = JavaCore.create(project); +// +// CompletionRequestor requestor = new CompletionRequestor() { +// public void accept(org.eclipse.jdt.core.CompletionProposal proposal) { +// String display = new String(proposal.getCompletion()); +// String completion = display; +// if (prefix.lastIndexOf(".") != -1) { +// completion = prefix.substring(0, prefix.lastIndexOf(".") + 1) + completion; +// } +// System.out.println(completion); +// list.add(new RuleCompletionProposal(documentOffset, prefix.length(), display, completion)); +// } +// }; +// +// try { +// javaProject.newEvaluationContext().codeComplete(backText, backText.length(), requestor); +// } catch (Throwable t) { +// DroolsIDEPlugin.log(t); +// } +// } + } + } else if (condition.matcher(backText).matches()) { + list.addAll(adapter.listConditionItems()); + if (!adapter.hasConditions()) { + list.add(new RuleCompletionProposal(prefix.length(), "exists")); + list.add(new RuleCompletionProposal(prefix.length(), "not")); + list.add(new RuleCompletionProposal(prefix.length(), "and")); + list.add(new RuleCompletionProposal(prefix.length(), "or")); + list.add(new RuleCompletionProposal(prefix.length(), "eval", "eval( )")); + } + list.add(new RuleCompletionProposal(prefix.length(), "then", "then\n\t")); + filterProposalsOnPrefix(prefix, list); + } else { + //we are in rule header + list.add(new RuleCompletionProposal(prefix.length(), "salience")); + list.add(new RuleCompletionProposal(prefix.length(), "no-loop")); + list.add(new RuleCompletionProposal(prefix.length(), "agenda-group")); + list.add(new RuleCompletionProposal(prefix.length(), "duration")); + list.add(new RuleCompletionProposal(prefix.length(), "auto-focus")); + list.add(new RuleCompletionProposal(prefix.length(), "when", "when\n\t")); + filterProposalsOnPrefix(prefix, list); + } + return list; + } catch (Throwable t) { + DroolsIDEPlugin.log(t); } - - return list; + return null; } /** @@ -81,16 +124,20 @@ * * This delegates to DSLAdapter to poke around the project to try and load the DSL. */ - private DSLAdapter getDSLAdapter(ITextViewer viewer, DRLRuleEditor editor) { - DSLAdapter adapter = editor.getDSLAdapter(); - if (adapter == null) { - String content = viewer.getDocument().get(); - adapter = new DSLAdapter(content, ((FileEditorInput) editor.getEditorInput()).getFile()); - if (adapter.isValid()) { - editor.setDSLAdapter( adapter ); - } - } - return adapter; + private DSLAdapter getDSLAdapter(ITextViewer viewer) { + // TODO: cache DSL adapter in plugin, and reset when dsl file saved + // retrieve dsl name always (might have changed) and try retrieving + // cached dsl from plugin first + return new DSLAdapter(viewer.getDocument().get(), ((FileEditorInput) getEditor().getEditorInput()).getFile()); +// DSLAdapter adapter = getDRLEditor().getDSLAdapter(); +// if (adapter == null) { +// String content = viewer.getDocument().get(); +// adapter = new DSLAdapter(content, ((FileEditorInput) getEditor().getEditorInput()).getFile()); +// if (adapter.isValid()) { +// getDRLEditor().setDSLAdapter(adapter); +// } +// } +// return adapter; } Modified: labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProposal.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProposal.java 2006-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/editors/completion/RuleCompletionProposal.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -2,6 +2,8 @@ import java.util.Comparator; +import org.eclipse.swt.graphics.Image; + /** * Holds a completion proposal to be popped up. * @@ -12,23 +14,26 @@ private String content; private String display; - private int offset; + private int replacementLength; + private int cursorPosition; + private Image image; /** This is used when the stuff that is displayed, is the stuff that is used. */ - public RuleCompletionProposal(String content) { - this(content, content); + public RuleCompletionProposal(int replacementLength, String content) { + this(replacementLength, content, content); } /** This is used when a different display value is shown to what is put in when selected. */ - public RuleCompletionProposal(String display, String content) { - this(display, content, content.length()); + public RuleCompletionProposal(int replacementLength, String display, String content) { + this(replacementLength, display, content, content.length()); } /** This is used when a different display value is shown to what is put in when selected. */ - public RuleCompletionProposal(String display, String content, int offset) { + public RuleCompletionProposal(int replacementLength, String display, String content, int cursorPosition) { + this.replacementLength = replacementLength; this.content = content; this.display = display; - this.offset = offset; + this.cursorPosition = cursorPosition; } public String getContent() { @@ -39,10 +44,22 @@ return display; } - public int getOffset() { - return offset; + public int getReplacementLength() { + return replacementLength; + } + + public int getCursorPosition() { + return cursorPosition; } + public Image getImage() { + return image; + } + + public void setImage(Image image) { + this.image = image; + } + public String toString() { return content; } @@ -53,5 +70,4 @@ .compareTo(((RuleCompletionProposal) arg1).getDisplay()); } } - } Modified: labs/jbossrules/trunk/drools-ide/src/test/java/org/drools/ide/editors/completion/DRLCompletionProcessorTest.java =================================================================== --- labs/jbossrules/trunk/drools-ide/src/test/java/org/drools/ide/editors/completion/DRLCompletionProcessorTest.java 2006-04-17 22:50:46 UTC (rev 3746) +++ labs/jbossrules/trunk/drools-ide/src/test/java/org/drools/ide/editors/completion/DRLCompletionProcessorTest.java 2006-04-17 23:04:51 UTC (rev 3747) @@ -18,32 +18,28 @@ } - public void testPrefixExist() { - DefaultCompletionProcessor proc = new DefaultCompletionProcessor(null); - assertFalse(proc.doesPrefixExist("something ")); - assertTrue(proc.doesPrefixExist("y")); - } - public void testPrefixFiltering() { DefaultCompletionProcessor proc = new DefaultCompletionProcessor(null); - List raw = new ArrayList(); - raw.add(new RuleCompletionProposal("aardvark", "something")); - raw.add(new RuleCompletionProposal("smeg")); - raw.add(new RuleCompletionProposal("apple")); - raw.add(new RuleCompletionProposal("ape", "zzzzz")); + List list = new ArrayList(); + list.add(new RuleCompletionProposal(0, "aardvark", "something")); + list.add(new RuleCompletionProposal(0, "smeg")); + list.add(new RuleCompletionProposal(0, "apple")); + list.add(new RuleCompletionProposal(0, "ape", "ape")); - List result = proc.filterList(raw, "a"); - assertEquals(3, result.size()); - assertEquals("something", result.get(0).toString()); - assertEquals("apple", result.get(1).toString()); - assertEquals("zzzzz", result.get(2).toString()); + proc.filterProposalsOnPrefix("a", list); + assertEquals(2, list.size()); + assertEquals("apple", list.get(0).toString()); + assertEquals("ape", list.get(1).toString()); - result = proc.filterList(raw, "xzyz"); - assertEquals(0, result.size()); - - + list = new ArrayList(); + list.add(new RuleCompletionProposal(0, "aardvark", "something")); + list.add(new RuleCompletionProposal(0, "smeg")); + list.add(new RuleCompletionProposal(0, "apple")); + list.add(new RuleCompletionProposal(0, "ape", "zzzzz")); + proc.filterProposalsOnPrefix("xzyz", list); + assertEquals(0, list.size()); } } |
From: <jbo...@li...> - 2006-04-17 22:44:50
|
Author: soh...@jb... Date: 2006-04-17 18:44:46 -0400 (Mon, 17 Apr 2006) New Revision: 3745 Removed: labs/jbossforums/trunk/forums/portal-core-gen/ Log: build cleanup |
From: <jbo...@li...> - 2006-04-17 18:04:25
|
Author: tirelli Date: 2006-04-17 14:04:18 -0400 (Mon, 17 Apr 2006) New Revision: 3744 Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/TotalRecencyConflictResolver.java Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java Log: Adding TotalRecencyConflictResolver Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java 2006-04-17 17:09:58 UTC (rev 3743) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/DefaultConflictResolver.java 2006-04-17 18:04:18 UTC (rev 3744) @@ -64,7 +64,7 @@ // Class members // ---------------------------------------------------------------------- - private static final ConflictResolver[] CONFLICT_RESOLVERS = new ConflictResolver[]{SalienceConflictResolver.getInstance(), LifoConflictResolver.getInstance(), RecencyConflictResolver.getInstance(), LoadOrderConflictResolver.getInstance() }; + private static final ConflictResolver[] CONFLICT_RESOLVERS = new ConflictResolver[]{SalienceConflictResolver.getInstance(), LifoConflictResolver.getInstance(), TotalRecencyConflictResolver.getInstance(), LoadOrderConflictResolver.getInstance() }; /** Singleton instance. */ private static final DefaultConflictResolver INSTANCE = new DefaultConflictResolver(); Added: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/TotalRecencyConflictResolver.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/TotalRecencyConflictResolver.java 2006-04-17 17:09:58 UTC (rev 3743) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/TotalRecencyConflictResolver.java 2006-04-17 18:04:18 UTC (rev 3744) @@ -0,0 +1,84 @@ +/* + * Copyright 2005 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.drools.conflict; + +import org.drools.WorkingMemory; +import org.drools.reteoo.ReteTuple; +import org.drools.spi.Activation; +import org.drools.spi.ConflictResolver; + +/** + * A conflict resolver that compares the total recency of a tuple when + * determining firing order. + * + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> + * + * @version $Id$ + */ +public class TotalRecencyConflictResolver extends AbstractConflictResolver { + // ---------------------------------------------------------------------- + // Class members + // ---------------------------------------------------------------------- + + /** Singleton instance. */ + private static final TotalRecencyConflictResolver INSTANCE = new TotalRecencyConflictResolver(); + + // ---------------------------------------------------------------------- + // Class methods + // ---------------------------------------------------------------------- + + /** + * Retrieve the singleton instance. + * + * @return The singleton instance. + */ + public static ConflictResolver getInstance() { + return TotalRecencyConflictResolver.INSTANCE; + } + + // ---------------------------------------------------------------------- + // Constructors + // ---------------------------------------------------------------------- + + /** + * Construct. + */ + public TotalRecencyConflictResolver() { + // intentionally left blank + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + /** + * @see ConflictResolver + */ + public int compare(Activation lhs, + Activation rhs) { + long leftRecency = 0; + long rightRecency = 0; + if(lhs.getTuple() instanceof ReteTuple) { + leftRecency = ((ReteTuple) lhs.getTuple()).getRecency(); + } + if(rhs.getTuple() instanceof ReteTuple) { + rightRecency = ((ReteTuple) rhs.getTuple()).getRecency(); + } + return (rightRecency > leftRecency) ? 1 : + (rightRecency < leftRecency) ? -1 : + 0; + } + +} Property changes on: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/conflict/TotalRecencyConflictResolver.java ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + id author date revision Name: svn:eol-style + native |
Author: tirelli Date: 2006-04-17 13:09:58 -0400 (Mon, 17 Apr 2006) New Revision: 3743 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNodeSwitch.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/DefaultObjectSinkList.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/HashedObjectSinkList.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkList.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkListFactory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaLeftMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaMemoryFactory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaRightMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedRightMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultLeftMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultRightMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemory.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/BaseMultiLinkedListNode.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedList.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNode.java labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNodeWrapper.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaLeftMemoryTestClass.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaRightMemoryTestClass.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BetaMemoryFactoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedRightMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DefaultRightMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DummyValueObject.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemoryTest.java labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemoryTest.java Log: updating e-mail address info Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNodeSwitch.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNodeSwitch.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNodeSwitch.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -28,7 +28,7 @@ * AlphaNodeSwitch * A LiteralConstraint wrapper to be used on alpha node hashing algorithm * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 04/03/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/DefaultObjectSinkList.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/DefaultObjectSinkList.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/DefaultObjectSinkList.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -26,7 +26,7 @@ * DefaultObjectSinkList * A default implementation for DefaultObjectSinkList * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 06/march/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/HashedObjectSinkList.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/HashedObjectSinkList.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/HashedObjectSinkList.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -34,7 +34,7 @@ * A hashed implementation for ObjectSinkList to use in nodes * that do alpha node hashing * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 06/march/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkList.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkList.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkList.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -25,7 +25,7 @@ * ObjectSinkList * An interface for object sink lists * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 06/march/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkListFactory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkListFactory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectSinkListFactory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -20,7 +20,7 @@ * ObjectSinkListFactory * A factory for ObjectSinkLists * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 06/march/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaLeftMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaLeftMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaLeftMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -37,7 +37,7 @@ * Although, the implementations are all required to keep the order of * objects, and return then in order when iterating over. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaMemoryFactory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaMemoryFactory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaMemoryFactory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -25,7 +25,7 @@ * MemoryFactory * A factory for Beta memories, both left and right * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaRightMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaRightMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BetaRightMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -37,7 +37,7 @@ * Although, the implementations are all required to keep the order of * objects, and iterate then in order with the <code>iterator()</code> method. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -33,7 +33,7 @@ * BooleanConstrainedLeftMemory * A boolean constrained implementation for the left memory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedRightMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedRightMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/BooleanConstrainedRightMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * BooleanConstrainedRightMemory * A boolean constrained right memory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 19/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultLeftMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultLeftMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultLeftMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -29,7 +29,7 @@ * * A default implementation for Left Memory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultRightMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultRightMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/DefaultRightMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -29,7 +29,7 @@ * * A default implementation for BetaRightMemory. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -39,7 +39,7 @@ * ObjectConstrainedLeftMemory * An equal object constrained left memory implementation * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 15/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -38,7 +38,7 @@ * ObjectEqualConstrRightMemory * An Equal Constrained Right Memory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 22/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -36,7 +36,7 @@ * ObjectNotEqualConstrLeftMemory * A not-equal object constrained left memory implementation * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 18/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemory.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemory.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemory.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * ObjectNotEqualConstrRightMemory * An Object not equal constrained right memory implementation * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 22/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/BaseMultiLinkedListNode.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/BaseMultiLinkedListNode.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/BaseMultiLinkedListNode.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -21,7 +21,7 @@ * A base implementation for the MultiLinkedListNode that helps to * manage object references. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedList.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedList.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedList.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -21,7 +21,7 @@ * A linked list where each node has a reference to the list itself and to a * child node. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 14/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNode.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNode.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNode.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -22,7 +22,7 @@ * a child node (that might me member of another LinkedList) and the containing * LinkedList. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNodeWrapper.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNodeWrapper.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/util/MultiLinkedListNodeWrapper.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -22,7 +22,7 @@ * another linked list without losing the references to the original * list. * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 12/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaLeftMemoryTestClass.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaLeftMemoryTestClass.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaLeftMemoryTestClass.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -32,7 +32,7 @@ /** * BaseBetaLeftMemoryTest * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaRightMemoryTestClass.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaRightMemoryTestClass.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BaseBetaRightMemoryTestClass.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * BaseBetaRightMemoryTestClass * A base class for test cases testing BetaRightMemory implementations * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BetaMemoryFactoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BetaMemoryFactoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BetaMemoryFactoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -28,7 +28,7 @@ * BetaMemoryFactoryTest * An unit test for the BetaMemoryFactory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedLeftMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -34,7 +34,7 @@ * BooleanConstrainedLeftMemoryTest * TestCase for BooleanConstrainedLeftMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedRightMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedRightMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/BooleanConstrainedRightMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * BooleanConstrainedRightMemoryTest * A test case for BooleanConstrainedRightMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DefaultRightMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DefaultRightMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DefaultRightMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -29,7 +29,7 @@ * DefaultRightMemoryTest * A test case for DefaultRightMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DummyValueObject.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DummyValueObject.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/DummyValueObject.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -20,7 +20,7 @@ * DummyValueObject * A simple Value Object to use in test cases * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrLeftMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -33,7 +33,7 @@ * ObjectEqualConstrLeftMemoryTest * TestCase for ObjectEqualConstrLeftMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectEqualConstrRightMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * ObjectEqualConstrRightMemoryTest * A test case for ObjectEqualConstrRightMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrLeftMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -34,7 +34,7 @@ * ObjectNotEqualConstrLeftMemoryTest * TestCase for ObjectNotEqualConstrLeftMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemoryTest.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemoryTest.java 2006-04-17 16:48:44 UTC (rev 3742) +++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/beta/ObjectNotEqualConstrRightMemoryTest.java 2006-04-17 17:09:58 UTC (rev 3743) @@ -35,7 +35,7 @@ * ObjectNotEqualConstrRightMemoryTest * A test case for ObjectNotEqualConstrRightMemory * - * @author <a href="mailto:eds...@au...">Edson Tirelli</a> + * @author <a href="mailto:ti...@po...">Edson Tirelli</a> * * Created: 28/02/2006 */ |