[jboss-svn-commits] JBL Code SVN: r26559 - in labs/jbossforums/branches/forums120P26: authz-jaae-plugin and 222 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri May 15 08:36:34 EDT 2009


Author: sviluppatorefico
Date: 2009-05-15 08:36:33 -0400 (Fri, 15 May 2009)
New Revision: 26559

Added:
   labs/jbossforums/branches/forums120P26/.classpath
   labs/jbossforums/branches/forums120P26/.project
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.bat
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.sh
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.xml
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/AuthorizationProvider.java
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-mapping.xml
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-permissions.xml
   labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/jboss-service.xml
   labs/jbossforums/branches/forums120P26/build/
   labs/jbossforums/branches/forums120P26/build/.project
   labs/jbossforums/branches/forums120P26/build/build.bat
   labs/jbossforums/branches/forums120P26/build/build.sh
   labs/jbossforums/branches/forums120P26/build/build.xml
   labs/jbossforums/branches/forums120P26/build/distrib.xml
   labs/jbossforums/branches/forums120P26/build/etc/
   labs/jbossforums/branches/forums120P26/build/etc/clustered.properties
   labs/jbossforums/branches/forums120P26/build/etc/hsqldb.properties
   labs/jbossforums/branches/forums120P26/build/etc/local.properties-example
   labs/jbossforums/branches/forums120P26/build/etc/mysql.properties
   labs/jbossforums/branches/forums120P26/build/etc/oracle.properties
   labs/jbossforums/branches/forums120P26/build/etc/postgresql.properties
   labs/jbossforums/branches/forums120P26/build/etc/single.properties
   labs/jbossforums/branches/forums120P26/build/etc/sqlserver.properties
   labs/jbossforums/branches/forums120P26/build/ide/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/codestyles/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/codestyles/jboss.xml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/codestyles/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/codestyles/jboss.xml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/Body Header.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/File Header.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/AnnotationType.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Class.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Enum.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Interface.java
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/api/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/api/api.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/bridge/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/bridge/bridge.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/cms/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/cms/cms.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/common/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/common/common.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/core/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/core/core.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/faces/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/faces/faces.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/format/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/format/format.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/forums/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/forums/forums.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/migration/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/migration/migration.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/portlet/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/portlet/portlet.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/security/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/security/security.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/server/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/server/server.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/theme/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/theme/theme.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/wsrp/
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/wsrp/wsrp.iml
   labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/readme.txt
   labs/jbossforums/branches/forums120P26/build/licences/
   labs/jbossforums/branches/forums120P26/build/licences/apache-1.1.txt
   labs/jbossforums/branches/forums120P26/build/licences/apache-2.0.txt
   labs/jbossforums/branches/forums120P26/build/licences/bsd.txt
   labs/jbossforums/branches/forums120P26/build/licences/cddl-1.0.txt
   labs/jbossforums/branches/forums120P26/build/licences/lgpl.txt
   labs/jbossforums/branches/forums120P26/build/licences/mozilla-1.0.1.txt
   labs/jbossforums/branches/forums120P26/build/local.properties.sample
   labs/jbossforums/branches/forums120P26/build/misc/
   labs/jbossforums/branches/forums120P26/build/misc/codeguide.html
   labs/jbossforums/branches/forums120P26/cache-plugin/
   labs/jbossforums/branches/forums120P26/cache-plugin/build.bat
   labs/jbossforums/branches/forums120P26/cache-plugin/build.sh
   labs/jbossforums/branches/forums120P26/cache-plugin/build.xml
   labs/jbossforums/branches/forums120P26/cache-plugin/src/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProviderMBean.java
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java
   labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/TreeCacheProvider.java
   labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/
   labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/
   labs/jbossforums/branches/forums120P26/forums/build.bat
   labs/jbossforums/branches/forums120P26/forums/build.sh
   labs/jbossforums/branches/forums120P26/forums/build.xml
   labs/jbossforums/branches/forums120P26/forums/src/
   labs/jbossforums/branches/forums120P26/forums/src/bin/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_disa.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_norm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_disa.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_norm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_disa.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_norm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminlock.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminmove.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminsplit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminunlock.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno_new.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_error.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_question.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_warning.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_locked.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_open.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_pop.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_locked.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_open.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_pop.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky_new.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_bar.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_lcap.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_rcap.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_feed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_logo.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewcategory.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewforum.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_aim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_closed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_delete.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_edit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_email.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_icq.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_moderate.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_msnm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_newtopic.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_postreply.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_profile.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_quote.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_skype.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_subscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_unsubscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_website.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_yim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewcategory.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewforum.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_aim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_closed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_delete.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_edit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_email.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_icq.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_moderate.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_msnm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_newtopic.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_postreply.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_profile.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_quote.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_skype.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_subscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_unsubscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_website.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_yim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewcategory.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewforum.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_aim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_closed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_delete.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_edit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_email.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_icq.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_moderate.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_msnm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_newtopic.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_postreply.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_profile.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_quote.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_skype.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_subscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_unsubscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_website.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_yim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewcategory.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewforum.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_aim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_closed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_delete.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_edit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_email.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_icq.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_moderate.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_msnm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_newtopic.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_postreply.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_profile.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_quote.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_skype.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_subscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_unsubscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_website.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_yim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewcategory.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewforum.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_aim.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_closed.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_delete.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_edit.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_email.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_icq.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_moderate.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_msnm.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_newtopic.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_postreply.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_profile.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_quote.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_skype.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_subscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_unsubscribe.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_website.gif
   labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_yim.gif
   labs/jbossforums/branches/forums120P26/forums/src/etc/
   labs/jbossforums/branches/forums120P26/forums/src/etc/portal-forums-war.mf
   labs/jbossforums/branches/forums120P26/forums/src/main/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsConstants.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLChooseTagHandler.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLOtherwiseTagHandler.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLWhenTagHandler.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/Authorization.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContextImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationInterface.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFActionContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFSecurityContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFUIContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/SecurityContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/AbstractParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEvent.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventHandler.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventNotifier.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/TextEvent.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/Token.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/Chars.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/MutableChars.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/CharacterEntityReferenceEvent.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/HTML4_0CharacterEntityReferenceParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/XML1_0CharacterEntityReferenceParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/TagParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/LineBreakParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/AbstractRenderer.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLConfig.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ASCII_CharStream.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/AbstractContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/BuildException.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ChildrenStrategy.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Context.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/DelegateContext.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ParseException.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Template.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerConstants.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerTokenManager.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateBuilder.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateLoader.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateParser.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateRepository.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Token.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TokenMgrError.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/CLLoader.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/EntityTable.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Loader.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Stack.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/FileBinding.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/TempFileBinding.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/AttachmentImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumInstanceImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumWatchImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicWatchImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/UploadedFileImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/WatchImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Attachment.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/AuthType.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Category.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Forum.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumInstance.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumWatch.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Message.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poll.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/PollOption.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Post.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poster.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Topic.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/TopicWatch.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/UploadedFile.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Watch.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/TCCLXProperties.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/XProperties.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/DisplayAs.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilderMBean.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModule.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ResultPage.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SearchCriteria.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/Searching.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortOrder.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/TimePeriod.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/bridge/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/FolderType.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/BaseController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Constants.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ConstantsHelper.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/DownloadFilter.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/EmptyController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsPortletExternalContextImpl.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ThemeHelper.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Util.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ActionController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/DeletePost.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/MessageValidationException.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollValidationException.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/TopicWatchController.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/converters/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollDurationConverter.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/LengthValidator.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/MessageLengthValidator.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/PollValidator.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/SubjectLengthValidator.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/ValidatorMessages.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/FloodControlListener.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/ValueRequiredMessageModifierListener.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminFullTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPollPostEditTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPostTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AnonymousUserTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/CategoryModelTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumModelTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumsModelTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/PostModelTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TestConstants.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TopicModelTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/UserTestCase.java
   labs/jbossforums/branches/forums120P26/forums/src/resources/
   labs/jbossforums/branches/forums120P26/forums/src/resources/jboss-portal/
   labs/jbossforums/branches/forums120P26/forums/src/resources/jboss-portal/default-object.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/application.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/security-config.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/setup.txt
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/setup.txt
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/META-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/META-INF/jboss-service.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/setup.txt
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/ehcache.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_de.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_it.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/email.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/img.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/listitem.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_username_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_close.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_open.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/url.tpl
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-object.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portal-lib.tld
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet-instances.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/tomahawk.taglib.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteCategory.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteForum.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/index.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/category/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/errors/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/forums/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/index.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/jumpbox.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topic.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topics.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_move.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/portal_index.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/pref/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/pref/index.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_asposts.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_astopics.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_results.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/summary/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_poll.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_post.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_preview.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_preview.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_preview.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/topicWatch.xhtml
   labs/jbossforums/branches/forums120P26/forums/src/resources/setup/
   labs/jbossforums/branches/forums120P26/forums/src/resources/setup/setup.sql
   labs/jbossforums/branches/forums120P26/forums/src/resources/test/
   labs/jbossforums/branches/forums120P26/forums/src/resources/test/forums.xml
   labs/jbossforums/branches/forums120P26/forums/src/resources/test/hibernate.properties
   labs/jbossforums/branches/forums120P26/forums/src/resources/test/log4j.properties
   labs/jbossforums/branches/forums120P26/thirdparty/
   labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/
   labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/lib/ant.jar
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-api.jar
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-impl.jar
   labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/tomahawk.jar
   labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/
   labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/lib/dbunit.jar
   labs/jbossforums/branches/forums120P26/thirdparty/dom4j/
   labs/jbossforums/branches/forums120P26/thirdparty/dom4j/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/dom4j/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/dom4j/lib/dom4j.jar
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-api.jar
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-ri.jar
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-example.jar
   labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-facelets.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/aspectjrt.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus-ant.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-httpclient.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-logging.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons-jexl/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons-jexl/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons-jexl/lib/commons-jexl-1.0.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-beanutils.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-codec.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-collections.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-digester-1.6.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-el.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-lang-2.1.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/lib/commons-fileupload.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/lib/log4j.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/lib/lucene.jar
   labs/jbossforums/branches/forums120P26/thirdparty/javassist/
   labs/jbossforums/branches/forums120P26/thirdparty/javassist/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/javassist/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/javassist/lib/javassist.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/lib/jboss-cache-jdk50.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/hibernate-search.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/lucene-core.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-collections.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-logging.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ehcache.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ejb3-persistence.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate-commons-annotations.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate3.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/odmg.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/lib/jboss-j2ee.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-acl.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-identity-management.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-security-common.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/lib/jboss.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-common.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-jmx.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-system.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/mail.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/jboss-portlet-api-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-api-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-common-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-test-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-faces-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-format-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-identity-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-jems-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-jsr168api-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-server-lib.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jdom/
   labs/jbossforums/branches/forums120P26/thirdparty/jdom/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jdom/lib/jdom.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jflex/
   labs/jbossforums/branches/forums120P26/thirdparty/jflex/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/jflex/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jflex/lib/jflex.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jgroups/
   labs/jbossforums/branches/forums120P26/thirdparty/jgroups/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/jgroups/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jgroups/lib/jgroups.jar
   labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/
   labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/junit.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.httpunit.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.jwebunit.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.nekohtml.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/httpunit.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/js.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/junit.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/jwebunit.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/nekohtml.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xerces.jar
   labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xml-apis.jar
   labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/
   labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/LICENSE.oswego.txt
   labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/lib/concurrent.jar
   labs/jbossforums/branches/forums120P26/thirdparty/rome/
   labs/jbossforums/branches/forums120P26/thirdparty/rome/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/rome/lib/rome-0.9.jar
   labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/component-info.xml
   labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/lib/JavaCC.zip
   labs/jbossforums/branches/forums120P26/thirdparty/sun-portlet/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-portlet/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-portlet/lib/jsf-portlet.jar
   labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/jsp-api.jar
   labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/servlet-api.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/README.txt
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-collections-2.0.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-logging.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-ejb-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-hibernate-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-java-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jboss-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jmx-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-portlet-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-web-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xdoclet-module.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xjavadoc.jar
   labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet.jar
   labs/jbossforums/branches/forums120P26/tools/
   labs/jbossforums/branches/forums120P26/tools/.donotremove
   labs/jbossforums/branches/forums120P26/tools/.project
   labs/jbossforums/branches/forums120P26/tools/bin/
   labs/jbossforums/branches/forums120P26/tools/bin/ant
   labs/jbossforums/branches/forums120P26/tools/bin/ant.bat
   labs/jbossforums/branches/forums120P26/tools/bin/antRun
   labs/jbossforums/branches/forums120P26/tools/bin/antRun.bat
   labs/jbossforums/branches/forums120P26/tools/bin/antRun.pl
   labs/jbossforums/branches/forums120P26/tools/bin/antx.bat
   labs/jbossforums/branches/forums120P26/tools/bin/build.bat
   labs/jbossforums/branches/forums120P26/tools/bin/build.sh
   labs/jbossforums/branches/forums120P26/tools/bin/common.shlib
   labs/jbossforums/branches/forums120P26/tools/bin/complete-ant-cmd.pl
   labs/jbossforums/branches/forums120P26/tools/bin/lcp.bat
   labs/jbossforums/branches/forums120P26/tools/bin/runant.pl
   labs/jbossforums/branches/forums120P26/tools/bin/runant.py
   labs/jbossforums/branches/forums120P26/tools/bin/ubuild.bat
   labs/jbossforums/branches/forums120P26/tools/etc/
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/autoload.properties
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/buildmagic.ent
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/common.properties
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/defaults.ent
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/libraries.ent
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/modules.ent
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/targets.ent
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/task.properties
   labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/tools.ent
   labs/jbossforums/branches/forums120P26/tools/etc/changelog.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/checkstyle-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/coverage-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/jdepend-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/jdepend.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/junit-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/junit-noframes.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/log.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/maudit-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/mmetrics-frames.xsl
   labs/jbossforums/branches/forums120P26/tools/etc/tagdiff.xsl
   labs/jbossforums/branches/forums120P26/tools/examples/
   labs/jbossforums/branches/forums120P26/tools/examples/build.bat
   labs/jbossforums/branches/forums120P26/tools/examples/build.sh
   labs/jbossforums/branches/forums120P26/tools/lib/
   labs/jbossforums/branches/forums120P26/tools/lib/ant.jar
   labs/jbossforums/branches/forums120P26/tools/lib/bsf.jar
   labs/jbossforums/branches/forums120P26/tools/lib/buildmagic-tasks.jar
   labs/jbossforums/branches/forums120P26/tools/lib/crimson.jar
   labs/jbossforums/branches/forums120P26/tools/lib/explode.jar
   labs/jbossforums/branches/forums120P26/tools/lib/junit.jar
   labs/jbossforums/branches/forums120P26/tools/lib/optional.jar
   labs/jbossforums/branches/forums120P26/tools/lib/saxon.jar
   labs/jbossforums/branches/forums120P26/tools/lib/xalan.jar
   labs/jbossforums/branches/forums120P26/tools/lib/xercesImpl.jar
   labs/jbossforums/branches/forums120P26/tools/lib/xml-apis.jar
Log:


Added: labs/jbossforums/branches/forums120P26/.classpath
===================================================================
--- labs/jbossforums/branches/forums120P26/.classpath	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/.classpath	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="authz-jaae-plugin/src/main"/>
+	<classpathentry kind="src" path="cache-plugin/src/main"/>
+	<classpathentry kind="src" path="forums/src/main"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-core-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-jems-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/junit-junit/lib/junit.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-j2ee/lib/jboss-j2ee.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jakarta-log4j/lib/log4j.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-system/lib/jboss-system.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-system/lib/jboss-jmx.jar"/>
+	<classpathentry kind="lib" path="thirdparty/facelets/lib/el-api.jar"/>
+	<classpathentry kind="lib" path="thirdparty/facelets/lib/jsf-facelets.jar"/>
+	<classpathentry kind="lib" path="thirdparty/apache-myfaces/lib/myfaces-impl.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-system/lib/mail.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-common-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-format-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/oswego-concurrent/lib/concurrent.jar"/>
+	<classpathentry kind="lib" path="thirdparty/sun-servlet/lib/servlet-api.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jakarta-fileupload/lib/commons-fileupload.jar"/>
+	<classpathentry kind="lib" path="thirdparty/apache-myfaces/lib/tomahawk.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-portlet-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/jboss-portlet-api-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jwebunit-jwebunit/lib/jwebunit.jar"/>
+	<classpathentry kind="lib" path="thirdparty/dbunit-dbunit/lib/dbunit.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-core-test-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/rome/lib/rome-0.9.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-jaae-engine/lib/jboss-acl.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-jaae-engine/lib/jboss-security-common.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-jaae-engine/lib/jboss-identity-management.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-identity-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-system/lib/jboss-common.jar"/>
+	<classpathentry kind="lib" path="thirdparty/dom4j/lib/dom4j.jar"/>
+	<classpathentry kind="lib" path="thirdparty/javassist/lib/javassist.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-portlet-jsr168api-lib.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-hibernate/lib/hibernate3.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-cache/lib/jboss-cache-jdk50.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jgroups/lib/jgroups.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-hibernate-search/lib/hibernate-search.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-hibernate-search/lib/lucene-core.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-hibernate/lib/ejb3-persistence.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-hibernate/lib/hibernate-commons-annotations.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jakarta-commons/lib/commons-lang-2.1.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: labs/jbossforums/branches/forums120P26/.project
===================================================================
--- labs/jbossforums/branches/forums120P26/.project	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/.project	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>forums</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+ at echo off
+rem
+rem  Invokes a script of the same name in the 'tools' module.
+rem  
+rem  The 'tools' module is expected to be a peer directory of the directory
+rem  in which this script lives.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+##  Invokes a script of the same name in the 'tools' module.
+##  
+##  The 'tools' module is expected to be a peer directory of the directory
+##  in which this script lives.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+    if [ "x$TOOLS_ROOT" = "x" ]; then
+	TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+    fi
+
+    MODULE_ROOT=`cd $DIRNAME; pwd`
+    export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+    # Where is the target script?
+    target="$TOOLS_ROOT/bin/$PROGNAME"
+    if [ ! -f "$target" ]; then
+	echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+        echo "${PROGNAME}:"
+        echo "${PROGNAME}:    $target"
+        echo "${PROGNAME}:"
+	echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+	echo "${PROGNAME}: and make sure it is up to date."
+        exit 2
+    fi
+
+    # Get busy yo!
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: Executing: /bin/sh $target $@"
+    fi
+    if [ "x$TRACE" = "x" ]; then
+	exec /bin/sh $target "$@"
+    else
+	exec /bin/sh -x $target "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"


Property changes on: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/build.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+   <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+   <!ENTITY tools      SYSTEM "../tools/etc/buildfragments/tools.ent">
+   <!ENTITY libraries  SYSTEM "../tools/etc/buildfragments/libraries.ent">
+   <!ENTITY modules    SYSTEM "../tools/etc/buildfragments/modules.ent">
+   <!ENTITY defaults   SYSTEM "../tools/etc/buildfragments/defaults.ent">
+   <!ENTITY targets    SYSTEM "../tools/etc/buildfragments/targets.ent">
+   ]>
+
+<!-- $Id: build.xml,v 1.13 2005/11/05 15:02:50 bdaw Exp $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File                      |-->
+<!--|                                                                      |-->
+<!--| Distributable under LGPL license.                                    |-->
+<!--| See terms of license at http://www.gnu.org.                          |-->
+<!--|                                                                      |-->
+<!--| This file has been designed to work with the 'tools' module and      |-->
+<!--| Buildmagic extentions.                                               |-->
+<!--+======================================================================+-->
+
+<project default="main" name="Forums Authorization Plugin based on JAAE">
+
+	<!--+====================================================================+-->
+   <!--| Setup                                                              |-->
+   <!--|                                                                    |-->
+   <!--| Include the common build elements.                                 |-->
+   <!--|                                                                    |-->
+   <!--| This defines several different targets, properties and paths.      |-->
+   <!--| It also sets up the basic extention tasks amoung other things.     |-->
+   <!--+====================================================================+-->
+
+   &buildmagic;
+   &libraries;
+   &modules;
+   &defaults;
+   &tools;
+   &targets;
+
+   
+         
+   <!-- ================================================================== -->
+   <!-- Initialization                                                     -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Initialize the build system.  Must depend on '_buildmagic:init'.
+     | Other targets should depend on 'init' or things will mysteriously fail.
+   -->
+
+   <target name="init" unless="init.disable" depends="_buildmagic:init">
+      <available file="${forums.lib}" type="dir"/>
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Configuration                                                      |-->
+   <!--|                                                                    |-->
+   <!--| This target is invoked by the Buildmagic initialization logic      |-->
+   <!--| and should contain module specific configuration elements.         |-->
+   <!--+====================================================================+-->
+
+   <target name="configure" unless="configure.disable">
+
+	  <!-- Configure some properties -->
+      <property name="jndi-root" value="portal"/>
+
+      <!-- Configure thirdparty libraries -->
+      <call target="configure-libraries"/>
+		<path id="library.classpath">
+			<path refid="apache.myfaces.classpath"/>			
+			<path refid="jbportal.classpath"/>				        
+			<path refid="jboss-jaae-engine.classpath"/>
+			<path refid="jakarta-commons-jexl.classpath"/>						
+		</path>
+
+      <!-- Configure modules -->
+      <call target="configure-modules"/>
+	
+	    <!-- removing all src level dependency on portal....helps with building
+	    the forum application that upgrades easier across portal releases -->
+		<path id="dependentmodule.classpath">
+			<path refid="forums.classpath"/>
+			<!--path refid="jboss.portal-format.classpath"/>
+			<path refid="jboss.portal-common.classpath"/>
+			<path refid="jboss.portal-portlet.classpath"/>
+			<path refid="jboss.portal-server.classpath"/>
+			<path refid="jboss.portlet-api.classpath"/>
+			<path refid="jboss.hibernate.classpath"/-->
+		</path>
+
+      <!--+=======================================+-->
+      <!--| Override any default properties here. |-->
+      <!--+=======================================+-->
+
+      <!-- Configure defaults & build tools -->
+      <call target="configure-defaults"/>
+		<call target="configure-tools"/>
+
+      <!--+=======================================+-->
+      <!--| Define module specific elements here. |-->
+      <!--+=======================================+-->
+      <property name="javadoc.private" value="true"/>
+		<property name="javadoc.protected" value="false"/>
+
+	</target>
+
+
+   <!--+====================================================================+-->
+   <!--| Compile                                                            |-->
+   <!--|                                                                    |-->
+   <!--| This target should depend on other compile-* targets for each      |-->
+   <!--| different type of compile that needs to be performed, short of     |-->
+   <!--| documentation compiles.                                            |-->
+   <!--+====================================================================+-->
+
+   <target name="compile" description="Compile all source files." depends="generate-classes,
+               _default:compile-classes,
+               _default:compile-etc,
+               _default:compile-resources">		
+	</target>
+
+   <!-- Generate all class files -->
+   <target name="generate-classes" depends="init">
+	</target>
+
+   <!-- Remove or change the delimiter in hibernate-export if your database has a different deliniter -->
+   <target name="ddl" depends="output">		
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Generate Output                                                    |-->
+   <!--|                                                                    |-->
+   <!--| Generates the target output for this module. Target output is      |-->
+   <!--| the output which is ment to be released or used by external        |-->
+   <!--| modules.                                                           |-->
+   <!--+====================================================================+-->
+
+   <target name="output" description="Generate all target output." depends="compile">
+
+	  <mkdir dir="${build.lib}"/>
+
+      <!-- forums-authz-plugin.jar -->
+      <jar jarfile="${build.lib}/forums-authz-plugin.jar">
+			<fileset dir="${build.classes}"/>
+	  </jar>
+
+      <!-- forums-authz-plugin.sar -->
+      <jar jarfile="${build.lib}/portal-forums-authz-plugin.sar">
+		<!-- forums-authz-plugin.jar -->
+		<fileset dir="${build.lib}" includes="*.jar"/>
+		<!-- include jbportal libs -->
+		<fileset dir="${jbportal.lib}" includes="portal-core-lib.jar"/>
+		<fileset dir="${jbportal.lib}" includes="portal-forums-lib.jar"/>
+		<!-- include the forums-ui.jar -->
+		<fileset dir="${forums.lib}" includes="*.jar"/>
+		<!-- include jexl libs -->
+		<fileset dir="${jakarta-commons-jexl.lib}" includes="*.jar"/>
+		<!-- include jaae libs -->
+		<fileset dir="${jboss-jaae-engine.lib}" includes="*.jar"/>
+		<!-- sar configuration files -->
+		<fileset dir="${build.resources}/forums-authz-plugin.sar"/>
+      </jar>    
+              
+         <!-- Luca Stancapiano - 7 apr 2007 - I added theese six 
+              rows to achieve complete create for jboss-forums.ear -->  
+         <copy todir="${forums.root}/resources/portal-forums-ear">
+		<fileset dir="${build.lib}" includes="portal-forums-authz-plugin.sar"/>
+         </copy>     
+   	     <!-- Luca Stancapiano - 5 feb 2008 - this plugin is also inside new clustered 
+   	          versions of JBossForums -->
+         <copy todir="${forums.root}/resources/portal-forums-ha-ear">
+	    <fileset dir="${build.lib}" includes="portal-forums-authz-plugin.sar"/>
+         </copy>     
+         <copy todir="${forums.root}/resources/portal-forums-ha-jbp-ear">
+	    <fileset dir="${build.lib}" includes="portal-forums-authz-plugin.sar"/>
+         </copy>
+   	     <!-- end patch 5 feb 2008 -->
+         <jar jarfile="${forums.lib}/jboss-forums.ear">
+		<fileset dir="${forums.root}/resources/portal-forums-ear" includes="**/*"/>
+         </jar>     
+	     <!-- Luca Stancapiano - 5 feb 2008 - this plugin is also inside new clustered 
+	          versions of JBossForums as libraries -->
+         <jar jarfile="${forums.lib}/jboss-forums-ha.ear">
+	    <fileset dir="${forums.root}/resources/portal-forums-ha-ear" includes="**/*"/>
+         </jar>
+         <jar jarfile="${forums.lib}/jboss-forums-ha-jbp.ear">
+	    <fileset dir="${forums.root}/resources/portal-forums-ha-jbp-ear" includes="**/*"/>
+         </jar>
+   	     <!-- end patch 5 feb 2008 -->
+      
+         <!-- end patch 7 apr 2007 -->
+      
+	</target>
+
+	<target name="explode" depends="init">
+		<explode file="${build.lib}/portal-forums-authz-plugin.sar" todir="${build.lib}" name="portal-forums-authz-plugin-exploded.sar"/>
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Cleaning                                                           -->
+   <!-- ================================================================== -->
+
+   <!-- Clean up all build output -->
+   <target name="clean" depends="_default:clean">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Documents                                                          |-->
+   <!--|                                                                    |-->
+   <!--| Generate all documentation for this module.                        |-->
+   <!--+====================================================================+-->
+
+   <target name="docs" depends="_default:docs">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Misc.                                                              -->
+   <!-- ================================================================== -->
+
+   <target name="main" depends="most"/>
+	<target name="all" depends="_default:all"/>
+	<target name="most" depends="_default:most"/>
+	<target name="help" depends="_default:help"/>
+
+   <!-- ================================================================== -->
+   <!-- Deployment                                                         -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Deploy the application
+   -->
+   <target name="deploy" description="Deploy." depends="output">
+		<!--<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<copy file="${build.lib}/portal-forums-authz-plugin.sar" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>-->
+		<require file="../forums/output/lib"/>
+		<copy file="${build.lib}/portal-forums-authz-plugin.sar" todir="../forums/output/lib/"/>
+	</target>
+
+   <!--
+     | Undeploy the application
+   -->
+   <target name="undeploy" description="Undeploy." depends="init">
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<delete file="${jboss.home}/server/${portal.deploy.dir}/deploy/portal-forums-authz-plugin.sar"/>		
+	</target>
+
+	<target name="test" depends="init">
+	</target>
+</project>

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/AuthorizationProvider.java
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/AuthorizationProvider.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/AuthorizationProvider.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.forums.security;
+
+
+//portal forums related
+import org.jboss.portlet.forums.auth.AuthorizationInterface;
+import org.jboss.portlet.forums.auth.SecurityContext;
+import org.jboss.portlet.forums.auth.JSFActionContext;
+import org.jboss.portlet.forums.auth.JSFUIContext;
+
+//jboss-acl-engine
+import org.jboss.security.acl.AclProcessor;
+import org.jboss.security.acl.AccessDenied;
+import org.jboss.security.acl.User;
+import org.jboss.security.acl.UserThreadLocal;
+
+/*
+ * Created on May 18, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class AuthorizationProvider implements AuthorizationInterface
+{
+    /**
+     * 
+     */
+    public AuthorizationProvider()
+    {        
+    }
+    
+    /**
+     * 
+     *
+     */
+    public boolean hasAccess(SecurityContext context)
+    {
+        boolean hasAccess = true;     
+        try
+        {
+	        //setup the engine identity based on identity provided in the security context
+            if(context.getIdentity()!=null)
+            {
+                User user = User.getUser(((org.jboss.portal.identity.User)context.getIdentity()).getUserName());
+                JBossPortalUtil.populateRoles(user);
+                UserThreadLocal.setUser(user);
+            }
+            else
+            {
+                //set an anonymous user
+                UserThreadLocal.setUser(new User());
+            }
+	        
+	        if(context instanceof JSFActionContext)
+	        {
+	            JSFActionContext securityContext = (JSFActionContext)context;
+	            
+		        //send this to the engine for access control decision
+		        AclProcessor.getInstance().processJSFActionAccess(
+		        securityContext.getFacesContext(),
+		        securityContext.getManagedBean(),
+		        securityContext.getBusinessAction());
+	        }
+	        else if(context instanceof JSFUIContext)
+	        {
+	            JSFUIContext securityContext = (JSFUIContext)context;
+	            
+		        //send this to the engine for access control decision
+		        AclProcessor.getInstance().processFragmentAccess(securityContext.getFragment(),securityContext.getContextData());		        
+	        }
+        }
+        catch(AccessDenied ade)
+        {
+            hasAccess = false;
+        }
+        catch(Exception e)
+        {
+            throw new RuntimeException(e);
+        }
+        
+        return hasAccess;
+    }
+    
+    
+}

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.forums.security;
+
+//core java
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.naming.InitialContext;
+
+
+//website security
+import org.jboss.security.util.Util;
+
+//jboss-acl framework
+import org.jboss.security.acl.Role;
+import org.jboss.security.acl.User;
+
+/**
+ * TODO: (migration marker)
+ *       (jbportal2.0 - jbportal2.2.1rc1) - done
+ */
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.MembershipModule;
+
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com
+ *
+ */
+public class JBossPortalUtil 
+{
+    private static final String ROLE_MODULE_JNDI_NAME = "java:portal/RoleModule";
+    private static final String USER_MODULE_JNDI_NAME = "java:portal/UserModule";
+    private static final String MEMBERSHIP_MODULE_JNDI_NAME = "java:portal/MembershipModule";
+    
+        
+    
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static RoleModule getRoleModule() throws Exception
+    {
+        RoleModule roleModule = null;
+        
+        //get the role module from the portal
+        InitialContext ctx = new InitialContext();
+        roleModule = (RoleModule)ctx.lookup(JBossPortalUtil.ROLE_MODULE_JNDI_NAME);
+        
+        
+        return roleModule;
+    }
+    
+    
+    
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static MembershipModule getMembershipModule() throws Exception
+    {
+        MembershipModule membershipModule = null;
+        
+        //get the role module from the portal
+        InitialContext ctx = new InitialContext();
+        membershipModule = (MembershipModule)new InitialContext().lookup(JBossPortalUtil.MEMBERSHIP_MODULE_JNDI_NAME);
+        
+        
+        return membershipModule;
+    }
+    
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static UserModule getUserModule() throws Exception
+    {
+        UserModule userModule = null;
+        
+        //get the user module from the portal 
+        InitialContext ctx = new InitialContext();
+        userModule = (UserModule)ctx.lookup(JBossPortalUtil.USER_MODULE_JNDI_NAME);
+        
+        return userModule;
+    }
+        
+    /**
+     * 
+     * @param user
+     * @throws Exception
+     */
+    public static void populateRoles(User user) throws Exception
+    {        
+        InitialContext context = new InitialContext();
+                
+        //perform this operation in the context of a JTA Transaction
+        if(user!=null && user.getIdentity()!=null)
+        {            
+            UserModule userModule = JBossPortalUtil.getUserModule();
+            
+            //grab the roles for this user
+            String username = user.getIdentity().getUserName();            
+            org.jboss.portal.identity.User portalUser = userModule.findUserByUserName(username);
+            Set roles = getMembershipModule().getRoles(portalUser);
+            if(!Util.isEmpty(roles))
+            {
+                for(Iterator itr=roles.iterator();itr.hasNext();)
+                {
+                    String roleName = ((org.jboss.portal.identity.Role)itr.next()).getName();
+                    Role role = new Role(roleName,roleName);
+                    user.getRoles().add(role);
+                }
+            }
+        }                
+    }
+}

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-mapping.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-mapping.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-mapping.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,343 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--  make sure all class values are fully qualified names of concrete classes. Interfaces are not supported at this point -->
+<!--  think of the extra-info tag in the permission tag as parameters to the custom Enforcer, Default Enforcer ignores these, extra-info tags are not required -->
+<!--  some rules regarding the relationships between the various concepts. These are subject to change as this framework evolves -->
+
+<!--
+	the functionId - id attribute within the function tag should be unique across the system
+	
+	A resource can be associated with multiple functions, but a resource cannot be associated with multiple modules
+	
+	Module defines the overall component that needs protection within the system, Function defines various protected functions within a Module, and
+	Resources are system level objects (java methods, user interface fragments etc) that need to be accessed to successfully perform a function 
+	within a module 
+			
+	An Enforcer is the object that actually performs the access control logic. The framework comes bundled with a DefaultEnforcer which should take care of 90% 
+    of ACL cases for an application. Applications can plug-in their own Enforcer that can perform this logic based on the runtime values, extra-parameter
+    values etc. Having the Enforcer perform the access control logic keeps any ACL checking code to be hard coded within the business logic of the
+    application. This leads to better flexibility from a security perspective of the system 
+    
+    List of system resources supported:
+    1) Java Class Methods - type=method
+    2) UI Fragments within a Page - type=fragment
+    
+    List of resource extensions:
+    3) JSF ManagedBean action - type=jsfAction
+ -->
+
+<acl>
+	<!-- Forums Admin Tool usecases  -->
+	<module id="adminTool" name="AdminTool">						
+		<function id="accessAdminTool" name="Access Admin Tool">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://accessAdminTool</id>
+			</resource>
+		</function>
+	
+		<function id="viewCategory" name="View Category">
+			<!-- ui protection -->
+			<resource type="fragment" criteriaId="viewCategory://ui">
+				<id>acl://viewCategory</id>
+			</resource>
+		</function>
+		
+		<function id="addCategory" name="Add Category">
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://addCategory</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>addCategory</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+		</function>
+		
+		<function id="editCategory" name="Edit Category">			
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://editCategory</id>
+			</resource>	
+			<!-- action protection -->
+			<resource type="jsfAction" criteriaId="editCategory://action">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>editCategory</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>addCategory</implies>			
+		</function>
+			
+		<function id="deleteCategory" name="Delete Category">
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://deleteCategory</id>
+			</resource>
+			<!-- action protection -->			
+			<resource type="jsfAction" criteriaId="deleteCategory://action">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>deleteCategory</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>addCategory</implies>
+			<implies>editCategory</implies>
+		</function>
+		
+		<function id="viewForum" name="View Forum">
+			<!-- ui protection -->
+			<resource type="fragment" criteriaId="viewForum://ui">
+				<id>acl://viewForum</id>
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+		</function>
+		 
+		<function id="addForum" name="Add Forum">
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://addForum</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>addForum</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>viewForum</implies>
+		</function>
+		
+		<function id="editForum" name="Edit Forum">
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://editForum</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction" criteriaId="editForum://action">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>editForum</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>viewForum</implies>
+			<implies>addForum</implies>
+		</function>
+		 		  
+		<function id="deleteForum" name="Delete Forum">
+			<!-- ui protection -->
+			<resource type="fragment">				
+				<id>acl://deleteForum</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction" criteriaId="deleteForum://action">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>deleteForum</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>viewForum</implies>
+			<implies>addForum</implies>
+			<implies>editForum</implies>
+		</function>  
+		<function id="lockForum" name="Ability to Lock forums">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://lockForums</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>lockForum</method>				
+			</resource>
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.AdminController</class>
+				<method>unlockForum</method>				
+			</resource>
+			<implies>accessAdminTool</implies>
+			<implies>viewCategory</implies>
+			<implies>viewForum</implies>
+			<implies>editForum</implies>
+		</function>	
+
+	</module>
+	
+	<!-- Message Board usecases -->
+	<module id="messageBoard" name="Message Board">
+		<!-- messageBoard navigation related -->
+		<function id="readCategory" name="Read Category">
+			<!-- ui protection -->
+			<resource type="fragment" criteriaId="readCategory://ui">
+				<id>acl://readCategory</id>
+			</resource>
+		</function>		
+		<function id="readForum" name="Read Forum">
+			<!-- ui protection -->
+			<resource type="fragment" criteriaId="readForum://ui">
+				<id>acl://readForum</id>
+			</resource>
+			<implies>readCategory</implies>
+		</function>
+	
+		<!-- posting related -->
+		<function id="post" name="Post a Message">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://newTopic</id>
+			</resource>
+			<resource type="fragment">
+				<id>acl://reply</id>
+			</resource>
+            <resource type="fragment" criteriaId="topicType://ui" >
+                <id>acl://topicType</id>
+            </resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.NewTopic</class>
+				<method>execute</method>				
+			</resource>
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.ReplyTopic</class>
+				<method>execute</method>				
+			</resource>			
+		</function>						
+		<function id="editPost" name="Edit a Post">
+			<!-- ui protection -->
+			<resource type="fragment" criteriaId="editPost://ui">
+				<id>acl://editPost</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction" criteriaId="editPost://action">				
+				<class>org.jboss.portlet.forums.ui.action.EditPost</class>
+				<method>execute</method>				
+			</resource>			
+			<implies>post</implies>
+		</function>		
+		<function id="deletePost" name="Delete a Post">			
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://deletePost</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.DeletePost</class>
+				<method>confirmDelete</method>				
+			</resource>			
+			<implies>post</implies>
+			<implies>editPost</implies>
+		</function>
+		
+		<!-- post attachment related -->
+		<function id="managePostAttachments" name="Manage Post Attachments">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://managePostAttachments</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.PostAction</class>
+				<method>addAttachment</method>				
+			</resource>
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.PostAction</class>
+				<method>deleteAttachment</method>				
+			</resource>
+		</function>						
+		
+		<!-- post poll related -->
+		<function id="votePoll" name="Vote for a Poll">			
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://votePoll</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.PollController</class>
+				<method>vote</method>				
+			</resource>
+		</function>								
+		<function id="managePoll" name="Manage a Poll">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://managePoll</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.PostAction</class>
+				<method>deleteOption</method>				
+			</resource>
+			<implies>votePoll</implies>
+		</function>				
+	</module>		
+	
+	<!-- Moderator Tool usecases -->	
+	<module id="moderatorTool" name="Moderator Tool">
+		<function id="moderateForum" name="Ability to Access the Moderator Tool">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://moderateForum</id>
+			</resource>
+		</function>
+		<function id="deleteTopics" name="Ability to Delete Topics in the Forum">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://deleteTopics</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.ModeratorAction</class>
+				<method>deleteTopic</method>				
+			</resource>
+			<implies>moderateForum</implies>
+		</function>
+		<function id="moveTopics" name="Ability to Move Topics in the Forum">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://moveTopics</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.ModeratorAction</class>
+				<method>moveTopic</method>				
+			</resource>
+			<implies>moderateForum</implies>
+		</function>
+		<function id="lockTopics" name="Ability to Lock Topics in the Forum">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://lockTopics</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.ModeratorAction</class>
+				<method>lockTopic</method>				
+			</resource>
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.ModeratorAction</class>
+				<method>unlockTopic</method>				
+			</resource>
+			<implies>moderateForum</implies>
+		</function>		
+		<!-- splitting a topic -->
+		<function id="splitTopic" name="Ability to Split a Topic in the Forum">
+			<!-- ui protection -->
+			<resource type="fragment">
+				<id>acl://splitTopic</id>
+			</resource>
+			<!-- action protection -->
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.SplitTopic</class>
+				<method>splitPosts</method>				
+			</resource>
+			<resource type="jsfAction">				
+				<class>org.jboss.portlet.forums.ui.action.SplitTopic</class>
+				<method>splitAfter</method>				
+			</resource>
+			<implies>moderateForum</implies>
+		</function>
+	</module>
+</acl>

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-permissions.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-permissions.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/acl-permissions.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,124 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+	Each role contains a set of permissions. Each permission/no-permission points to a function in the system that this role has/doesnot have access to.
+ -->
+
+<acl>				
+	<!--  dynamic roles/permissions defined for the application at runtime (either through the GUI or directly modifying this xml file) -->	
+	<!--
+			Sample permission = 
+			<permission functionId="editCategory"/>	 //plain without criteria
+			
+			<permission functionId="editCategory"> //complicated with criteria specification
+				<criteria context="jsfAction">target.categoryName.indexOf('sandbox') != -1</criteria>			
+				<criteria context="fragment">param[0].categoryName.toLowerCase().indexOf('sandbox') != -1</criteria>
+			</permission>				
+	-->
+	
+	<!--  
+		built-in system defined roles 
+	-->
+	<!-- non-logged in users -->
+	<role name="Anonymous" id="anonymous">	
+		<!-- Forums Admin Tool permissions -->
+		
+		
+		<!-- Message Board permissions -->
+		<!-- giving anonymous users permission to view only the Unit Testing Category of Forums -->
+		<!--permission action="readCategory">
+			<criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('unit testing')</criteria>
+		</permission-->	
+		<permission action="readForum"/>
+		
+		
+		<!-- Moderator Tool permissions -->									
+	</role>
+	
+	<!-- just a regular registered user -->	
+	<role name="User" id="user">
+		<!-- Forums Admin Tool permissions -->		
+		
+		<!-- Message Board permissions -->		
+		<permission action="readForum"/>
+		<permission action="post"/>
+		<!-- permission to edit only my own posts -->
+		<permission action="editPost">
+			<criteria for="editPost://ui">param[0].poster.user.userName.equals(identity.identity.userName)</criteria>
+			<criteria for="editPost://action">target.post.poster.user.userName.equals(identity.identity.userName)</criteria>
+		</permission>
+		
+		
+		<!-- Moderator Tool permissions -->			
+	</role>
+	
+	<!-- users with Admin privileges -->	
+	<role name="Admin" id="admin">
+		<!-- Forums Admin Tool permissions -->			
+		
+		
+		<!-- Message Board permissions -->
+		
+		
+		
+		<!-- Moderator Tool permissions -->			
+		
+		<!-- wild card permission -->
+		<permission action="all"/>		
+	</role>		
+	
+	<!-- 
+		deployment specific roles......just examples of how fine grained permissions can be assigned
+		this is an example of how the rules would possibly setup for JBoss.org Forums...
+		These policy rules vary for each consumer of forums depending on their own requirements of
+		access control security 
+	-->
+	
+	<!-- permissions specific to the Drools Team -->
+	<role name="Drools Team" id="droolsTeam">
+		<!-- Forums Admin Tool permissions -->
+		<permission action="viewCategory">
+			<criteria for="viewCategory://ui">param[0].title.toLowerCase().startsWith('jboss rules')</criteria>
+		</permission>
+		<permission action="deleteCategory">
+			<criteria for="deleteCategory://action">target.categoryName.toLowerCase().startsWith('jboss rules')</criteria>
+			<!-- also criteria for the implied edit category permission -->
+			<criteria for="editCategory://action">target.categoryName.toLowerCase().startsWith('jboss rules')</criteria>
+		</permission>
+		<permission action="viewForum">
+			<criteria for="viewForum://ui">param[0].name.toLowerCase().startsWith('jboss rules')</criteria>
+		</permission>			
+		<permission action="deleteForum">
+			<criteria for="deleteForum://action">target.forumName.toLowerCase().startsWith('jboss rules')</criteria>
+			<!-- also criteria for the implied edit category permission -->
+			<criteria for="editForum://action">target.forumName.toLowerCase().startsWith('jboss rules')</criteria>
+		</permission>
+		
+		<!-- Message Board permissions -->
+		<permission action="readCategory">
+			<criteria for="readCategory://ui">param[0].title.toLowerCase().startsWith('jboss rules')</criteria>
+		</permission>
+		<permission action="readForum"/>	
+		
+		
+		<!-- Moderator Tool permissions -->			
+	</role>
+	
+	<!-- permissions specific to the JBPM Team -->
+	<role name="JBPM Team" id="jbpmTeam">
+		<!-- Forums Admin Tool permissions -->
+		
+		<!-- Message Board permissions -->	
+				
+		<!-- Moderator Tool permissions -->		
+	</role>
+	
+	<!-- permissions specific to the Seam Team -->
+	<role name="Seam Team" id="seamTeam">
+		<!-- Forums Admin Tool permissions -->
+		
+		<!-- Message Board permissions -->	
+				
+		<!-- Moderator Tool permissions -->		
+	</role>
+</acl>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/authz-jaae-plugin/src/resources/forums-authz-plugin.sar/META-INF/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<server>
+	<!--  configure the AclKernelFactory that starts and registers the proper AclKernel implementation -->
+	<mbean code="org.jboss.security.acl.AclKernelFactory" 
+	name="org.jboss.security.acl.AclKernelFactory:service=aclKernelFactory"
+	xmbean-dd=""
+	>
+	    <attribute name="aclKernel">org.jboss.security.acl.JBossAclKernel</attribute>
+		<xmbean>
+			<class>org.jboss.security.acl.AclKernelFactory</class>
+			<constructor>
+      				<description>The no-arg constructor</description>
+      				<name>org.jboss.security.acl.AclKernelFactory</name>
+   			</constructor>
+			<attribute access="read-write" getMethod="getAclKernel" setMethod="setAclKernel">
+				     <name>aclKernel</name>
+					 <type>java.lang.String</type>
+					 <descriptors>
+					 	<default value="org.jboss.security.acl.JBossAclKernel"/>
+					 </descriptors>
+		    </attribute>	  
+		    <operation>
+		    	<description>The start lifecycle operation</description>
+		    	<name>start</name>
+		    </operation>
+		    <operation>
+		    	<description>The stop lifecycle operation</description>
+		    	<name>stop</name>
+		    </operation>
+		</xmbean>
+	</mbean>
+</server>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/build/.project
===================================================================
--- labs/jbossforums/branches/forums120P26/build/.project	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/.project	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>build</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Added: labs/jbossforums/branches/forums120P26/build/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/build/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+ at echo off
+rem
+rem  Invokes a script of the same name in the 'tools' module.
+rem  
+rem  The 'tools' module is expected to be a peer directory of the directory
+rem  in which this script lives.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:01:33 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/build/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/build/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+##  Invokes a script of the same name in the 'tools' module.
+##  
+##  The 'tools' module is expected to be a peer directory of the directory
+##  in which this script lives.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:01:33 vietj Exp $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+    if [ "x$TOOLS_ROOT" = "x" ]; then
+	TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+    fi
+
+    MODULE_ROOT=`cd $DIRNAME; pwd`
+    export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+    # Where is the target script?
+    target="$TOOLS_ROOT/bin/$PROGNAME"
+    if [ ! -f "$target" ]; then
+	echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+        echo "${PROGNAME}:"
+        echo "${PROGNAME}:    $target"
+        echo "${PROGNAME}:"
+	echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+	echo "${PROGNAME}: and make sure it is up to date."
+        exit 2
+    fi
+
+    # Get busy yo!
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: Executing: /bin/sh $target $@"
+    fi
+    if [ "x$TRACE" = "x" ]; then
+	exec /bin/sh $target "$@"
+    else
+	exec /bin/sh -x $target "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"


Property changes on: labs/jbossforums/branches/forums120P26/build/build.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/build/build.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/build.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/build.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+   <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+   <!ENTITY tools      SYSTEM "../tools/etc/buildfragments/tools.ent">
+   <!ENTITY libraries  SYSTEM "../tools/etc/buildfragments/libraries.ent">
+   <!ENTITY modules    SYSTEM "../tools/etc/buildfragments/modules.ent">
+   <!ENTITY defaults   SYSTEM "../tools/etc/buildfragments/defaults.ent">
+   <!ENTITY targets    SYSTEM "../tools/etc/buildfragments/targets.ent">
+]>
+
+<!-- $Id: build.xml,v 1.21 2005/12/09 17:32:23 sohil Exp $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss SSO: The OpenSource SSO Infrastructure                         |-->
+<!--|                                                                      |-->
+<!--| Distributable under LGPL license.                                     |-->
+<!--| See terms of license at http://www.gnu.org.                          |-->
+<!--|                                                                      |-->
+<!--| This file has been designed to work with the 'tools' module and      |-->
+<!--| Buildmagic extentions.                                               |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal Forums">
+
+   <!--+====================================================================+-->
+   <!--| Setup                                                              |-->
+   <!--|                                                                    |-->
+   <!--| Include the common build elements.                                 |-->
+   <!--|                                                                    |-->
+   <!--| This defines several different targets, properties and paths.      |-->
+   <!--| It also sets up the basic extention tasks amoung other things.     |-->
+   <!--+====================================================================+-->
+
+   &buildmagic;
+   &libraries;
+   &modules;
+   &defaults;
+   &tools;
+   &targets;
+
+   <!--+====================================================================+-->
+   <!--| Initialization                                                     |-->
+   <!--|                                                                    |-->
+   <!--| Initialize the build system.  Other targets should depend on       |-->
+   <!--| 'init'.                                                            |-->
+   <!--+====================================================================+-->
+
+   <target name="init" unless="init.disable" depends="_default:init">
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Configuration                                                      |-->
+   <!--|                                                                    |-->
+   <!--| This target is invoked by the Buildmagic initialization logic      |-->
+   <!--| and should contain module specific configuration elements.         |-->
+   <!--+====================================================================+-->
+
+   <target name="configure" unless="configure.disable">
+
+      <!--+==============================+-->
+      <!--| Project version information. |-->
+      <!--+==============================+-->
+
+      <property name="version.major" value="0"/>
+      <property name="version.minor" value="1"/>
+      <property name="version.revision" value="0"/>
+      <property name="version.tag" value="alpha"/>
+      <property name="version.name" value="Sweet"/>
+
+      <!-- This must be set to the CVS tag for any release -->
+      <property name="version.cvstag" value="HEAD"/>
+
+      <!-- Module name(s) & version -->
+      <property name="module.version"
+         value="${version.major}.${version.minor}.${version.revision}${version.tag}"/>
+
+      <!-- ========= -->
+      <!-- Libraries -->
+      <!-- ========= -->
+
+      <!-- The combined library classpath -->
+      <call target="configure-libraries"/>
+      <path id="library.classpath">
+      </path>
+
+      <!-- Configure modules -->
+      <call target="configure-modules"/>
+      <path id="dependentmodule.classpath">
+         <!-- Add dependent module classpath elements here. -->
+      </path>
+
+      <!--+=======================================+-->
+      <!--| Override any default properties here. |-->
+      <!--+=======================================+-->
+
+      <!-- Configure defaults & build tools -->
+      <call target="configure-defaults"/>
+      <call target="configure-tools"/>
+
+      <!--+=======================================+-->
+      <!--| Define module specific elements here. |-->
+      <!--+=======================================+-->
+
+      <!--+================================+-->
+      <!--| Define project structure here. |-->
+      <!--+================================+-->
+      <!-- The group to use by default -->
+      <property name="groups" value="default"/>
+      <!-- Sets up the module configuration. -->
+      <moduleconfig property="modules" selected="${groups}">
+
+         <!-- Modules -->	     
+         <module name="forums"/>
+		 <module name="authz-jaae-plugin"/>
+      	 <!-- Luca Stancapiano - 8 feb 2008 - new plugin for cluster standalone -->
+		 <module name="cache-plugin"/>
+      	 
+         
+         <!-- setup the default group -->
+         <group name="default">
+	   		<include modules="forums,authz-jaae-plugin,cache-plugin"/>
+         </group>
+         
+      </moduleconfig>
+
+      <!-- Configure project defaults -->
+      <call target="configure-project"/>
+
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Module Pass-through Hooks                                          |-->
+   <!--|                                                                    |-->
+   <!--| These hooks are executed after the above pass-through targets have |-->
+   <!--| finished with a given module.                                      |-->
+   <!--+====================================================================+-->
+
+   <!-- Add module pass-through hooks here. -->
+
+   <!--+====================================================================+-->
+   <!--| Compile                                                            |-->
+   <!--|                                                                    |-->
+   <!--| This target should depend on other compile-* targets for each      |-->
+   <!--| different type of compile that needs to be performed, short of     |-->
+   <!--| documentation compiles.                                            |-->
+   <!--+====================================================================+-->
+
+   <target name="compile"/>
+
+   <!--+====================================================================+-->
+   <!--| Generate Output                                                    |-->
+   <!--|                                                                    |-->
+   <!--| Generates the target output for this module. Target output is      |-->
+   <!--| the output which is ment to be released or used by external        |-->
+   <!--| modules.                                                           |-->
+   <!--+====================================================================+-->
+
+   <target name="output"
+      description="Generate all target output."
+      depends="init">
+      <!-- Add module specific elements here. -->
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Documents                                                          |-->
+   <!--|                                                                    |-->
+   <!--| Generate all documentation for this module.                        |-->
+   <!--+====================================================================+-->
+
+   <target name="docs" depends="_default:docs">
+     <!-- Add module specific elements here. -->
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Install & Release                                                  |-->
+   <!--+====================================================================+-->
+
+   <target name="release"
+      description="Builds the default release structure."
+      depends="modules-most, output"/>
+
+   <target name="release-full"
+      description="Builds the full release structure."
+      depends="modules-all, release"/>
+
+   <!--+====================================================================+-->
+   <!--| Misc.                                                              |-->
+   <!--|                                                                    |-->
+   <!--| Standard targets and psuedo-targets.                               |-->
+   <!--+====================================================================+-->
+
+   <target name="clean" depends="init, modules-clean, _buildmagic:clean"
+           description="Cleans up most generated files.">
+     <!-- Add module specific elements here. -->
+   </target>
+
+   <target name="clobber" depends="_buildmagic:clobber, clean, modules-clobber"
+           description="Cleans up all generated files.">
+     <!-- Add module specific elements here. -->
+   </target>
+
+   <target name="main" depends="most"
+           description="Executes the default target (most)."/>
+
+   <target name="all" depends="modules-all"
+           description="Executes all modules and builds everything."/>
+
+   <target name="most" depends="modules-most"
+           description="Executes all modules and builds most everything."/>
+
+   <target name="help" depends="_buildmagic:help:build"
+           description="Show this help message."/>
+	
+	
+   <!--
+	 | Deploy the application
+    -->	
+   <target name="deploy"
+      description="Deploy."
+      depends="main">      
+   </target>		
+</project>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/build/distrib.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/distrib.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/distrib.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,217 @@
+<project default="main" name="JBoss SSO Framework">
+
+   <property name="source.dir" value="../../jboss-portal-2.2"/>
+   <property name="release.version" value="2.2.1RC1"/>
+   <property name="portal.release.name" value="jboss-portal-${release.version}"/>
+   <property name="portal.build.bin" value="output/${portal.release.name}"/>
+   <property name="portal.build.src" value="output/${portal.release.name}-src"/>
+   <property name="portal.build.bundled" value="output/${portal.release.name}-bundled"/>
+   <property name="forums.release.name" value="jboss-forums-${release.version}"/>
+   <property name="forums.build.bin" value="output/${forums.release.name}"/>
+   <property name="forums.build.src" value="output/${forums.release.name}-src"/>
+
+   <fileset id="thirdparty-licences" dir="../thirdparty">
+      <include name="apache-jackrabbit/README.txt"/>
+      <include name="apache-myfaces/README.txt"/>
+      <include name="beanshell-beanshell/README.txt"/>
+      <include name="day-jcr/README.txt"/>
+      <include name="jakarta-collections/README.txt"/>
+      <include name="jakarta-fileupload/README.txt"/>
+      <include name="jakarta-io/README.txt"/>
+      <include name="jakarta-lang/README.txt"/>
+      <include name="jakarta-log4j/README.txt"/>
+      <include name="jakarta-logging/README.txt"/>
+      <include name="jakarta-lucene/README.txt"/>
+      <include name="jakarta-net/README.txt"/>
+      <include name="jboss-cache/README.txt"/>
+      <include name="portals-bridge/README.txt"/>
+      <include name="sun-el/README.txt"/>
+      <include name="sun-facelets/README.txt"/>
+      <include name="xom-xom/README.txt"/>
+   </fileset>
+
+   <!-- Build JBoss Portal artefacts -->
+   <target name="source.build">
+      <ant dir="${source.dir}/build" antfile="build.xml"/>
+      <ant dir="${source.dir}/core" antfile="build.xml" target="explode"/>
+      <ant dir="${source.dir}/core" antfile="build.xml" target="datasource"> 
+         <!-- Hack because invoking the datasource generation from another build file replace ${/} --> 
+         <property name="/" value="${/}"/> 
+      </ant>       <ant dir="${source.dir}/forums" antfile="build.xml"/>
+      <ant dir="${source.dir}/forums" antfile="build.xml" target="explode"/>
+   </target>
+
+   <!-- Build JBoss Portal documentation -->
+   <target name="doc.build">
+      <ant dir="${source.dir}-docs/referenceGuide" antfile="build.xml"/>
+      <ant dir="${source.dir}-docs/userGuide" antfile="build.xml"/>
+   </target>
+
+   <!-- Build JBoss Portal -->
+   <target name="build" depends="source.build,doc.build">
+   </target>
+
+   <target name="output" depends="build">
+
+      <!-- Create the output directory -->
+      <mkdir dir="output"/>
+
+      <!--
+         | JBoss Portal source distribution
+        -->
+
+      <!-- Source files -->
+      <mkdir dir="${portal.build.src}"/>
+      <copy todir="${portal.build.src}">
+         <fileset dir="${source.dir}" includes="**/*" excludes="*/output/**,**/CVS/*,**/build.log,build/local.properties,forums/**"/>
+      </copy>
+      <fixcrlf srcdir="${portal.build.src}" includes="**/*.sh" eol="lf" eof="remove"/>
+      <fixcrlf srcdir="${portal.build.src}" includes="**/*.bat" eol="crlf"/>
+
+      <!-- Documentation -->
+      <mkdir dir="${portal.build.src}/docs"/>
+      <mkdir dir="${portal.build.src}/docs/referenceGuide"/>
+      <copy todir="${portal.build.src}/docs/referenceGuide">
+         <fileset dir="${source.dir}-docs/referenceGuide/build/en/"/>
+      </copy>
+      <mkdir dir="${portal.build.src}/docs/userGuide"/>
+      <copy todir="${portal.build.src}/docs/userGuide">
+         <fileset dir="${source.dir}-docs/userGuide/build/en/"/>
+      </copy>
+      <copy file="${source.dir}-docs/readmeFiles/jboss-portal-src.README" todir="${portal.build.src}"/>
+
+      <!--
+         | JBoss Portal binaries distribution
+        -->
+
+      <!-- Documentation -->
+      <mkdir dir="${portal.build.bin}"/>
+      <mkdir dir="${portal.build.bin}/docs"/>
+      <mkdir dir="${portal.build.bin}/docs/referenceGuide"/>
+      <copy todir="${portal.build.bin}/docs/referenceGuide">
+         <fileset dir="${source.dir}-docs/referenceGuide/build/en/"/>
+      </copy>
+      <mkdir dir="${portal.build.bin}/docs/userGuide"/>
+      <copy todir="${portal.build.bin}/docs/userGuide">
+         <fileset dir="${source.dir}-docs/userGuide/build/en/"/>
+      </copy>
+
+      <!-- Exploded sar -->
+      <mkdir dir="${portal.build.bin}/jboss-portal.sar"/>
+      <copy todir="${portal.build.bin}/jboss-portal.sar">
+         <fileset dir="${source.dir}/core/output/lib/jboss-portal-exploded.sar">
+            <exclude name="**/forums/**"/>
+         </fileset>
+      </copy>
+
+      <!-- Datasources -->
+      <mkdir dir="${portal.build.bin}/setup"/>
+      <copy todir="${portal.build.bin}/setup">
+         <fileset dir="${source.dir}/core/output/resources/setup" includes="portal-*-ds.xml"/>
+      </copy>
+      <copy file="${source.dir}-docs/readmeFiles/jboss-portal-bin.README" todir="${portal.build.bin}"/>
+
+      <!-- Licences -->
+      <mkdir dir="${portal.build.bin}/docs/licenses"/>
+      <concat destfile="${portal.build.bin}/docs/licenses/thirdparty-licences.txt">
+         <fileset refid="thirdparty-licences"/>
+      </concat>
+      <copy todir="${portal.build.bin}/docs/licenses">
+         <fileset dir="licences"/>
+      </copy>
+
+      <!--
+        | JBoss Portal bundled distribution
+      -->
+      <mkdir dir="${portal.build.bundled}/docs/portal"/>
+      <mkdir dir="${portal.build.bundled}/server/default/deploy"/>
+      <copy todir="${portal.build.bundled}" file="${source.dir}-docs/readmeFiles/jboss-portal-bin.README"/>
+      <copy todir="${portal.build.bundled}/docs/portal/referenceGuide">
+         <fileset dir="${portal.build.bin}/docs/referenceGuide"/>
+      </copy>
+      <copy todir="${portal.build.bundled}/docs/portal/userGuide">
+         <fileset dir="${portal.build.bin}/docs/userGuide"/>
+      </copy>
+      <copy todir="${portal.build.bundled}/docs/portal/setup">
+         <fileset dir="${portal.build.bin}/setup"/>
+      </copy>
+      <copy todir="${portal.build.bundled}/docs/portal/licences">
+         <fileset dir="${portal.build.bin}/docs/licenses"/>
+      </copy>
+      <copy todir="${portal.build.bundled}/server/default/deploy/jboss-portal.sar">
+         <fileset dir="${portal.build.bin}/jboss-portal.sar"/>
+      </copy>
+      <copy todir="${portal.build.bundled}/server/default/deploy">
+         <fileset dir="${portal.build.bin}/setup" includes="portal-hsqldb-ds.xml"/>
+      </copy>
+
+      <!--
+       | JBoss Forums Portlet source distribution
+      -->
+
+      <!-- Source files -->
+      <mkdir dir="${forums.build.src}"/>
+      <copy todir="${forums.build.src}">
+         <fileset dir="${source.dir}" includes="forums/**" excludes="*/output/**,**/CVS/*,**/build.log"/>
+      </copy>
+      <fixcrlf srcdir="${forums.build.src}" includes="**/*.sh" eol="lf" eof="remove"/>
+      <fixcrlf srcdir="${forums.build.src}" includes="**/*.bat" eol="crlf"/>
+
+      <!-- Documentation -->
+      <mkdir dir="${forums.build.src}/docs"/>
+      <mkdir dir="${forums.build.src}/docs/referenceGuide"/>
+      <copy todir="${forums.build.src}/docs/referenceGuide">
+         <fileset dir="${source.dir}-docs/referenceGuide/build/en/"/>
+      </copy>
+      <mkdir dir="${forums.build.src}/docs/userGuide"/>
+      <copy todir="${forums.build.src}/docs/userGuide">
+         <fileset dir="${source.dir}-docs/userGuide/build/en/"/>
+      </copy>
+      <copy file="${source.dir}-docs/readmeFiles/jboss-forums-src.README" todir="${forums.build.src}"/>
+
+      <!--
+         | JBoss Forums Portlet binaries distribution
+        -->
+
+      <!-- Documentation -->
+      <mkdir dir="${forums.build.bin}"/>
+      <mkdir dir="${forums.build.bin}/docs"/>
+      <mkdir dir="${forums.build.bin}/docs/referenceGuide"/>
+      <copy todir="${forums.build.bin}/docs/referenceGuide">
+         <fileset dir="${source.dir}-docs/referenceGuide/build/en/"/>
+      </copy>
+      <mkdir dir="${forums.build.bin}/docs/userGuide"/>
+      <copy todir="${forums.build.bin}/docs/userGuide">
+         <fileset dir="${source.dir}-docs/userGuide/build/en/"/>
+      </copy>
+
+      <!-- Exploded ear -->
+      <mkdir dir="${forums.build.bin}/portal-forums.ear"/>
+      <copy todir="${forums.build.bin}/portal-forums.ear">
+         <fileset dir="${source.dir}/forums/output/lib/portal-forums-exploded.ear"/>
+      </copy>
+      <copy file="${source.dir}-docs/readmeFiles/jboss-forums-bin.README" todir="${forums.build.bin}"/>
+   </target>
+   
+   <!-- Create packages -->
+   <target name="package">
+      <tar destfile="${portal.build.src}.tar.gz"
+         compression="gzip">
+         <tarfileset dir="output/${portal.release.name}-src"
+            prefix="${portal.release.name}-src"/>
+      </tar>
+      <zip destfile="${portal.build.bin}.zip"
+         basedir="output/${portal.release.name}"/>
+      <tar destfile="${forums.build.src}.tar.gz"
+         compression="gzip">
+         <tarfileset dir="output/${forums.release.name}-src"
+            prefix="${forums.release.name}-src"/>
+      </tar>
+      <zip destfile="${forums.build.bin}.zip"
+         basedir="output/${forums.release.name}"/>
+   </target>
+
+   <!-- Build and compress everything -->
+   <target name="main" depends="output,package">
+   </target>
+</project>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/build/etc/clustered.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/clustered.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/clustered.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+portal.single=false
+portal.single.xml.open=<!--
+portal.single.xml.close=-->
+portal.clustered.xml.open=
+portal.clustered.xml.close=
+portal.cache.mode=REPL_SYNC
+portal.hibernate.cache.usage=transactional

Added: labs/jbossforums/branches/forums120P26/build/etc/hsqldb.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/hsqldb.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/hsqldb.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+# the cdata section is a trick because the empty chars has issues when using filtered copy
+portal.datasource.driver=org.hsqldb.jdbcDriver
+portal.datasource.url=jdbc:hsqldb:${jboss.server.data.dir}${/}portal${/}hypersonic${/}database
+portal.datasource.username=sa
+portal.datasource.password=<![CDATA[]]>

Added: labs/jbossforums/branches/forums120P26/build/etc/local.properties-example
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/local.properties-example	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/local.properties-example	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,50 @@
+### ====================================================================== ###
+##                                                                          ##
+##  Local project properties.                                               ##
+##                                                                          ##
+##    Define properties that are local to your environment here.  This      ##
+##    file (local.properties) should not be checked in.  Modify the         ##
+##    example to affect all users.                                          ##
+##                                                                          ##
+### ====================================================================== ###
+
+### General compiler configuration ###
+
+#build.compiler=jikes
+#build.warnings=true
+#build.pedantic=true
+#javac.depend=on
+
+### Javac/Jikes compiler configuration ###
+
+javac.optimize=off
+javac.debug=on
+javac.deprecation=on
+
+### Enable verbose build output ###
+
+#init.verbose=true
+
+### JavaDoc ###
+#docs-javadocs.disable=true
+
+### Do we build xdoclet or get it from thirdparty ###
+### uncomment for thirdparty: comment to use xdoclet module.
+### To use xdoclet module also uncomment the xdoclet line in groups in build/build.xml
+xdoclet.xdoclet.root=${project.root}/thirdparty/xdoclet-xdoclet
+
+# Portal database, for now : hsqldb, mysql, postgresql are the possible values
+portal.database=mysql
+# The datasource name used in the JNDI binding
+portal.datasource.name=PortalDS
+# Context root for the portal main servlet
+portal.web.context-root=/portal
+# JBoss server/<xxx> directory for Nukes, ie: $JBOSS_HOME/server/default
+
+#temporary mod
+portal.deploy.dir=portal-2.2.1rc1-dev
+
+# Build the portal for single or clustered environment
+portal.clustered=false
+# Show SQL or not
+portal.sql.show=false

Added: labs/jbossforums/branches/forums120P26/build/etc/mysql.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/mysql.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/mysql.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+portal.datasource.driver=org.gjt.mm.mysql.Driver
+portal.datasource.url=jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false
+portal.datasource.username=portal
+portal.datasource.password=portalpassword

Added: labs/jbossforums/branches/forums120P26/build/etc/oracle.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/oracle.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/oracle.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+portal.datasource.driver=oracle.jdbc.driver.OracleDriver
+portal.datasource.url=jdbc:oracle:thin:SYSTEM/password at localhost:1521:orcl
+portal.datasource.username=SYSTEM
+portal.datasource.password=password

Added: labs/jbossforums/branches/forums120P26/build/etc/postgresql.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/postgresql.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/postgresql.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+portal.datasource.driver=org.postgresql.Driver
+portal.datasource.url=jdbc:postgresql:jbossportal
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
+

Added: labs/jbossforums/branches/forums120P26/build/etc/single.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/single.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/single.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+portal.single=true
+portal.single.xml.open=
+portal.single.xml.close=
+portal.clustered.xml.open=<!--
+portal.clustered.xml.close=-->
+portal.cache.mode=LOCAL
+portal.hibernate.cache.usage=read-write

Added: labs/jbossforums/branches/forums120P26/build/etc/sqlserver.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/build/etc/sqlserver.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/etc/sqlserver.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+# This file uses a URL for the jTDS Type 4 JDBC driver (http://jtds.sourceforge.net/)
+# Documentation for the driver URL can be found at (http://jtds.sourceforge.net/faq.html#urlFormat)
+hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
+portal.datasource.driver=net.sourceforge.jtds.jdbc.Driver
+portal.datasource.url=jdbc:jtds:sqlserver://localhost:1433;tds=8.0;lastupdatecount=true
+portal.datasource.username=portal
+portal.datasource.password=portalpassword

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/codestyles/jboss.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/codestyles/jboss.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea45/config/codestyles/jboss.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<code_scheme name="jboss">
+  <option name="JAVA_INDENT_OPTIONS">
+    <value>
+      <option name="INDENT_SIZE" value="3" />
+      <option name="CONTINUATION_INDENT_SIZE" value="3" />
+      <option name="TAB_SIZE" value="3" />
+      <option name="USE_TAB_CHARACTER" value="false" />
+      <option name="SMART_TABS" value="false" />
+    </value>
+  </option>
+  <option name="BRACE_STYLE" value="2" />
+  <option name="CLASS_BRACE_STYLE" value="2" />
+  <option name="METHOD_BRACE_STYLE" value="2" />
+  <option name="ELSE_ON_NEW_LINE" value="true" />
+  <option name="WHILE_ON_NEW_LINE" value="true" />
+  <option name="CATCH_ON_NEW_LINE" value="true" />
+  <option name="FINALLY_ON_NEW_LINE" value="true" />
+  <option name="INDENT_CASE_FROM_SWITCH" value="false" />
+  <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+  <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="5000" />
+  <option name="IF_BRACE_FORCE" value="3" />
+  <option name="DOWHILE_BRACE_FORCE" value="3" />
+  <option name="WHILE_BRACE_FORCE" value="3" />
+  <option name="FOR_BRACE_FORCE" value="3" />
+</code_scheme>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/codestyles/jboss.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/codestyles/jboss.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/codestyles/jboss.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<code_scheme name="jboss">
+  <option name="JAVA_INDENT_OPTIONS">
+    <value>
+      <option name="INDENT_SIZE" value="3" />
+      <option name="CONTINUATION_INDENT_SIZE" value="3" />
+      <option name="TAB_SIZE" value="3" />
+      <option name="USE_TAB_CHARACTER" value="false" />
+      <option name="SMART_TABS" value="false" />
+      <option name="LABEL_INDENT_SIZE" value="0" />
+      <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+    </value>
+  </option>
+  <option name="BRACE_STYLE" value="2" />
+  <option name="CLASS_BRACE_STYLE" value="2" />
+  <option name="METHOD_BRACE_STYLE" value="2" />
+  <option name="ELSE_ON_NEW_LINE" value="true" />
+  <option name="WHILE_ON_NEW_LINE" value="true" />
+  <option name="CATCH_ON_NEW_LINE" value="true" />
+  <option name="FINALLY_ON_NEW_LINE" value="true" />
+  <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+  <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="5000" />
+  <option name="IF_BRACE_FORCE" value="3" />
+  <option name="DOWHILE_BRACE_FORCE" value="3" />
+  <option name="WHILE_BRACE_FORCE" value="3" />
+  <option name="FOR_BRACE_FORCE" value="3" />
+  <option name="XML_KEEP_WHITESPACES" value="true" />
+</code_scheme>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/Body Header.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/Body Header.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/Body Header.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/File Header.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/File Header.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/includes/File Header.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,21 @@
+/*
+* 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.
+*/

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/AnnotationType.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/AnnotationType.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/AnnotationType.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public @interface ${NAME} {
+}

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Class.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Class.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Class.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public class ${NAME} {
+}

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Enum.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Enum.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Enum.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public enum ${NAME} {
+}

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Interface.java
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Interface.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/config/fileTemplates/internal/Interface.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public interface ${NAME} {
+}

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/api/api.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/api/api.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/api/api.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../api/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../api">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../api/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../api/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/bridge/bridge.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/bridge/bridge.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/bridge/bridge.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../bridge/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../bridge">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../bridge/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="api" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/portals-bridge/lib/portals-bridges-common-0.2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/cms/cms.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/cms/cms.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/cms/cms.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../cms/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../cms">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../cms/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../cms/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-server/lib/jboss.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-jackrabbit/lib/jackrabbit-core.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-jackrabbit/lib/jackrabbit-commons.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/day-jcr/lib/jcr.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-io/lib/commons-io.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-logging/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/common/common.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/common/common.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/common/common.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../common/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../common">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../common/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../common/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/junit-junit/lib/junit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-log4j/lib/log4j.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-ant/lib/ant.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-j2ee/lib/jboss-j2ee.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-system/lib/jboss-system.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-system/lib/jboss-jmx.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-system/lib/jboss-common.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/oswego-concurrent/lib/concurrent.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-activation/lib/activation.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../tools/lib/xalan.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/core/core.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/core/core.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/core/core.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../core/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../core">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../core/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../core/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="theme" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module" module-name="portlet" />
+    <orderEntry type="module" module-name="format" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="cms" />
+    <orderEntry type="module" module-name="api" />
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-hibernate/lib/hibernate.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-cache/lib/jgroups.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dom4j-dom4j/lib/dom4j.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-sx/lib/jbosssx.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/jsp-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dbunit-dbunit/lib/dbunit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-cactus/lib/cactus.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-httpclient/lib/commons-httpclient.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jwebunit-jwebunit/lib/jwebunit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-server/lib/jboss.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-logging/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/beanshell-beanshell/lib/bsh.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-javamail/lib/mail.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-cache/lib/jboss-cache.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-myfaces/lib/tomahawk.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-myfaces/lib/myfaces-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="security" />
+    <orderEntry type="module" module-name="faces" />
+    <orderEntry type="module" module-name="facelets" />
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/faces/faces.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/faces/faces.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/faces/faces.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../faces/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../faces">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../faces/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-myfaces/lib/myfaces-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/jsp-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/format/format.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/format/format.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/format/format.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../format/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../format">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../format/output/gen/classes" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../format/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-javassist/lib/javassist.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dom4j-dom4j/lib/dom4j.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/forums/forums.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/forums/forums.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/forums/forums.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../forums/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../forums">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../forums/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="core" />
+    <orderEntry type="module" module-name="api" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="format" />
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/migration/migration.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/migration/migration.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/migration/migration.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../migration/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../migration">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../migration/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="core" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module" module-name="portlet" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dbunit-dbunit/lib/dbunit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-logging/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/portlet/portlet.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/portlet/portlet.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/portlet/portlet.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../portlet/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../portlet">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../portlet/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../portlet/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module" module-name="api" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/jsp-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dom4j-dom4j/lib/dom4j.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="security" />
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/security/security.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/security/security.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/security/security.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../security/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../security">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../security/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../security/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-cache/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-cache/lib/jboss-cache.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-cache/lib/jgroups.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-j2ee/lib/jboss-j2ee.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-sx/lib/jbosssx.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/server/server.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/server/server.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/server/server.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../server/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../server">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../server/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../server/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jakarta-httpclient/lib/commons-httpclient.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-server/lib/jboss.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-client/lib/jbossall-client.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/theme/theme.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/theme/theme.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/theme/theme.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../theme/output/idea50/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../theme">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../theme/src/main" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../../../../../../theme/output" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/jsp-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="ACTIVE_VCS_NAME" value="CVS" />
+    <option name="USE_PROJECT_VCS" value="false" />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/wsrp/wsrp.iml
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/wsrp/wsrp.iml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/modules/wsrp/wsrp.iml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/../../../../../../wsrp/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../../../wsrp">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../wsrp/src/generated" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../../../wsrp/src/main" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="server" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/readme.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/readme.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/ide/intellij/idea50/readme.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,22 @@
+- Creating the project from the modules :
+
+1/ create a project :
+file/new project
+fill in name : jboss-portal-2.2
+click next
+select JDK version
+click next
+select "Create/configure multi-module project"
+click finish
+
+2/ The module manager appears :
+select "Import existing module"
+select the path to one of the .iml files of the modules, for instance the common module
+click finish
+then click in the Modules panel the Add button and repeat the process to add all the remaining modules
+
+3/ Once it is finished click the ok button and it's done
+
+- Codestyles and headers : in the config directory there are the standard config files for the JBoss Portal project.
+When you install idea it creates a config directory in your ${user.home}/.intellij. The config directory contains
+replacement for some of these that you have to apply.

Added: labs/jbossforums/branches/forums120P26/build/licences/apache-1.1.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/apache-1.1.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/apache-1.1.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,58 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache at apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
+ */
+

Added: labs/jbossforums/branches/forums120P26/build/licences/apache-2.0.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/apache-2.0.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/apache-2.0.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.

Added: labs/jbossforums/branches/forums120P26/build/licences/bsd.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/bsd.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/bsd.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,27 @@
+The BSD License
+
+    The following is a BSD license template. To generate your own license, change the values of OWNER, ORGANIZATION and YEAR from their original values as given here, and substitute your own.
+
+    Note: The advertising clause in the license appearing on BSD Unix files was officially rescinded by the Director of the Office of Technology Licensing of the University of California on July 22 1999. He states that clause 3 is "hereby deleted in its entirety."
+
+    Note the new BSD license is thus equivalent to the MIT License, except for the no-endorsement final clause.
+
+<OWNER> = Regents of the University of California
+<ORGANIZATION> = University of California, Berkeley
+<YEAR> = 1998
+
+In the original BSD license, both occurrences of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS".
+
+Here is the license template:
+
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

Added: labs/jbossforums/branches/forums120P26/build/licences/cddl-1.0.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/cddl-1.0.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/cddl-1.0.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,113 @@
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications.
+
+1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
+
+1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
+
+1.4. Executable means the Covered Software in any form other than Source Code.
+
+1.5. Initial Developer means the individual or entity that first makes Original Software available under this License.
+
+1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
+
+1.7. License means this document.
+
+1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. Modifications means the Source Code and Executable form of any of the following:
+
+A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
+
+B. Any new file that contains any part of the Original Software or previous Modification; or
+
+C. Any new file that is contributed or otherwise made available under the terms of this License.
+
+1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License.
+
+1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
+
+1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+2.1. The Initial Developer Grant.
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
+(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
+(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices.
+
+2.2. Contributor Grant.
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
+(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+4.1. New Versions.
+Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a writt!
 en agreement with Participant.
+
+6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract!
  shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/build/licences/lgpl.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/lgpl.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/lgpl.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library 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 library 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 library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+

Added: labs/jbossforums/branches/forums120P26/build/licences/mozilla-1.0.1.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/build/licences/mozilla-1.0.1.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/licences/mozilla-1.0.1.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,168 @@
+MOZILLA PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+      1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
+
+      1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications.
+
+      1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+      1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+      1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+      1.5. ''Executable'' means Covered Code in any form other than Source Code.
+
+      1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+      1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+      1.8. ''License'' means this document.
+
+      1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+      1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+            A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+            B. Any new file that contains any part of the Original Code or previous Modifications.
+             
+      1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+      1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation,  method, process, and apparatus claims, in any patent Licensable by grantor.
+
+      1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+      1.12. "You'' (or "Your")  means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+      2.1. The Initial Developer Grant.
+      The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+
+            (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+            (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+
+            (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code;  or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+             
+      2.2. Contributor Grant.
+      Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+            (a)  under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+
+            (b) under Patent Claims infringed by the making, using, or selling of  Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of  Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+            (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+
+            (d)    Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2)  separate from the Contributor Version;  3)  for infringements caused by: i) third party modifications of Contributor Version or ii)  the combination of Modifications made by that Contributor with other software  (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+      3.1. Application of License.
+      The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+      3.2. Availability of Source Code.
+      Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+      3.3. Description of Modifications.
+      You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+      3.4. Intellectual Property Matters
+            (a) Third Party Claims.
+            If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+            (b) Contributor APIs.
+            If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+             
+                (c)    Representations.
+            Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+
+      3.5. Required Notices.
+      You must duplicate the notice in Exhibit A in each file of the Source Code.  If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice.  If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A.  You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and Y!
 ou hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+      3.6. Distribution of Executable Versions.
+      You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable!
  version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+      3.7. Larger Works.
+      You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+      If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+      This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+      6.1. New Versions.
+      Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+      6.2. Effect of New Versions.
+      Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+      6.3. Derivative Works.
+      If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+      COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+      8.1.  This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+      8.2.  If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant")  alleging that:
+
+      (a)  such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i)  agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant.  If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+      (b)  any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+
+      8.3.  If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+      8.4.  In the event of termination under Sections 8.1 or 8.2 above,  all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+      UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+      The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+
+      This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expre!
 ssly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+      As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+      Initial Developer may designate portions of the Covered Code as Multiple-Licensed.  Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+
+
+EXHIBIT A -Mozilla Public License.
+
+      The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+
+      Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+      ANY KIND, either express or implied. See the License for the specific language governing rights and
+      limitations under the License.
+
+      The Original Code is Javassist.
+
+      The Initial Developer of the Original Code is Shigeru Chiba. Portions created by the Initial Developer are
+        Copyright (C) 1999-2004 Shigeru Chiba. All Rights Reserved.
+
+      Contributor(s): ______________________________________.
+
+      Alternatively, the contents of this file may be used under the terms of the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MPL or the LGPL.
+

Added: labs/jbossforums/branches/forums120P26/build/local.properties.sample
===================================================================
--- labs/jbossforums/branches/forums120P26/build/local.properties.sample	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/local.properties.sample	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,48 @@
+### ====================================================================== ###
+##                                                                          ##
+##  Local project properties.                                               ##
+##                                                                          ##
+##    Define properties that are local to your environment here.  This      ##
+##    file (local.properties) should not be checked in.  Modify the         ##
+##    example to affect all users.                                          ##
+##                                                                          ##
+### ====================================================================== ###
+
+### General compiler configuration ###
+
+#build.compiler=jikes
+#build.warnings=true
+#build.pedantic=true
+#javac.depend=on
+### Javac/Jikes compiler configuration ###
+javac.optimize=off
+javac.debug=on
+javac.deprecation=on
+
+### Enable verbose build output ###
+
+#init.verbose=true
+
+### JavaDoc ###
+#docs-javadocs.disable=true
+### Do we build xdoclet or get it from thirdparty ###
+### uncomment for thirdparty: comment to use xdoclet module.
+### To use xdoclet module also uncomment the xdoclet line in groups in build/build.xml
+#xdoclet.xdoclet.root=${project.root}/thirdparty/xdoclet-xdoclet
+# Portal database, for now : hsqldb, mysql, postgresql are the possible values
+portal.database=mysql
+# The datasource name used in the JNDI binding
+portal.datasource.name=PortalDS
+# Context root for the portal main servlet
+portal.web.context-root=/portal
+# JBoss server/<xxx> directory for Nukes, ie: $JBOSS_HOME/server/default
+
+# Build the portal for single or clustered environment
+portal.clustered=false
+# Show SQL or not
+portal.sql.show=false
+#specifyMe: this is user's local environment specific
+portal.deploy.dir=default
+
+# Fill this property with JBoss AS location e.g. /home/user/JBossAS or C:\JBossAS
+jboss.home=


Property changes on: labs/jbossforums/branches/forums120P26/build/local.properties.sample
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/build/misc/codeguide.html
===================================================================
--- labs/jbossforums/branches/forums120P26/build/misc/codeguide.html	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/build/misc/codeguide.html	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,117 @@
+<html>
+
+<head>
+<style type="text/css">
+pre { border-style:solid; border-width:thin; padding:5px; background-color:#EEEEFF;}
+span.bad { text-decoration:line-through; }
+span.important { font-weight:bold; color:red; }
+</style>
+</head>
+
+<body>
+
+<h2>Coding Conventions</h2>
+
+<h3>Some more general guidelines</h3>
+<ul>
+<li>Fully qualified imports should be used, rather than importing x.y.*.</li>
+<li>Use newlines for opening braces, so that the top and bottom braces can be visually matched.</li>
+<li>Aid visual separation of logical steps by introducing newlines and appropriate comments above them.</li>
+</ul>
+
+
+<h3>A class that conforms to JBoss coding guidelines</h3>
+
+<pre>
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package x;
+
+// <span class="important">Explicit imports</span>
+import a.b.C1; // <span class="important">good</span>
+import a.b.C2;
+import a.b.C3;
+
+// <span class="important">Do not write</span>
+<span class="bad">import a.b.*;</span>  // <span class="important">bad</span>
+
+// <span class="important">DO NOT USE "TAB" TO INDENT CODE USE *3* SPACES FOR PORTABILITY AMONG EDITORS</span>
+
+/**
+ * A description of this class.
+ *
+ * @see SomeRelatedClass.
+ *
+ * @version &lt;tt&gt;$Revision: 1.3 $&lt;/tt&gt;
+ * @author  &lt;a href="mailto:{email}"&gt;{full name}&lt;/a&gt;
+ */
+public class X
+   extends Y
+   implements Z
+{
+   public void startService() throws Exception
+   { 
+      // Use the newline for the opening bracket so we can match top              
+      // and bottom bracket visually
+      
+      Class cls = Class.forName(dataSourceClass);
+      vendorSource = (XADataSource)cls.newInstance();
+      
+      // Jump a line between logically distinct <span class="important">steps</span> and add<
+      // line of comment to it
+      cls = vendorSource.getClass();
+
+      // Comment lines <span class="important">always</span> start with an uppercase
+      // except if it is the second line
+      if(properties != null) 
+      {
+      
+         try
+         {
+         }
+         catch (IOException ioe)
+         {
+         }
+         for (Iterator i = props.entrySet().iterator(); i.hasNext();)
+         {
+            
+            // Get the name and value for the attributes
+            Map.Entry entry = (Map.Entry) i.next();
+            String attributeName = (String) entry.getKey();
+            String attributeValue = (String) entry.getValue();
+            
+            // Print the debug message
+            log.debug("Setting attribute '" + attributeName + "' to '" + attributeValue + "'");
+            
+            // get the attribute 
+            Method setAttribute =
+            cls.getMethod("set" + attributeName, new Class[] { String.class });
+            
+            // And set the value  
+            setAttribute.invoke(vendorSource, new Object[] { attributeValue });
+         }
+      }
+      
+      <span class="bad">// this is a <span class="important">bad</span> comment line because it starts with a lower case</span>
+      vendorSource.getXAConnection().close();
+      
+      // Bind in JNDI
+      bind(new InitialContext(), "java:/"+getPoolName(),
+         new Reference(vendorSource.getClass().getName(),
+            getClass().getName(), null));
+
+      // Block must always be delimited explicitely
+      if (0 == 0)
+      <span class="important">{</span>
+         System.out.println(true);
+      <span class="important">}</span>
+
+   }
+}
+</pre>
+</body>
+</html>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/cache-plugin/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+ at echo off
+rem
+rem  Invokes a script of the same name in the 'tools' module.
+rem  
+rem  The 'tools' module is expected to be a peer directory of the directory
+rem  in which this script lives.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/build.bat
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+##  Invokes a script of the same name in the 'tools' module.
+##  
+##  The 'tools' module is expected to be a peer directory of the directory
+##  in which this script lives.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+    if [ "x$TOOLS_ROOT" = "x" ]; then
+	TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+    fi
+
+    MODULE_ROOT=`cd $DIRNAME; pwd`
+    export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+    # Where is the target script?
+    target="$TOOLS_ROOT/bin/$PROGNAME"
+    if [ ! -f "$target" ]; then
+	echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+        echo "${PROGNAME}:"
+        echo "${PROGNAME}:    $target"
+        echo "${PROGNAME}:"
+	echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+	echo "${PROGNAME}: and make sure it is up to date."
+        exit 2
+    fi
+
+    # Get busy yo!
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: Executing: /bin/sh $target $@"
+    fi
+    if [ "x$TRACE" = "x" ]; then
+	exec /bin/sh $target "$@"
+    else
+	exec /bin/sh -x $target "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/build.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/build.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/build.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/build.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+   <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+   <!ENTITY tools      SYSTEM "../tools/etc/buildfragments/tools.ent">
+   <!ENTITY libraries  SYSTEM "../tools/etc/buildfragments/libraries.ent">
+   <!ENTITY modules    SYSTEM "../tools/etc/buildfragments/modules.ent">
+   <!ENTITY defaults   SYSTEM "../tools/etc/buildfragments/defaults.ent">
+   <!ENTITY targets    SYSTEM "../tools/etc/buildfragments/targets.ent">
+   ]>
+
+<!-- $Id: build.xml,v 1.13 2005/11/05 15:02:50 bdaw Exp $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File                      |-->
+<!--|                                                                      |-->
+<!--| Distributable under LGPL license.                                    |-->
+<!--| See terms of license at http://www.gnu.org.                          |-->
+<!--|                                                                      |-->
+<!--| This file has been designed to work with the 'tools' module and      |-->
+<!--| Buildmagic extentions.                                               |-->
+<!--+======================================================================+-->
+
+<project default="main" name="Forums Cache Plugin based on JBoss Cache">
+
+	<!--+====================================================================+-->
+   <!--| Setup                                                              |-->
+   <!--|                                                                    |-->
+   <!--| Include the common build elements.                                 |-->
+   <!--|                                                                    |-->
+   <!--| This defines several different targets, properties and paths.      |-->
+   <!--| It also sets up the basic extention tasks amoung other things.     |-->
+   <!--+====================================================================+-->
+
+   &buildmagic;
+   &libraries;
+   &modules;
+   &defaults;
+   &tools;
+   &targets;
+
+   
+         
+   <!-- ================================================================== -->
+   <!-- Initialization                                                     -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Initialize the build system.  Must depend on '_buildmagic:init'.
+     | Other targets should depend on 'init' or things will mysteriously fail.
+   -->
+
+   <target name="init" unless="init.disable" depends="_buildmagic:init">
+      <available file="${forums.lib}" type="dir"/>
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Configuration                                                      |-->
+   <!--|                                                                    |-->
+   <!--| This target is invoked by the Buildmagic initialization logic      |-->
+   <!--| and should contain module specific configuration elements.         |-->
+   <!--+====================================================================+-->
+
+   <target name="configure" unless="configure.disable">
+
+	  <!-- Configure some properties -->
+      <property name="jndi-root" value="portal"/>
+
+      <!-- Configure thirdparty libraries -->
+      <call target="configure-libraries"/>
+		<path id="library.classpath">	        
+			<path refid="jboss.cache.classpath"/>				        
+			<path refid="jgroups.classpath"/>
+			<path refid="jboss.system.classpath"/>					
+			<path refid="jboss.hibernate.classpath"/>						
+			<path refid="jakarta.log4j.classpath"/>									
+			<path refid="jboss.j2ee.classpath"/>		
+		</path>
+
+      <!-- Configure modules -->
+      <call target="configure-modules"/>
+	
+	    <!-- removing all src level dependency on portal....helps with building
+	    the forum application that upgrades easier across portal releases -->
+		<path id="dependentmodule.classpath">
+			<path refid="forums.classpath"/>
+			<!--path refid="jboss.portal-format.classpath"/>
+			<path refid="jboss.portal-common.classpath"/>
+			<path refid="jboss.portal-portlet.classpath"/>
+			<path refid="jboss.portal-server.classpath"/>
+			<path refid="jboss.portlet-api.classpath"/>
+			<path refid="jboss.hibernate.classpath"/-->
+		</path>
+
+      <!--+=======================================+-->
+      <!--| Override any default properties here. |-->
+      <!--+=======================================+-->
+
+      <!-- Configure defaults & build tools -->
+      <call target="configure-defaults"/>
+		<call target="configure-tools"/>
+
+      <!--+=======================================+-->
+      <!--| Define module specific elements here. |-->
+      <!--+=======================================+-->
+      <property name="javadoc.private" value="true"/>
+		<property name="javadoc.protected" value="false"/>
+
+	</target>
+
+
+   <!--+====================================================================+-->
+   <!--| Compile                                                            |-->
+   <!--|                                                                    |-->
+   <!--| This target should depend on other compile-* targets for each      |-->
+   <!--| different type of compile that needs to be performed, short of     |-->
+   <!--| documentation compiles.                                            |-->
+   <!--+====================================================================+-->
+
+   <target name="compile" description="Compile all source files." depends="generate-classes,
+               _default:compile-classes,
+               _default:compile-etc,
+               _default:compile-resources">		
+	</target>
+
+   <!-- Generate all class files -->
+   <target name="generate-classes" depends="init">
+	</target>
+
+   <!-- Remove or change the delimiter in hibernate-export if your database has a different deliniter -->
+   <target name="ddl" depends="output">		
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Generate Output                                                    |-->
+   <!--|                                                                    |-->
+   <!--| Generates the target output for this module. Target output is      |-->
+   <!--| the output which is ment to be released or used by external        |-->
+   <!--| modules.                                                           |-->
+   <!--+====================================================================+-->
+
+   <target name="output" description="Generate all target output." depends="compile">
+
+	  <mkdir dir="${build.lib}"/>
+
+      <!-- forums-cache-plugin.jar -->
+      <jar jarfile="${build.lib}/forums-cache-plugin.jar">
+			<fileset dir="${build.classes}"/>
+	  </jar>
+
+      <!-- forums-cache-plugin.sar -->
+      <jar jarfile="${build.lib}/portal-forums-cache-plugin.sar">
+		<!-- forums-cache-plugin.jar -->
+		<fileset dir="${build.lib}" includes="*.jar"/>
+		<!-- sar configuration files -->
+		<fileset dir="${build.resources}/forums-cache-plugin.sar"/>
+      </jar>    
+              
+         <!-- Luca Stancapiano - 30 gen 2008 - I added theese six 
+              rows to achieve complete create for jboss-forums-ha.ear -->
+         <copy todir="${forums.root}/resources/portal-forums-ha-ear">
+		<fileset dir="${build.lib}" includes="portal-forums-cache-plugin.sar"/>
+         </copy>
+         <jar jarfile="${forums.lib}/jboss-forums-ha.ear">
+		<fileset dir="${forums.root}/resources/portal-forums-ha-ear" includes="**/*"/>
+         </jar>
+      
+         <!-- end patch 7 apr 2007 -->
+      
+	</target>
+
+	<target name="explode" depends="init">
+		<explode file="${build.lib}/portal-forums-cache-plugin.sar" todir="${build.lib}" name="portal-forums-cache-plugin-exploded.sar"/>
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Cleaning                                                           -->
+   <!-- ================================================================== -->
+
+   <!-- Clean up all build output -->
+   <target name="clean" depends="_default:clean">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Documents                                                          |-->
+   <!--|                                                                    |-->
+   <!--| Generate all documentation for this module.                        |-->
+   <!--+====================================================================+-->
+
+   <target name="docs" depends="_default:docs">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Misc.                                                              -->
+   <!-- ================================================================== -->
+
+   <target name="main" depends="most"/>
+	<target name="all" depends="_default:all"/>
+	<target name="most" depends="_default:most"/>
+	<target name="help" depends="_default:help"/>
+
+   <!-- ================================================================== -->
+   <!-- Deployment                                                         -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Deploy the application
+   -->
+   <target name="deploy" description="Deploy." depends="output">
+		<!--<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<copy file="${build.lib}/portal-forums-cache-plugin.sar" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>-->
+		<require file="../forums/output/lib"/>
+		<copy file="${build.lib}/portal-forums-cache-plugin.sar" todir="../forums/output/lib/"/>
+	</target>
+
+   <!--
+     | Undeploy the application
+   -->
+   <target name="undeploy" description="Undeploy." depends="init">
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<delete file="${jboss.home}/server/${portal.deploy.dir}/deploy/portal-forums-cache-plugin.sar"/>		
+	</target>
+
+	<target name="test" depends="init">
+	</target>
+</project>


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/build.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util.cache;
+
+import org.jboss.logging.Logger;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * JBoss service integration helper.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
+ * @version $Revision: 8784 $
+ */
+public class AbstractJBossService extends ServiceMBeanSupport
+{
+
+   public AbstractJBossService()
+   {
+   }
+
+   public AbstractJBossService(final Class type)
+   {
+      super(type);
+   }
+
+   public AbstractJBossService(final String category)
+   {
+      super(category);
+   }
+
+   public AbstractJBossService(final Logger log)
+   {
+      super(log);
+   }
+
+   public final int getState()
+   {
+      return super.getState();
+   }
+
+   public final String getStateString()
+   {
+      return super.getStateString();
+   }
+
+   public final void create() throws Exception
+   {
+      super.create();
+   }
+
+   public final void start() throws Exception
+   {
+      super.start();
+   }
+
+   public final void stop()
+   {
+      super.stop();
+   }
+
+   public final void destroy()
+   {
+      super.destroy();
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util.cache;
+
+import org.jboss.cache.TreeCache;
+
+import javax.management.ObjectName;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
+ * @version $Revision: 8784 $
+ */
+public class JBossTreeCacheProvider extends AbstractJBossService implements TreeCacheProvider, JBossTreeCacheProviderMBean
+{
+
+   private ObjectName cacheName;
+
+   public ObjectName getCacheName()
+   {
+      return cacheName;
+   }
+
+   public void setCacheName(ObjectName cacheName)
+   {
+      this.cacheName = cacheName;
+   }
+
+   public TreeCache getTreeCache()
+   {
+      try
+      {
+         return (TreeCache)server.getAttribute(cacheName, "Instance");
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot get cache instance", e);
+         return null;
+      }
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProviderMBean.java
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProviderMBean.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProviderMBean.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util.cache;
+
+import org.jboss.cache.TreeCache;
+
+import javax.management.ObjectName;
+
+/**
+ */
+public interface JBossTreeCacheProviderMBean
+{
+
+   public ObjectName getCacheName();
+
+   public void setCacheName(ObjectName cacheName);
+
+   public TreeCache getTreeCache();
+}


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProviderMBean.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util.cache;
+
+import org.apache.log4j.Logger;
+import org.hibernate.cache.Cache;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.CacheProvider;
+import org.hibernate.cache.OptimisticTreeCache;
+import org.hibernate.cache.TreeCache;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.util.Properties;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
+ * @version $Revision: 9318 $
+ */
+public class JMXTreeCacheProvider implements CacheProvider
+{
+
+   /** Our logger. */
+   private static final Logger log = Logger.getLogger(JMXTreeCacheProvider.class);
+
+   public boolean isMinimalPutsEnabledByDefault()
+   {
+      return true;
+   }
+
+   public Cache buildCache(String regionName, Properties properties) throws CacheException
+   {
+      try
+      {
+         String objectNameAsString = properties.getProperty("hibernate.cache.object_name");
+         log.debug("Uses tree cache provider with object name " + objectNameAsString);
+
+         //
+         ObjectName providerName = ObjectName.getInstance(objectNameAsString);
+
+         //
+         MBeanServer server = MBeanServerLocator.locateJBoss();
+         TreeCacheProvider provider = (TreeCacheProvider)MBeanProxy.get(TreeCacheProvider.class, providerName, server);
+         org.jboss.cache.TreeCache cache = provider.getTreeCache();
+         
+         //Select the proper type of hibernate cache to be used
+         Cache hibernateCache = null;
+         if(cache.getNodeLockingScheme().equalsIgnoreCase("OPTIMISTIC"))
+         {
+            log.debug("Selecting Optimistic Cache");
+            hibernateCache = new OptimisticTreeCache(cache, regionName);
+         }
+         else
+         {            
+            log.debug("Selecting regular Tree Cache");
+            hibernateCache = new TreeCache(cache, regionName, cache.getTransactionManager());
+         }
+         
+         return hibernateCache;
+      }
+      catch (Exception e)
+      {
+         throw new CacheException(e);
+      }
+   }
+
+   public long nextTimestamp()
+   {
+      return System.currentTimeMillis() / 100;
+   }
+
+   public void start(Properties properties) throws CacheException
+   {
+   }
+
+   public void stop()
+   {
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/TreeCacheProvider.java
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/TreeCacheProvider.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/TreeCacheProvider.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util.cache;
+
+import org.jboss.cache.TreeCache;
+
+/**
+ * Provide a tree cache. <code>org.jboss.cache.TreeCache</code> is a concrete class and cannot be proxy injected. This
+ * interface enable injection and gives a way to the dependant to retrieve the cache.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
+ * @version $Revision: 8784 $
+ */
+public interface TreeCacheProvider
+{
+   TreeCache getTreeCache();
+}


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/TreeCacheProvider.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+<!-- generic TreeCache to let a portable clustering to forums -->
+<mbean code="org.jboss.cache.TreeCache"
+   	name="forums:service=TreeCache,type=hibernate">
+   	<depends>jboss:service=Naming</depends>
+   	<depends>jboss:service=TransactionManager</depends>
+
+   	<attribute name="TransactionManagerLookupClass">
+   		org.jboss.cache.JBossTransactionManagerLookup
+   	</attribute>
+
+   	<attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
+   	<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+   	<attribute name="CacheMode">REPL_SYNC</attribute>
+
+   	<attribute name="ClusterName">
+   		ForumsPartition
+   	</attribute>
+
+   	<attribute name="InitialStateRetrievalTimeout">17500</attribute>
+
+   	<attribute name="SyncReplTimeout">17500</attribute>
+
+   	<attribute name="LockAcquisitionTimeout">15000</attribute>
+
+
+   	<attribute name="EvictionPolicyClass">
+   		org.jboss.cache.eviction.LRUPolicy
+   	</attribute>
+   	<attribute name="EvictionPolicyConfig">
+   		<config>
+   			<attribute name="wakeUpIntervalSeconds">5</attribute>
+
+   			<region name="/_default_">
+   				<attribute name="maxNodes">5000</attribute>
+   				<attribute name="timeToLiveSeconds">1000</attribute>
+   			</region>
+   		</config>
+   	</attribute>
+
+   	<attribute name="ClusterConfig">
+   		<config>
+   			<UDP
+   				mcast_addr="${jboss.partition.udpGroup:239.11.12.13}"
+   				mcast_port="${portal.hibernate.cache.udpPort:23457}" tos="8"
+   				ucast_recv_buf_size="20000000" ucast_send_buf_size="640000"
+   				mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+   				loopback="false" discard_incompatible_packets="true"
+   				enable_bundling="false" max_bundle_size="64000"
+   				max_bundle_timeout="30" use_incoming_packet_handler="true"
+   				use_outgoing_packet_handler="false"
+   				ip_ttl="${jgroups.udp.ip_ttl:2}" down_thread="false"
+   				up_thread="false" />
+   			<PING timeout="2000" down_thread="false"
+   				up_thread="false" num_initial_members="3" />
+   			<MERGE2 max_interval="100000" down_thread="false"
+   				up_thread="false" min_interval="20000" />
+   			<FD_SOCK down_thread="false" up_thread="false" />
+   			<FD timeout="10000" max_tries="5" down_thread="false"
+   				up_thread="false" shun="true" />
+   			<VERIFY_SUSPECT timeout="1500" down_thread="false"
+   				up_thread="false" />
+   			<pbcast.NAKACK max_xmit_size="60000"
+   				use_mcast_xmit="false" gc_lag="0"
+   				retransmit_timeout="300,600,1200,2400,4800" down_thread="false"
+   				up_thread="false" discard_delivered_msgs="true" />
+   			<UNICAST timeout="300,600,1200,2400,3600"
+   				down_thread="false" up_thread="false" />
+   			<pbcast.STABLE stability_delay="1000"
+   				desired_avg_gossip="50000" down_thread="false" up_thread="false"
+   				max_bytes="400000" />
+   			<pbcast.GMS print_local_addr="true" join_timeout="3000"
+   				down_thread="false" up_thread="false" join_retry_timeout="2000"
+   				shun="true" view_bundling="true" />
+   			<FRAG2 frag_size="60000" down_thread="false"
+   				up_thread="false" />
+   			<pbcast.STATE_TRANSFER down_thread="false"
+   				up_thread="false" use_flush="false" />
+   		</config>
+   	</attribute>
+</mbean>
+
+<!-- service to configure cluster of forums through JMX -->
+<mbean code="org.jboss.portlet.forums.util.cache.JBossTreeCacheProvider"
+   	name="forums:service=TreeCacheProvider,type=hibernate">
+   	<depends optional-attribute-name="CacheName">
+   		forums:service=TreeCache,type=hibernate
+   	</depends>
+</mbean>
+
+</server>


Property changes on: labs/jbossforums/branches/forums120P26/cache-plugin/src/resources/forums-cache-plugin.sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+ at echo off
+rem
+rem  Invokes a script of the same name in the 'tools' module.
+rem  
+rem  The 'tools' module is expected to be a peer directory of the directory
+rem  in which this script lives.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/forums/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+##  Invokes a script of the same name in the 'tools' module.
+##  
+##  The 'tools' module is expected to be a peer directory of the directory
+##  in which this script lives.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:12:37 vietj Exp $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+    if [ "x$TOOLS_ROOT" = "x" ]; then
+	TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+    fi
+
+    MODULE_ROOT=`cd $DIRNAME; pwd`
+    export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+    # Where is the target script?
+    target="$TOOLS_ROOT/bin/$PROGNAME"
+    if [ ! -f "$target" ]; then
+	echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+        echo "${PROGNAME}:"
+        echo "${PROGNAME}:    $target"
+        echo "${PROGNAME}:"
+	echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+	echo "${PROGNAME}: and make sure it is up to date."
+        exit 2
+    fi
+
+    # Get busy yo!
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: Executing: /bin/sh $target $@"
+    fi
+    if [ "x$TRACE" = "x" ]; then
+	exec /bin/sh $target "$@"
+    else
+	exec /bin/sh -x $target "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"


Property changes on: labs/jbossforums/branches/forums120P26/forums/build.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/build.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/build.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/build.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,493 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+   <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+   <!ENTITY tools      SYSTEM "../tools/etc/buildfragments/tools.ent">
+   <!ENTITY libraries  SYSTEM "../tools/etc/buildfragments/libraries.ent">
+   <!ENTITY modules    SYSTEM "../tools/etc/buildfragments/modules.ent">
+   <!ENTITY defaults   SYSTEM "../tools/etc/buildfragments/defaults.ent">
+   <!ENTITY targets    SYSTEM "../tools/etc/buildfragments/targets.ent">
+   ]>
+
+<!-- $Id: build.xml,v 1.13 2005/11/05 15:02:50 bdaw Exp $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File                      |-->
+<!--|                                                                      |-->
+<!--| Distributable under LGPL license.                                    |-->
+<!--| See terms of license at http://www.gnu.org.                          |-->
+<!--|                                                                      |-->
+<!--| This file has been designed to work with the 'tools' module and      |-->
+<!--| Buildmagic extentions.                                               |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal Forums">
+
+	<!--+====================================================================+-->
+   <!--| Setup                                                              |-->
+   <!--|                                                                    |-->
+   <!--| Include the common build elements.                                 |-->
+   <!--|                                                                    |-->
+   <!--| This defines several different targets, properties and paths.      |-->
+   <!--| It also sets up the basic extention tasks amoung other things.     |-->
+   <!--+====================================================================+-->
+
+   &buildmagic;
+   &libraries;
+   &modules;
+   &defaults;
+   &tools;
+   &targets;
+
+   <!-- ================================================================== -->
+   <!-- Initialization                                                     -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Initialize the build system.  Must depend on '_buildmagic:init'.
+     | Other targets should depend on 'init' or things will mysteriously fail.
+   -->
+
+   <target name="init" unless="init.disable" depends="_buildmagic:init">
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Configuration                                                      |-->
+   <!--|                                                                    |-->
+   <!--| This target is invoked by the Buildmagic initialization logic      |-->
+   <!--| and should contain module specific configuration elements.         |-->
+   <!--+====================================================================+-->
+
+   <target name="configure" unless="configure.disable">
+
+		<!-- Configure some properties -->
+      <property name="jndi-root" value="portal"/>
+
+      <!-- Configure thirdparty libraries -->
+      <call target="configure-libraries"/>
+		<path id="library.classpath">
+			<path refid="oswego.concurrent.classpath"/>
+			<path refid="jboss.cache.classpath"/>
+			<path refid="jgroups.classpath"/>
+			<path refid="jboss.system.classpath"/>
+			<path refid="jboss.j2ee.classpath"/>
+			<path refid="jboss.server.classpath"/>
+			<path refid="jakarta.log4j.classpath"/>
+			<path refid="junit.junit.classpath"/>
+			<path refid="sun.servlet.classpath"/>
+			<path refid="jakarta.cactus.classpath"/>
+			<!--path refid="jakarta.lucene.classpath"/-->
+         	<path refid="jakarta.fileupload.classpath"/>
+         	<path refid="jwebunit.jwebunit.classpath"/>
+			<path refid="dbunit.dbunit.classpath"/>
+			<path refid="apache.myfaces.classpath"/>
+			<path refid="jboss.hibernate.classpath"/>
+			<path refid="jbportal.classpath"/>			
+	        <path refid="facelets.classpath"/>		
+		<path refid="rome.classpath"/>
+			<path refid="jflex.jflex.classpath" />
+			<path refid="jboss.javassist.classpath" />
+			<path refid="dom4j.dom4j.classpath" />
+			<path refid="jboss.hibernate.search.classpath"/>
+		</path>
+
+      <!-- Configure modules -->
+      <call target="configure-modules"/>
+	
+	    <!-- removing all src level dependency on portal....helps with building
+	    the forum application that upgrades easier across portal releases -->
+		<path id="dependentmodule.classpath">
+			<!--path refid="jboss.portal-core.classpath"/>
+			<path refid="jboss.portal-format.classpath"/>
+			<path refid="jboss.portal-common.classpath"/>
+			<path refid="jboss.portal-portlet.classpath"/>
+			<path refid="jboss.portal-server.classpath"/>
+			<path refid="jboss.portlet-api.classpath"/>
+			<path refid="jboss.hibernate.classpath"/-->
+		</path>
+
+      <!--+=======================================+-->
+      <!--| Override any default properties here. |-->
+      <!--+=======================================+-->
+
+      <!-- Configure defaults & build tools -->
+      <call target="configure-defaults"/>
+		<call target="configure-tools"/>
+
+      <!--+=======================================+-->
+      <!--| Define module specific elements here. |-->
+      <!--+=======================================+-->
+      <property name="javadoc.private" value="true"/>
+		<property name="javadoc.protected" value="false"/>
+
+	</target>
+
+   <target name="configure-jflex">
+           <taskdef name="jflex"
+                    classname="JFlex.anttask.JFlexTask"
+                    classpathref="jflex.jflex.classpath"/>
+   </target>
+
+
+   <target name="generate-parsers" depends="init">
+     <mkdir dir="${build.gen.classes}/org/jboss/portlet/forums/format/template"/>
+      <javacc
+         buildparser="true"
+         buildtokenmanager="true"
+         target="${source.java}/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj"
+         outputdirectory="${source.java}/org/jboss/portlet/forums/format/template"
+         javacchome="${sun.javacc.lib}"/>
+      <jflex
+         file="${source.java}/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex"
+         destdir="${source.java}">
+      </jflex>
+      <jflex
+         file="${source.java}/org/jboss/portlet/forums/format/parser/html/Analyzer.flex"
+         destdir="${source.java}">
+      </jflex>
+   </target>
+
+   <!--+====================================================================+-->
+   <!--| Compile                                                            |-->
+   <!--|                                                                    |-->
+   <!--| This target should depend on other compile-* targets for each      |-->
+   <!--| different type of compile that needs to be performed, short of     |-->
+   <!--| documentation compiles.                                            |-->
+   <!--+====================================================================+-->
+
+   <target name="compile" description="Compile all source files." depends="generate-classes,generate-parsers,
+               _default:compile-classes,
+               _default:compile-etc,
+               _default:compile-resources">
+		<!-- Add module specific elements here. -->
+        <jmxdoclet destDir="${build.classes}">
+			<!--fileset dir="${jboss.portal-common.root}/../src/main">
+				<include name="org/jboss/portal/common/system/AbstractJBossService.java"/>
+			</fileset>
+         	<fileset dir="${jboss.portal-core.root}/../src/main">
+            	<include name="org/jboss/portal/core/modules/AbstractModule.java"/>
+         	</fileset>
+			<fileset dir="portal-core-gen-readonly/main">
+				<include name="org/jboss/portal/common/system/AbstractJBossService.java"/>
+			</fileset>
+	        <fileset dir="portal-core-gen-readonly/main">
+	        	<include name="org/jboss/portal/core/modules/AbstractModule.java"/>
+	        </fileset-->
+			<fileset dir="${source.classes}" includes="**/*.java"/>
+			<jbossxmbean/>
+		</jmxdoclet>
+	</target>
+
+   <!-- Generate all class files -->
+   <target name="generate-classes" depends="init">
+	</target>
+
+   <!-- Remove or change the delimiter in hibernate-export if your database has a different deliniter -->
+   <target name="ddl" depends="output">
+		<taskdef
+         classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
+         name="hibernate-export">
+			<classpath>
+				<path refid="javac.classpath"/>
+				<pathelement location="${build.resources}/test"/>
+				<fileset dir="${jboss.home}/lib" includes="dom4j.jar,commons-logging.jar"/>
+				<fileset dir="${jboss.hibernate.lib}" includes="commons-collections.jar,odmg.jar"/>
+			</classpath>
+		</taskdef>
+		<mkdir dir="${build.resources}/setup/"/>
+		<hibernate-export properties="${hibernate.properties}" text="true" quiet="true" delimiter=";"
+                        output="${build.resources}/setup/setup.ddl">
+			<fileset dir="${build.resources}/portal-forums-sar" includes="**/*.hbm.xml"/>
+	      	<!-- Luca Stancapiano - 8 feb 2008 - added new two modules for cluster -->
+			<fileset dir="${build.resources}/portal-forums-ha-sar" includes="**/*.hbm.xml"/>
+			<fileset dir="${build.resources}/portal-forums-ha-jbp-sar" includes="**/*.hbm.xml"/>
+		</hibernate-export>
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Generate Output                                                    |-->
+   <!--|                                                                    |-->
+   <!--| Generates the target output for this module. Target output is      |-->
+   <!--| the output which is ment to be released or used by external        |-->
+   <!--| modules.                                                           |-->
+   <!--+====================================================================+-->
+
+   <target name="output" description="Generate all target output." depends="compile">
+
+		<mkdir dir="${build.lib}"/>
+
+      <!-- portal-forums-ui.jar -->
+      <jar jarfile="${build.lib}/portal-forums-ui.jar">
+	      <fileset dir="${build.classes}" includes="org/jboss/portlet/forums/auth/*"/>
+      </jar>
+
+      <jar jarfile="${build.lib}/portal-forums-uif.jar">
+	      <fileset dir="${build.classes}" excludes="org/jboss/portlet/forums/auth/*"/>
+      </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>
+
+      <!-- portal-forums.sar -->
+      <jar jarfile="${build.lib}/portal-forums.sar">
+		 <fileset dir="${build.resources}/portal-forums-sar" includes="**/*"/>
+         <fileset dir="${jakarta.fileupload.root}/lib" includes="commons-fileupload.jar"/>
+      	 <fileset dir="${rome.lib}" includes="rome-0.9.jar" />
+      	 <fileset dir="${jdom.lib}" includes="jdom.jar" />
+      </jar>
+
+      <!-- portal-forums.ear -->
+      <copy todir="${build.resources}/portal-forums-ear">
+			<!--fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/-->
+            <fileset dir="${jboss.hibernate.search.root}/lib" includes="lucene-core.jar,hibernate-search.jar"/>
+      	    <fileset dir="${jboss.hibernate.lib}" includes="hibernate-commons-annotations.jar,ejb3-persistence.jar"/>
+			<fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums.sar,portal-forums-authz-plugin.sar"/>
+			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,el-api.jar,el-ri.jar,jsf-example.jar"/>
+			<fileset dir="${apache.myfaces.lib}" includes="myfaces-api.jar,myfaces-impl.jar,tomahawk.jar"/>
+			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.6.jar,commons-el.jar"/>
+			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
+			<fileset dir="${jbportal.lib}" includes="portal-faces-lib.jar" />
+	  </copy>
+	  <jar jarfile="${build.lib}/jboss-forums.ear">
+			<fileset dir="${build.resources}/portal-forums-ear" includes="**/*"/>
+	  </jar>
+
+	  <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha.sar -->
+	  <jar jarfile="${build.lib}/portal-forums-ha.sar">
+			<fileset dir="${build.resources}/portal-forums-ha-sar" includes="**/*"/>
+	        <fileset dir="${jakarta.fileupload.root}/lib" includes="commons-fileupload.jar"/>
+	      	<fileset dir="${rome.lib}" includes="rome-0.9.jar" />
+	      	<fileset dir="${jdom.lib}" includes="jdom.jar" />
+	  </jar>
+
+	  <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha-jbp.sar -->
+	  <jar jarfile="${build.lib}/portal-forums-ha-jbp.sar">
+			<fileset dir="${build.resources}/portal-forums-ha-jbp-sar" includes="**/*"/>
+	        <fileset dir="${jakarta.fileupload.root}/lib" includes="commons-fileupload.jar"/>
+	      	<fileset dir="${rome.lib}" includes="rome-0.9.jar" />
+	      	<fileset dir="${jdom.lib}" includes="jdom.jar" />
+	  </jar>
+
+	  <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha.ear -->
+	  <copy todir="${build.resources}/portal-forums-ha-ear">
+			<!--fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/-->
+			<fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha.sar,portal-forums-authz-plugin.sar"/>
+			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,el-api.jar,el-ri.jar,jsf-example.jar"/>
+			<fileset dir="${apache.myfaces.lib}" includes="myfaces-api.jar,myfaces-impl.jar,tomahawk.jar"/>
+			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.6.jar,commons-el.jar"/>
+			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
+			<fileset dir="${jbportal.lib}" includes="portal-faces-lib.jar" />
+	  </copy>
+	  <jar jarfile="${build.lib}/jboss-forums-ha.ear">
+			<fileset dir="${build.resources}/portal-forums-ha-ear" includes="**/*"/>
+	  </jar>
+
+	  <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha-jbp.ear -->
+	  <copy todir="${build.resources}/portal-forums-ha-jbp-ear">
+			<!--fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/-->
+			<fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha-jbp.sar,portal-forums-authz-plugin.sar"/>
+			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,el-api.jar,el-ri.jar,jsf-example.jar"/>
+			<fileset dir="${apache.myfaces.lib}" includes="myfaces-api.jar,myfaces-impl.jar,tomahawk.jar"/>
+			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.6.jar,commons-el.jar"/>
+			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
+			<fileset dir="${jbportal.lib}" includes="portal-faces-lib.jar" />
+	  </copy>
+	  <jar jarfile="${build.lib}/jboss-forums-ha-jbp.ear">
+			<fileset dir="${build.resources}/portal-forums-ha-jbp-ear" includes="**/*"/>
+	  </jar>
+	</target>
+
+	<target name="explode" depends="init">
+		<explode file="${build.lib}/jboss-forums.ear" todir="${build.resources}" />
+		<!-- Luca Stancapiano - 8 feb 2008 - exploded ha modules -->
+		<explode file="${build.lib}/jboss-forums-ha.ear" todir="${build.resources}" />
+		<explode file="${build.lib}/jboss-forums-ha-jbp.ear" todir="${build.resources}" />
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Cleaning                                                           -->
+   <!-- ================================================================== -->
+
+   <!-- Clean up all build output -->
+   <target name="clean" depends="_default:clean">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!--+====================================================================+-->
+   <!--| Documents                                                          |-->
+   <!--|                                                                    |-->
+   <!--| Generate all documentation for this module.                        |-->
+   <!--+====================================================================+-->
+
+   <target name="docs" depends="_default:docs">
+		<!-- Add module specific elements here. -->
+	</target>
+
+   <!-- ================================================================== -->
+   <!-- Misc.                                                              -->
+   <!-- ================================================================== -->
+
+   <target name="main" depends="most"/>
+	<target name="all" depends="_default:all"/>
+	<target name="most" depends="_default:most"/>
+	<target name="help" depends="_default:help"/>
+
+   <!-- ================================================================== -->
+   <!-- Deployment                                                         -->
+   <!-- ================================================================== -->
+
+   <!--
+     | Deploy the application
+   -->
+   <target name="deploy" description="Deploy." depends="output">
+	   
+	   <!-- TEMPORARILY COPIED HERE, NEEDS TO BE REDONE -->
+	   <!-- portal-forums.ear -->
+	   <copy todir="${build.resources}/portal-forums-ear">
+		   <!--fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/-->
+		   <fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums.sar,portal-forums-authz-plugin.sar"/>
+		   <fileset dir="${jbportal.root}/../facelets/lib" includes="jsf-facelets.jar,el-api.jar,el-ri.jar"/>
+	   </copy>
+	   <jar jarfile="${build.lib}/jboss-forums.ear">
+		   <fileset dir="${build.resources}/portal-forums-ear" includes="**/*"/>
+	  </jar>
+	   
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<copy file="${build.lib}/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+	</target>
+
+   <!--
+	 | Deploy the ha application
+   -->
+   <target name="deploy-ha" description="Deploy ha." depends="output">
+		   
+	   <!-- TEMPORARILY COPIED HERE, NEEDS TO BE REDONE -->
+	   <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha.ear -->
+	   <copy todir="${build.resources}/portal-forums-ha-ear">
+		   <fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/>
+		   <fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha.sar,portal-forums-authz-plugin.sar"/>
+		   <fileset dir="${jbportal.root}/../facelets/lib" includes="jsf-facelets.jar,el-api.jar,el-ri.jar"/>
+	   </copy>
+	   <jar jarfile="${build.lib}/jboss-forums-ha.ear">
+		   <fileset dir="${build.resources}/portal-forums-ha-ear" includes="**/*"/>
+	   </jar>
+		   
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<copy file="${build.lib}/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+	</target>
+
+   <!--
+	 | Deploy the ha-jbp application
+   -->
+   <target name="deploy-ha-jbp" description="Deploy ha jbp." depends="output">
+		   
+	   <!-- TEMPORARILY COPIED HERE, NEEDS TO BE REDONE -->
+	   <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha.ear -->
+	   <copy todir="${build.resources}/portal-forums-ha-jbp-ear">
+		   <fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/>
+		   <fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha-jbp.sar,portal-forums-authz-plugin.sar"/>
+		   <fileset dir="${jbportal.root}/../facelets/lib" includes="jsf-facelets.jar,el-api.jar,el-ri.jar"/>
+	   </copy>
+	   <jar jarfile="${build.lib}/jboss-forums-ha-jbp.ear">
+		   <fileset dir="${build.resources}/portal-forums-ha-jbp-ear" includes="**/*"/>
+	   </jar>
+		   
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<copy file="${build.lib}/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+	</target>
+
+   <!--
+     | Undeploy the application
+   -->
+   <target name="undeploy" description="Undeploy." depends="init">
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<delete file="${jboss.home}/server/${portal.deploy.dir}/deploy/portal-forums.ear"/>		
+	</target>
+
+   <!--
+	 | Luca Stancapiano - 8 feb 2008 - Undeploy the ha application
+   -->
+	<target name="undeploy-ha" description="Undeploy ha." depends="init">
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<delete file="${jboss.home}/server/${portal.deploy.dir}/deploy/portal-forums-ha.ear"/>		
+	 </target>
+
+   <!--
+	 | Luca Stancapiano - 8 feb 2008 - Undeploy the ha-jbp application
+   -->
+	<target name="undeploy-ha-jbp" description="Undeploy ha jbp." depends="init">
+		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+		<delete file="${jboss.home}/server/${portal.deploy.dir}/deploy/portal-forums-ha-jbp.ear"/>		
+	 </target>
+
+	<target name="test" depends="init">
+
+		<property name="build.testlog" value="${module.output}/log"/>
+
+		<echo>
+			<![CDATA[
+	      ${build.reports}
+	      ${build.testlog}
+	      ${module.output}
+	      ${junit.printsummary}
+	      ${junit.batchtest.haltonerror}
+	      ${junit.batchtest.haltonfailure}
+	      ${junit.batchtest.fork}
+	      ${junit.timeout}
+	      ${junit.jvm}
+	      ]]>
+		</echo>
+
+		<mkdir dir="${build.reports}"/>
+		<mkdir dir="${build.testlog}"/>
+
+		<junit dir="${module.output}" printsummary="${junit.printsummary}" haltonerror="${junit.haltonerror}"
+             haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" timeout="${junit.timeout}" jvm="${junit.jvm}">
+			<formatter type="plain" usefile="false"/>
+			<formatter type="xml" usefile="true"/>
+			<sysproperty key="build.testlog" value="${build.testlog}"/>
+			<sysproperty key="build.resources" value="${build.resources}"/>
+         <!--<test name="org.jboss.portlet.test.forums.AnonymousUserTestCase" />
+       <test name="org.jboss.portlet.test.forums.UserTestCase" />
+       <test name="org.jboss.portlet.test.forums.AdminTestCase" />-->
+         <!--<test name="org.jboss.portlet.test.forums.AdminFullTestCase" />-->
+         <test name="org.jboss.portlet.test.forums.AdminPostTestCase"/>
+         <test name="org.jboss.portlet.test.forums.AdminEditTopicTypeTestCase"/>
+         <test name="org.jboss.portlet.test.forums.AdminPollPostEditTestCase"/>
+         <test name="org.jboss.portlet.test.forums.TopicModelTestCase"/>
+         <test name="org.jboss.portlet.test.forums.ForumModelTestCase"/>
+         <test name="org.jboss.portlet.test.forums.CategoryModelTestCase"/>
+         <test name="org.jboss.portlet.test.forums.PostModelTestCase"/>
+         <classpath>
+				<pathelement location="${build.classes}"/>
+            <!--<pathelement location="${build.resources}/portal-core-sar" />-->
+         	<!-- Luca Stancapiano - 8 feb 2008 - new ha modules into classpath -->
+            <pathelement location="${build.resources}/portal-forums-sar"/>
+         	<pathelement location="${build.resources}/portal-forums-ha-sar"/>
+         	<pathelement location="${build.resources}/portal-forums-ha-jbp-sar"/>
+         	<!-- Luca Stancapiano - 8 feb 2008 - end patch -->
+                <pathelement location="${build.resources}/test"/>
+                <pathelement location="${jboss.home}/lib/dom4j.jar"/>
+				<pathelement location="${jboss.config}/lib/hsqldb.jar"/>
+				<pathelement location="${jboss.config}/lib/jgroups.jar"/>
+				<pathelement location="${jboss.config}/lib/cglib-full-2.0.1.jar"/>
+				<path refid="jboss.hibernate.classpath"/>
+				<path refid="library.classpath"/>
+				<path refid="dependentmodule.classpath"/>
+				<pathelement location="${jwebunit.jwebunit.lib}/nekohtml.jar"/>
+				<pathelement location="${dbunit.dbunit.lib}/dbunit.jar"/>
+				<pathelement location="${jdbc.connectors.lib}/mysql-connector-java.jar"/>
+                <pathelement location="${jboss.home}/server/default/deploy/jboss-hibernate.deployer/asm.jar"/>
+         	    <!-- Luca Stancapiano - 8 feb 2008 - no more hibernate.jar -->
+                <pathelement location="${jboss.home}/server/default/deploy/jboss-hibernate.deployer/hibernate3.jar"/>
+                <pathelement location="${jboss.home}/server/default/deploy/jboss-hibernate.deployer/cglib-2.1.jar"/>
+                <pathelement location="${jboss.home}/server/default/deploy/jboss-hibernate.deployer/antlr-2.7.5H3.jar"/>
+            <!--<path refid="jboss.hibernate.classpath"/>-->
+            <path refid="library.classpath"/>
+            </classpath>
+		</junit>
+
+	</target>
+</project>

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_disa.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_disa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_norm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowdown_norm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_disa.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_disa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_norm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminarrowup_norm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_disa.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_disa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_norm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_admindelete_norm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminlock.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminmove.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminmove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminsplit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminsplit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminunlock.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_adminunlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno_new.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_error.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_error.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_question.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_question.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_warning.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_dialog_warning.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_locked.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_locked.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_open.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_open.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_pop.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_new_pop.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_locked.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_locked.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_open.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_open.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_pop.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_nonew_pop.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky_new.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_bar.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_bar.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_lcap.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_lcap.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_rcap.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_poll_rcap.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_feed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_feed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_logo.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/common/forums_ico_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewcategory.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewforum.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_addnewforum.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_aim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_aim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_closed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_closed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_delete.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_edit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_email.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_icq.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_icq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_moderate.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_moderate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_msnm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_msnm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_newtopic.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_newtopic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_postreply.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_postreply.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_profile.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_profile.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_quote.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_quote.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_skype.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_skype.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_subscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_subscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_unsubscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_unsubscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_website.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_website.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_yim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/de/forum_but_yim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewcategory.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewforum.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_addnewforum.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_aim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_aim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_closed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_closed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_delete.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_edit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_email.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_icq.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_icq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_moderate.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_moderate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_msnm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_msnm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_newtopic.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_newtopic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_postreply.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_postreply.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_profile.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_profile.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_quote.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_quote.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_skype.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_skype.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_subscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_subscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_unsubscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_unsubscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_website.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_website.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_yim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/en/forum_but_yim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,874 @@
+.bodyStyle{
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 11px;
+    color: #656565;
+}
+
+.scroll {
+	width: 800px;
+	overflow: auto;
+}
+
+.code {
+    border-left: 1px solid #e6e7e8;
+    border-right: 1px solid #e6e7e8;
+    font-family: Courier;
+    font-size: 10px;
+    background-color: #fffdf2;
+    white-space: nowrap;
+}
+
+.quote {
+    border-left: 1px solid #e6e7e8;
+    border-right: 1px solid #e6e7e8;
+    font-size: 10px;
+    background-color: #f5f7fa;
+}
+
+.forumscontainer {
+	margin:0px 25px 0px 15px;
+	font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+	font-size:11px;
+}
+
+.forumscontainer a {
+	text-decoration: underline;
+	}
+
+.forumsectionhdr {
+	border-bottom: 1px solid #a1a1a1;
+	text-align:right;
+}
+
+.forumsectionhdr ul {
+	margin-bottom: 4px;
+}
+
+.forumsectionhdr li {
+	display:inline;
+	color: #656565;
+	font-size:11px;
+	font-weight:bold;
+}
+
+.forumsectionhdr a {
+	color:#4a5d75;
+}
+
+.forumdashedHR {
+	clear:both;
+	border-top:1px dashed #a1a1a1; 
+	background-color: #FFFFFF;
+	border-bottom:0px;
+	border-left:0px;
+	border-right:0px;
+	margin:10px auto;
+}
+
+
+/* Link workaround for images used as links where spaces may be added */
+.imglink { 
+	text-decoration: none;
+}
+	
+
+/* -------------------------- floats ------------------------------------------- */
+.forumfloatright {
+	float:right;
+}
+
+.forumfloatleft {
+	float:left;
+}
+
+/* -------------------------- titles, headers & text ------------------------------- */
+.forumtitletext {
+}
+
+.forumtitletext h4{
+	margin: 5px auto;
+	color:#233345;
+	font-size:14px;
+	font-weight:bold;	
+}
+.forumtitletext .successtext {
+	margin: 5px auto;
+	color:#226809;
+	font-size:12px;
+	font-weight:bold;	
+}
+.forumtitletext .failuretext {
+	margin: 5px auto;
+	color:#CC0000;
+	font-size:12px;
+	font-weight:bold;	
+}
+.forumtitletext p {
+	margin: 2px auto 12px auto;
+}
+
+.inlinefailure {
+	margin: 5px auto;
+	color:#CC0000;
+	font-size:12px;
+	font-weight: bold;	
+}	
+
+.note {
+	color:#233345;
+	font-size:9px;
+	line-height: 9px;
+}
+/* --------------------------- Buttons ---------------------------------- */
+
+.buttonMed {
+	font-size: 10px;
+	font-weight: bold;
+	color: #FFFFFF;
+	background-color: #4a5d75;
+	border-top: 1px solid #94aebd;
+	border-left: 1px solid #94aebd;
+	border-right: 1px solid #233345;
+	border-bottom: 1px solid #233345;
+	height: 20px;
+}
+
+.actionbuttons {
+	padding: 5px 0px;
+}
+
+.actionbuttons ul {
+	padding: 0px;
+	margin: 0px;
+	display: inline;
+	} 
+
+.actionbuttons ul li {
+	list-style: none;
+	display: inline;
+	padding: 0px;
+	margin: 0px;
+	}
+
+.actionbuttons ul li img {
+	border: 0px;
+	padding-right: 4px;
+	vertical-align: text-bottom;
+	}
+
+.actionbuttons ul li a {
+	text-decoration:none;
+	}
+
+
+/* -------------------------- Forum Breadcrumb navigation --------------------------------- */
+.forumbread {
+	color: #4a5d75;
+	padding-right: 3px;
+	margin: 10px auto;
+	}
+
+.forumbread ul {
+	margin-left: 0px;
+	padding-left: 0px;
+	display: inline;
+	border: none;
+	} 
+
+.forumbread ul li {
+	margin-left: 3px;
+	font-size:10px;
+	border: none;
+	list-style: none;
+	display: inline;
+	}
+
+.forumbread ul li .first {
+	margin-left:0px;
+	font-size:10px;
+	border: none;
+	list-style: none;
+	display: inline;
+	}
+
+.forumbread a {
+	color:#4a5d75;
+	text-decoration: underline;
+}
+
+/* --------------------  Forum Table styles ------------------------ */
+.forumtablestyle {
+	clear:both;
+}
+
+.forumtablestyle td {
+	border-bottom:1px solid #e6e7e8;
+	padding: 3px 5px;
+	font-size:11px;
+}
+
+.forumtablestyle a {
+	color:#4a5d75;
+}
+
+.forumtablestyle h3 {
+	margin:0px;
+	padding:0px;
+	font-weight: bold;
+	font-size:11px;
+	display:inline;
+}
+
+.forumtablestyle .header {
+	background-color:#233345;
+	font-size:10px;
+	font-weight:bold;
+	color:#94aebd;
+	height: 20px;
+	text-align:left;
+}
+
+.forumtablestyle .secondaryHeader {
+	background-color:#9bb3c1;
+	font-size:10px;
+	font-weight:bold;
+	color:#000000;
+	height: 20px;
+	text-align:left;
+}
+
+.forumtablestyle .forumheaderfirst {
+	border-bottom:1px solid #233345;
+	height:2em;
+
+}
+
+.forumtablestyle .tableheader {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+	height:2em;
+}
+
+.forumtablestyle .forumheadercentered {
+	text-align:center;
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+	width:50px;
+}
+.forumtablestyle .forumheaderopen {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+}
+.forumtablestyle .forumheader250px {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+	width:250px;
+
+}
+
+.forumtablestyle .forumheaderlast {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+	width:250px;
+}
+.forumtablestyle .forumheadernarrow {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #233345;
+	width:30px;
+}
+
+.forumtablestyle .forumlisticon {
+	width:10px;
+	height:40px;
+}
+
+.forumtablestyle .forumlistcentered {
+	width:50px;
+	text-align: center;
+	border-left:1px solid #e6e7e8;
+	height:40px;
+}
+
+.forumtablestyle .forumlistlast {
+	width:250px;
+	border-left:1px solid #e6e7e8;
+	height:40px;
+}
+
+.forumtablestyle .forumlistopen {
+	border-left:1px solid #e6e7e8;
+	height:40px;
+}
+
+.forumtablestyle .forumcategory {
+	background-color:#f4f3f3;
+	border-bottom:1px solid #e6e7e8;
+	height:25px;
+}
+.forumtablestyle .forumspecialized {
+	background-color:#dedede;
+	border-bottom:1px solid #e6e7e8;
+	height:25px;
+}
+.forumtablestyle .forumcategory h3 {
+	font-weight: bold;
+	font-size:11px;
+}
+
+.forumtablestyle .footerrow {
+	background-color:#e6e7e8;
+}
+.forumtablestyle .spacerRow {
+	background-color:#ffffff;
+	height:15px;
+}
+
+.forumtablestyle .oddRow{
+    background-color: #f4f3f3;
+}
+
+.forumtablestyle .evenRow{
+    background-color: #ffffff;
+}
+
+.forumtablestyle .Indent{
+    padding-left:20px;
+}
+
+.forumtablestyle .rowlinefirst {
+	border-bottom:1px solid #e6e7e8;
+}
+
+.forumtablestyle .rowline {
+	border-left:1px solid #e6e7e8;
+	border-bottom:1px solid #e6e7e8;
+}
+.forumtablestyle .editRow{
+	background-color:#fff6e4;
+}
+
+.forumtablestyle .nonewpostRow {
+	background-color: #f4f3f3;
+	font-weight:bold;
+}
+
+.forumtablestyle .labelCell {
+    background-color: #f4f3f3;
+    width: 0%;
+    white-space: nowrap;
+	font-size:10px;
+	font-weight:bold;
+}
+
+.forumtablestyle .valueCell {
+}
+
+.forumtablestyle .bottomline {
+	border-bottom:1px solid #656565;
+}
+.forumsubtablestyle {
+	clear:both;
+}
+
+.forumsubtablestyle td {
+	border-bottom:0px;
+	padding: 0px 0px;
+}
+.forumthreaduserinfo {
+	border-left:1px solid #e6e7e8;
+}
+
+.forumthreaduserinfo ul {
+	padding-left: 4px;
+	margin-left: 0px;
+	display: inline;
+} 
+
+.forumthreaduserinfo ul li {
+	list-style: none;
+	display: inline;
+}
+
+.forumthreaduserinfo ul li img {
+	border: 0px;
+	padding-right: 1px;
+	vertical-align: text-bottom;
+}
+.forumthreaduserinfo ul li a {
+	text-decoration:none;
+}
+
+.forumthreadfooter {
+	background-color: #9da7b2;
+	height: 0px;
+}
+
+.forumpostspacer {
+	border-left:1px solid #e6e7e8;
+	height: 30px;
+}
+
+.forumpostcontent {
+	border-left:1px solid #e6e7e8;
+}
+.forumpostleftcolumn {
+	white-space:nowrap;
+	width:80px;
+}
+
+.forumpostinfo {
+	padding-top: 2px;
+}
+
+.forumpostinfo ul {
+	padding-left: 0px;
+	margin-left: 0px;
+	display: inline;
+} 
+
+.forumpostinfo ul li {
+	list-style: none;
+	display: inline;
+	padding-right: 20px
+}
+.forumpostactions {
+	float:right;
+}
+
+.forumpostactions ul {
+	padding-left: 4px;
+	margin-left: 0px;
+	display: inline;
+} 
+
+.forumpostactions ul li {
+	list-style: none;
+	display: inline;
+}
+
+.forumpostactions ul li img {
+	border: 0px;
+	padding-right: 1px;
+	vertical-align: text-bottom;
+}
+
+/* --------------------  Forum Topic Attachment styles ------------------------ */
+
+.forumAttachmentTable {
+	clear:both;
+	width: 100%;
+	border: 1px solid #e6e7e8;
+	border-bottom: 0px;
+	margin: 4px;
+}
+
+.forumAttachmentTable .header {
+	background-color:#9bb3c1;
+	font-size:10px;
+	font-weight:bold;
+	color:#000000;
+	text-align:left;
+}
+
+.forumAttachmentTable .forumHeaderFirst {
+	border-bottom:1px solid #9bb3c1;
+}
+
+.forumAttachmentTable .tableHeader {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #9bb3c1;
+}
+
+.forumAttachmentTable .forumHeaderLast {
+	border-left:1px solid #94aebd;
+	border-bottom:1px solid #9bb3c1;
+}
+
+.forumAttachmentTable .labelCell {
+    background-color: #f4f3f3;
+    width: 0%;
+    white-space: nowrap;
+	font-size:10px;
+	font-weight:bold;
+}
+
+.forumAttachmentTable .valueCell {
+    width: 100%;
+}
+
+.forumAttachmentTable .downloadCell {
+    border-left:1px solid #e6e7e8;
+    padding: 4px;
+    text-align: center;
+    vertical-align: middle;
+}
+
+/* --------------------  Forum Topic Poll styles ------------------------ */
+
+.forumPollTable {
+	clear:both;
+/*	border: 1px solid #e6e7e8; */
+/*	border-bottom: 0px; */
+	margin: 4px;
+}
+
+.forumPollTable .questionCell {
+	background-color:#9bb3c1;
+	width: 100%;
+	font-size:10px;
+	font-weight:bold;
+	color:#000000;
+	text-align:left;
+}
+
+.forumPollTable .radioCell {
+    background-color: #f4f3f3;
+    width: 0%;
+    white-space: nowrap;
+	font-size:10px;
+	font-weight:bold;
+}
+
+.forumPollTable .answerCell {
+/*    background-color: #f4f3f3; */
+    width: 100%;
+    white-space: nowrap;
+}
+
+.forumPollTable .buttonCell {
+	padding-top: 6px;
+	text-align: right;
+	border: 0px;
+}
+
+.forumPollTable .linkCell {
+	padding: 1px;
+	padding-right: 6px;
+	text-align: right;
+	border: 0px;
+}
+
+.forumPollTable td {
+    white-space: nowrap;
+}
+.forumPollTable .totalCell {
+    background-color: #f4f3f3;
+	padding: 1px;
+	padding-right: 12px;
+	text-align: right;
+}
+
+.forumPollTableGraph {
+	padding: 0px;
+	width: 0%;
+}
+
+.forumPollTableGraph td {
+	padding: 0px;
+	width: 0%;
+}
+
+/* -------------------  Forms ------------------------------- */
+
+.forumtablestyle .categorylabel {
+	width: 100px;
+	padding:0px;
+	margin:0px;
+}
+.forumtablestyle label{
+ 	float: left;
+ 	vertical-align: middle;
+}
+
+.forumtablestyle textarea {
+	width: 180px;
+	margin-bottom: 5px;
+	vertical-align:middle;
+}
+
+textarea{
+	width: 250px;
+	height: 150px;
+}
+
+.forumtablestyle br {
+	clear: left;
+}
+#adminbutton {
+	width:90px;
+	margin-left:100px;
+}
+#updateinline {
+	width:90px;
+	margin-left:6px;
+}
+
+
+/* -------------------  Legends ------------------------------- */
+
+.forumlegend {
+	margin-bottom: 10px;
+}
+
+.forumlegend ul {
+	padding-left: 0px;
+	margin-left: 0px;
+	display: inline;
+	text-indent:0px;
+	} 
+
+.forumlegend ul li {
+	font-size:10px;
+	list-style: none;
+	display: inline;
+	}
+
+.forumlegend ul li img {
+	border: 0px;
+	padding-left: 4px;
+	padding-right: 4px;
+	vertical-align: text-bottom;
+	}
+.forumlegendCentered {
+	clear:both;
+	font-size:11px;
+	font-weight:normal;
+	padding-bottom: 15px;
+	text-align:center;
+}
+.forumthreadlegend {
+	float:left;
+ 	margin-right: 30px;
+}
+
+.forumthreadlegend ul {
+	margin-top:0px;
+	padding-left: 0px;
+	margin-left: 0px;
+	display: block;
+	text-indent:none;
+	} 
+
+.forumthreadlegend ul li {
+	list-style: none;
+	display: block;
+	}
+
+.forumthreadlegend ul li img {
+	border: 0px;
+	padding-top: 4px;
+	padding-right: 4px;
+	vertical-align: text-bottom;
+	}
+
+.forumthreadlegendtext {
+	text-align:right;
+	float:right;
+}
+
+.forumlegendjumpboxfloat {
+	float:right;
+	margin-bottom: 10px;
+}
+.forumlegendjumpboxclear {
+	clear:both;
+	float:right;
+	margin-bottom: 10px;
+}
+.forumlegendjumpboxclear select {
+	margin: 0px; 
+}
+
+
+/* ----------------------- forum pagination ------------------------ */
+
+.forumpagination {
+	float:right;
+	font-size: 11px;
+	padding-top: 8px;
+	padding-bottom: 8px;
+}
+
+.forumpagination ul {
+	margin: 0px;
+	padding: 0px;
+}
+
+.forumpagination li {
+	list-style-type: none;
+	display: inline;
+	padding-bottom: 1px;
+}
+
+.forumpagination a, .forumpagination a:visited{
+	padding: 0px 3px;
+	color: #4a5d75;
+}
+
+.forumpagination li.currentpage{
+	padding: 0px 3px;
+	font-weight:bold;
+	color: #4a5d75;
+}
+
+.forumpagination li.disablepage{
+	padding: 0px 3px;
+	color: #8c8f91;
+}
+
+
+/* ----------------------- Admin/Moderation styles ------------------------ */
+
+.admintools {
+	padding-top: 4px;
+}
+
+.admintools ul {
+	padding-left: 0px;
+	margin-left: 0px;
+	display: inline;
+	} 
+
+.admintools ul li {
+	font-size:10px;
+	list-style: none;
+	display: inline;
+	}
+
+.admintools ul li img {
+	border: 0px;
+	padding-left: 2px;
+	vertical-align: text-bottom;
+	}
+	
+.modtools {
+	padding-top: 4px;
+	float:right;
+	text-align:right;
+}
+
+.modtools ul {
+	padding-left: 0px;
+	margin-left: 0px;
+	display: inline;
+	text-indent:0px;
+} 
+
+.modtools ul li {
+	font-size:10px;
+	list-style: none;
+	display: inline;
+}
+
+.modtools ul li img {
+	border: 0px;
+	padding-left: 4px;
+	padding-right: 4px;
+	vertical-align: text-bottom;
+}
+
+/*  -------------------------------------- Forms -------------------------------------- */
+.foruminstantreply {
+	margin-top:10px;
+	width: 550px;
+}
+
+.forumformlabelbold {
+	font-size:11px;
+	font-weight:bold;
+}
+
+.forumformtextfield550px {
+	width:550px;
+}
+.forumformbuttonrow {
+	padding-top: 6px;
+	text-align: right;
+	white-space: nowrap;
+}
+
+.forumformbuttonrow ul {
+	padding-left: 0px;
+	margin-left: 0px;
+	display: inline;
+} 
+
+.forumformbuttonrow ul li {
+	list-style: none;
+	display: inline;
+}
+
+/* --------------------  confirmations -------------------- */
+
+.forumsubscriptionconfirm  {
+	border:1px solid #a1a1a1;
+	padding: 20px 20px 10px 20px;
+	margin: 30px auto 200px auto;
+	width:400px;
+}
+.forumsubscriptionconfirm h3 {
+	font-size: 12px;
+	font-weight:bold;
+	color:#343434;
+	margin: 0px auto 8px auto;
+}
+.forumsubscriptionconfirm p {
+	margin: 3px auto;
+} 
+.forumsubscriptionconfirm h4 {
+	font-weight:normal;
+	font-size: 12px;
+	color:#343434;
+	margin: 0px auto 8px auto;
+}
+
+/* --------------------SPACER -------------*/
+#adminbottommargin {
+	margin-bottom: 10px;
+}	
+
+/* ----------------------- "Post View" styles _____________________________ */
+
+.PostviewStyle {
+	margin-top:10px;
+}
+
+.PostviewStyle .PostViewMainHeader {
+	font-weight:bold;
+	font-size:12px;
+	line-height:1em;
+	background-color:#e6e7e8;
+}
+.PostviewStyle .PostViewMainDescription {
+	line-height:1.5em;
+	background-color:#f4f3f3;
+	border-bottom:1px solid #e6e7e8;
+
+}
+
+.PostviewStyle .PostViewUnderline td {
+	border-bottom:1px solid #e6e7e8;
+}
+.PostviewStyle .PostViewUnderlineBoth td {
+	border-top:1px solid #e6e7e8;
+	border-bottom:1px solid #e6e7e8;
+}
+
+.PostviewStyle .Posttextarea {
+   width: 450px;
+   height: 150px;
+   font-family:Verdana,Arial,Helvetica,Sans-Serif,sans-serif;
+   font-size:10px;
+}
+
+/*  ------------ powered by ---------------- */
+
+.PoweredBy {
+	clear:both;
+	text-align:center;
+}
+
+.PoweredBy img {
+	padding-left: 6px;
+	vertical-align:middle;
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewcategory.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewforum.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_addnewforum.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_aim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_aim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_closed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_closed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_delete.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_edit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_email.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_icq.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_icq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_moderate.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_moderate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_msnm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_msnm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_newtopic.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_newtopic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_postreply.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_postreply.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_profile.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_profile.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_quote.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_quote.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_skype.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_skype.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_subscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_subscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_unsubscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_unsubscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_website.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_website.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_yim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/fr/forum_but_yim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewcategory.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewforum.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_addnewforum.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_aim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_aim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_closed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_closed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_delete.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_edit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_email.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_icq.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_icq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_moderate.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_moderate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_msnm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_msnm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_newtopic.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_newtopic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_postreply.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_postreply.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_profile.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_profile.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_quote.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_quote.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_skype.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_skype.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_subscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_subscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_unsubscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_unsubscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_website.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_website.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_yim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/it/forum_but_yim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewcategory.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewforum.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_addnewforum.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_aim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_aim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_closed.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_closed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_delete.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_edit.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_email.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_icq.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_icq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_moderate.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_moderate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_msnm.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_msnm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_newtopic.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_newtopic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_postreply.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_postreply.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_profile.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_profile.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_quote.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_quote.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_skype.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_skype.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_subscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_subscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_unsubscribe.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_unsubscribe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_website.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_website.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_yim.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/bin/portal-forums-war/default_graphics/pl/forum_but_yim.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/forums/src/etc/portal-forums-war.mf
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/etc/portal-forums-war.mf	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/etc/portal-forums-war.mf	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Created-By: @java.vm.version@ (@java.vm.vendor@)
+Specification-Title: @specification.title@
+Specification-Version: @specification.version@
+Specification-Vendor: @specification.vendor@
+Implementation-Title: @implementation.title@
+Implementation-URL: @implementation.url@
+Implementation-Version: @implementation.version@
+Implementation-Vendor: @implementation.vendor@
+Implementation-Vendor-Id: @implementation.vendor.id@
+Class-Path: ./portal-forums-lib.jar

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsConstants.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsConstants.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsConstants.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,1077 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+import org.jboss.portlet.forums.model.AuthType;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1018 $
+ */
+public interface ForumsConstants //extends Constants
+{
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_SMALL_HEADER = "small_header";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_TOPIC_NOTIFY = "search_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_SEARCH_BODY = "search_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_MESSAGE_BODY = "message_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_INDEX_BODY = "index_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_VIEWFORUM_BODY = "viewforum_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_VIEWTOPIC_BODY = "viewtopic_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_VIEWTOPIC_ATTACH_BODY = "viewtopic_attach_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_VIEWTOPIC_POLL_RESULT = "viewtopic_poll_result";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_VIEWTOPIC_POLL_BALLOT = "viewtopic_poll_ballot";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_JUMP_BOX = "jumpbox";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTING_BODY = "posting_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTING_POLL_BODY = "posting_poll_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTING_ATTACH_BODY = "posting_attach_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADD_ATTACHMENT_BODY = "add_attachment_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTED_ATTACHMENTS_BODY = "posted_attachments_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTING_TOPIC_REVIEW = "posting_topic_review";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_POSTING_PREVIEW = "posting_preview";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_MODCP_BODY = "modcp_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_MODCP_MOVE = "modcp_move";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CONFIRM_BODY = "confirm_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ERROR_BODY = "error_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_SEARCH_RESULTS_POSTS = "search_results_posts";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_SEARCH_RESULTS_TOPICS = "search_results_topics";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_WATCHED_TOPICS_BODY = "watched_topics_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_WATCHED_FORUMS_BODY = "watched_forums_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_AUTH_FORUM_BODY = "admin/auth_forum_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_AUTH_SELECT_BODY = "admin/auth_select_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_FORUM_ADMIN_BODY = "admin/forum_admin_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_FORUM_EDIT_BODY = "admin/forum_edit_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_CATEGORY_EDIT_BODY = "admin/category_edit_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String THEMENAME = "default_graphics";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_FORUM_DELETE_BODY = "admin/forum_delete_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_ADMIN_ATTACH_MANAGE_BODY = "admin/attach_manage_body";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_B_CLOSE = "code/b_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_B_OPEN = "code/b_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_CODE_CLOSE = "code/code_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_CODE_OPEN = "code/code_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_COLOR_CLOSE = "code/color_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_COLOR_OPEN = "code/color_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_EMAIL = "code/email";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_I_CLOSE = "code/i_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_I_OPEN = "code/i_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_IMG = "code/img";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_LISTITEM = "code/listitem";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_OLIST_CLOSE = "code/olist_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_OLIST_OPEN = "code/olist_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_QUOTE_CLOSE = "code/quote_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_QUOTE_OPEN = "code/quote_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_QUOTE_USERNAME_OPEN = "code/quote_username_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_SIZE_CLOSE = "code/size_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_SIZE_OPEN = "code/size_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_U_CLOSE = "code/u_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_U_OPEN = "code/u_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_ULIST_CLOSE = "code/ulist_close";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_ULIST_OPEN = "code/ulist_open";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_CODE_URL = "code/url";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_THEME_BLOCK_TOPICS = "block/topics";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_MAIL_TOPIC_NOTIFY = "topic_notify";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String TPL_MAIL_FORUM_NOTIFY = "forum_notify";
+
+   /**
+    * DOCUMENT_ME
+    */
+   int BLOCK_TOPICS_MODE_LATEST_POSTS = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int BLOCK_TOPICS_MODE_HOT_TOPICS = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int BLOCK_TOPICS_MODE_HOTTEST_TOPICS = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int BLOCK_TOPICS_MODE_MOST_VIEWED = 3;
+
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] SORT_BY_TYPES =
+      {
+         "${bb.Sort_Time}",
+         "${bb.Sort_Post_Subject}",
+         "${bb.Sort_Author}",
+         "${bb.Sort_Forum}"
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   int[] PREVIOUS_DAYS =
+      {
+         0,
+         1,
+         7,
+         14,
+         30,
+         90,
+         180,
+         364
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] PREVIOUS_DAYS_TEXT_TOPICS =
+      {
+         "${bb.All_Topics}",
+         "${bb.1_Day}",
+         "${bb.7_Days}",
+         "${bb.2_Weeks}",
+         "${bb.1_Month}",
+         "${bb.3_Months}",
+         "${bb.6_Months}",
+         "${bb.1_Year}"
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] PREVIOUS_DAYS_TEXT_POSTS =
+      {
+         "${bb.All_Posts}",
+         "${bb.1_Day}",
+         "${bb.7_Days}",
+         "${bb.2_Weeks}",
+         "${bb.1_Month}",
+         "${bb.3_Months}",
+         "${bb.6_Months}",
+         "${bb.1_Year}"
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] FORUM_AUTH_FORM_FIELD_NAMES =
+      {
+         "auth_view",
+         "auth_read",
+         "auth_post",
+         "auth_reply",
+         "auth_edit",
+         "auth_delete",
+         "auth_sticky",
+         "auth_announce",
+         "auth_vote",
+         "auth_pollcreate",
+         "auth_attachment"
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] FORUM_AUTH_FORM_FIELD_LABELS =
+      {
+         "${bb.View}",
+         "${bb.Read}",
+         "${bb.Post}",
+         "${bb.Reply}",
+         "${bb.Edit}",
+         "${bb.Delete}",
+         "${bb.Sticky}",
+         "${bb.Announce}",
+         "${bb.Vote}",
+         "${bb.Pollcreate}",
+         "${bb.UploadedFile}"
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] FORUM_AUTH_LEVEL_LABELS =
+      {
+         "ALL",
+         "REG",
+         "PRIVATE",
+         "MOD",
+         "ADMIN"
+      };
+
+   /*
+      int[] FORUM_AUTH_LEVEL = {
+         Auth.LEVEL_ALL, Auth.LEVEL_REG, Auth.LEVEL_ACL, Auth.LEVEL_MOD, Auth.LEVEL_ADM
+      };
+    */
+
+   /**
+    * DOCUMENT_ME
+    */
+   int GENERAL_MESSAGE = 200;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int GENERAL_ERROR = 202;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int CRITICAL_MESSAGE = 203;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int CRITICAL_ERROR = 204;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int POST_NORMAL = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int POST_STICKY = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int POST_ANNOUNCE = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int POST_GLOBAL_ANNONCE = 3;
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] AUTH_TYPE_TO_MESSAGE =
+      {
+         null,
+         null,
+         "Sorry_auth_read_",
+         "Sorry_auth_post_",
+         "Sorry_auth_reply_",
+         "Sorry_auth_edit_",
+         "Sorry_auth_delete_",
+         "Sorry_auth_announce_",
+         "Sorry_auth_sticky_",
+         null,
+         null,
+         "Sorry_auth_vote_",
+         null,
+      };
+
+   /**
+    * DOCUMENT_ME
+    */
+   int[] TOPIC_TYPE_TO_AUTH_TYPE =
+      {
+         AuthType.POST,
+         AuthType.STICKY,
+         AuthType.ANNOUNCE,
+         AuthType.POST
+      };
+
+   // modes
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_NO_MODE = -1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_VOTE = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_REPLY = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_QUOTE = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_EDIT_POST = 3;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_DELETE = 4;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_POLL_DELETE = 5;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_NEW_TOPIC = 6;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_REPOST = 7;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_SMILIES = 8;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMODE_TOPIC_REVIEW = 9;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_VOTE = 0x0000001;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_REPLY = 0x0000002;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_QUOTE = 0x0000004;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_EDIT_POST = 0x0000008;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_DELETE = 0x0000010;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_POLL_DELETE = 0x0000020;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_NEW_TOPIC = 0x0000040;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_SMILIES = 0x0000080;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int PMASK_TOPIC_REVIEW = 0x0000100;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int[] PMASKS =
+      {
+         PMASK_VOTE,
+         PMASK_REPLY,
+         PMASK_QUOTE,
+         PMASK_EDIT_POST,
+         PMASK_DELETE,
+         PMASK_POLL_DELETE,
+         PMASK_NEW_TOPIC,
+         PMASK_SMILIES,
+         PMASK_TOPIC_REVIEW
+      };
+
+   /*
+      int[] PMODE_TO_AUTH_TYPE = {
+         Auth.TYPE_READ,
+         Auth.TYPE_REPLY,
+         Auth.TYPE_REPLY,
+         Auth.TYPE_EDIT,
+         Auth.TYPE_DELETE,
+         Auth.TYPE_DELETE
+      };
+    */
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_NO_MODE = -1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_DELETE = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_MOVE = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_LOCK = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_UNLOCK = 3;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_SPLIT = 4;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int MMODE_IP = 5;
+
+   /**
+    * DOCUMENT_ME
+    */
+   String[] AUTH_PRESETS_NAMES =
+      {
+         "${bb.Public}",
+         "${bb.Registered}",
+         "${bb.Registered}[${bb.Hidden}]",
+         "${bb.Private}",
+         "${bb.Private}[${bb.Hidden}]",
+         "${bb.Moderators}",
+         "${bb.Moderators}[${bb.Hidden}]"
+      };
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @author $author$
+    * @version $Revision: 1018 $
+    */
+   class ModeDecoder
+   {
+      private static final String[] P_TO_HTML = new String[10];
+
+      static
+      {
+         P_TO_HTML[PMODE_VOTE] = "vote";
+         P_TO_HTML[PMODE_REPLY] = "reply";
+         P_TO_HTML[PMODE_QUOTE] = "reply";
+         P_TO_HTML[PMODE_EDIT_POST] = "editpost";
+         P_TO_HTML[PMODE_DELETE] = "delete";
+         P_TO_HTML[PMODE_POLL_DELETE] = "poll_delete";
+         P_TO_HTML[PMODE_NEW_TOPIC] = "newtopic";
+         P_TO_HTML[PMODE_REPOST] = "repost";
+         P_TO_HTML[PMODE_SMILIES] = "smilies";
+         P_TO_HTML[PMODE_TOPIC_REVIEW] = "topicreview";
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param mode DOCUMENT_ME
+       * @return DOCUMENT_ME
+       */
+      public static final String encodePosting(int mode)
+      {
+         return P_TO_HTML[mode];
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param mode DOCUMENT_ME
+       * @return DOCUMENT_ME
+       */
+      public static final int decodePosting(String mode)
+      {
+         if ("topicreview".equals(mode))
+         {
+            return PMODE_TOPIC_REVIEW;
+         }
+
+         if ("smilies".equals(mode))
+         {
+            return PMODE_SMILIES;
+         }
+
+         if ("reply".equals(mode))
+         {
+            return PMODE_REPLY;
+         }
+
+         if ("quote".equals(mode))
+         {
+            return PMODE_QUOTE;
+         }
+
+         if ("editpost".equals(mode))
+         {
+            return PMODE_EDIT_POST;
+         }
+
+         if ("delete".equals(mode))
+         {
+            return PMODE_DELETE;
+         }
+
+         if ("poll_delete".equals(mode))
+         {
+            return PMODE_POLL_DELETE;
+         }
+
+         if ("vote".equals(mode))
+         {
+            return PMODE_VOTE;
+         }
+
+         if ("newtopic".equals(mode))
+         {
+            return PMODE_NEW_TOPIC;
+         }
+
+         if ("repost".equals(mode))
+         {
+            return PMODE_REPOST;
+         }
+
+         return PMODE_NO_MODE;
+      }
+
+      /*
+         public static final int decodeModcp(Page page)
+         {
+            String mode = page.getParameter("mode");
+            if (mode != null)
+            {
+               if ("delete".equals(mode))
+               {
+                  return MMODE_DELETE;
+               }
+               if ("move".equals(mode))
+               {
+                  return MMODE_MOVE;
+               }
+               if ("lock".equals(mode))
+               {
+                  return MMODE_LOCK;
+               }
+               if ("unlock".equals(mode))
+               {
+                  return MMODE_UNLOCK;
+               }
+               if ("split".equals(mode))
+               {
+                  return MMODE_SPLIT;
+               }
+            }
+            else
+            {
+               if (page.getParameter("delete") != null)
+               {
+                  return MMODE_DELETE;
+               }
+               else if (page.getParameter("move") != null)
+               {
+                  return MMODE_MOVE;
+               }
+               else if (page.getParameter("lock") != null)
+               {
+                  return MMODE_LOCK;
+               }
+               else if (page.getParameter("unlock") != null)
+               {
+                  return MMODE_LOCK;
+               }
+            }
+            return MMODE_NO_MODE;
+         }
+       */
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   int FORUM_UNLOCKED = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int FORUM_LOCKED = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int TOPIC_UNLOCKED = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int TOPIC_LOCKED = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int TOPIC_MOVED = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int TOPIC_WATCH_UN_NOTIFIED = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   int TOPIC_WATCH_NOTIFIED = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_CAT_URL = "c";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_FORUM_URL = "f";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_TOPIC_URL = "t";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_POST_URL = "p";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_USERS_URL = "u";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String POST_ROLES_URL = "g";
+
+   /**
+    * When a notification message is sent, send a link to the message.
+    */
+   int WATCH_MODE_LINKED = 0;
+
+   /**
+    * When a notification message is sent, send the message content.
+    */
+   int WATCH_MODE_EMBEDED = 1;
+   
+   /**
+    * Constant saying that watched don't want to be notified by e-mail.
+    */
+   int WATCH_MODE_NONE = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final String FORUMSMODULE_JNDINAME = "java:portal/ForumsModule";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String USER_SIGNATURE_PROPERTY = "portal.user.forums.signature";
+
+   /**
+    * DOCUMENT_ME
+    */
+   String USER_SIGNATURE_ADD_PROPERTY = "portal.user.forums.addsignature";
+
+   String DEFAULT_DATE_PATTERN = "EEE MMM d, yyyy HH:mm aaa";
+
+   String DISK_PERSISTED_ATTACHEMENTS = "EEE MMM d, yyyy HH:mm aaa";
+
+   String POSTING_POSTBACK_FLAG = "posting_postback_flag";
+
+   String FILE_SESSION_INDEX = "portal.user.forums.file_session_index";
+
+   String ATTACHMENT_TOKENS_MANAGER = "org.jboss.portlet.forums.helper.AttachmentTokenManager";
+                                             
+}
+
+//// Debug Level
+////define('DEBUG', 1); // Debugging on
+//define('DEBUG', 1); // Debugging off
+//
+//
+//// User Levels <- Do not change the values of USER or ADMIN
+//define('DELETED', -1);
+//define('ANONYMOUS', -1);
+//
+//define('USER', 0);
+//define('ADMIN', 1);
+//define('MOD', 2);
+//
+//
+//// User related
+//define('USER_ACTIVATION_NONE', 0);
+//define('USER_ACTIVATION_SELF', 1);
+//define('USER_ACTIVATION_ADMIN', 2);
+//
+//define('USER_AVATAR_NONE', 0);
+//define('USER_AVATAR_UPLOAD', 1);
+//define('USER_AVATAR_REMOTE', 2);
+//define('USER_AVATAR_GALLERY', 3);
+//
+//
+//// Group settings
+//define('GROUP_OPEN', 0);
+//define('GROUP_CLOSED', 1);
+//define('GROUP_HIDDEN', 2);
+//
+//
+//// Forum state
+//define('FORUM_UNLOCKED', 0);
+//define('FORUM_LOCKED', 1);
+//
+//
+//
+//
+//
+//
+//// SQL codes
+//define('BEGIN_TRANSACTION', 1);
+//define('END_TRANSACTION', 2);
+//
+//
+//
+//
+//// Private messaging
+//define('PRIVMSGS_READ_MAIL', 0);
+//define('PRIVMSGS_NEW_MAIL', 1);
+//define('PRIVMSGS_SENT_MAIL', 2);
+//define('PRIVMSGS_SAVED_IN_MAIL', 3);
+//define('PRIVMSGS_SAVED_OUT_MAIL', 4);
+//define('PRIVMSGS_UNREAD_MAIL', 5);
+//
+//
+//
+//// Session parameters
+//define('SESSION_METHOD_COOKIE', 100);
+//define('SESSION_METHOD_GET', 101);
+//
+//
+//// Page numbers for session handling
+//define('PAGE_INDEX', 0);
+//define('PAGE_LOGIN', -1);
+//define('PAGE_SEARCH', -2);
+//define('PAGE_REGISTER', -3);
+//define('PAGE_PROFILE', -4);
+//define('PAGE_VIEWONLINE', -6);
+//define('PAGE_VIEWMEMBERS', -7);
+//define('PAGE_FAQ', -8);
+//define('PAGE_POSTING', -9);
+//define('PAGE_PRIVMSGS', -10);
+//define('PAGE_GROUPCP', -11);
+//define('PAGE_TOPIC_OFFSET', 5000);
+//
+//
+//
+//
+//// Table names
+//define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
+//define('BANLIST_TABLE', $table_prefix.'banlist');
+//define('CATEGORIES_TABLE', $table_prefix.'categories');
+//define('CONFIG_TABLE', $table_prefix.'config');
+//define('DISALLOW_TABLE', $table_prefix.'disallow');
+//define('FORUMS_TABLE', $table_prefix.'forums');
+//define('GROUPS_TABLE', $table_prefix.'groups');
+//define('POSTS_TABLE', $table_prefix.'posts');
+//define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
+//define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');
+//define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');
+//define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
+//define('PRUNE_TABLE', $table_prefix.'forum_prune');
+//define('RANKS_TABLE', $table_prefix.'ranks');
+//define('SEARCH_TABLE', $table_prefix.'search_results');
+//define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');
+//define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');
+//define('SESSIONS_TABLE', $table_prefix.'sessions');
+//define('SMILIES_TABLE', $table_prefix.'smilies');
+//define('THEMES_TABLE', $table_prefix.'themes');
+//define('THEMES_NAME_TABLE', $table_prefix.'themes_name');
+//define('TOPICS_TABLE', $table_prefix.'topics');
+//define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');
+//define('USER_GROUP_TABLE', $table_prefix.'user_group');
+//define('USERS_TABLE', $table_prefix.'users');
+//define('WORDS_TABLE', $table_prefix.'words');
+//define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
+//define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
+//define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
+//
+//?>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsConstants.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,773 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+import java.util.Collection;
+
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.portlet.forums.model.*;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * @version $Revision: 3217 $
+ */
+public interface ForumsModule
+{
+
+   public HibernateProvider getHibernate();
+   /**
+    *
+    */
+   int getFloodInterval();
+
+   /**
+    *
+    */
+   void setFloodInterval(int floodInterval);
+
+
+   /**
+    *    *
+    *       */
+   String getGuestUserName();
+
+   /**
+    *    *
+    *       */
+   void setGuestUserName(String guestUserName);
+
+   /**
+    *
+    */
+   String getFromAddress();
+
+   /**
+    *
+    */
+   void setFromAddress(String fromAddress);
+
+   /**
+    * Returns all the announcements of the forum
+    *
+    * @param forum Forum in which we want to search for the announcements
+    * @return List of topics
+    * @throws ModuleException Throws an exception if unable to find the announcements.
+    */
+   List findAnnouncements(Forum forum)
+      throws ModuleException;
+
+   /**
+    * Returns some topics of a forum that are not of a certain type
+    *
+    * @return List of topics
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+   List findTopics(Integer indexInstance)
+      throws ModuleException;
+
+
+   /**
+    * Returns some topics of a forum that are not of a certain type
+    * The topics are ordered by creation date from oldest to newest
+    *
+    * @param forum   Forum in which we want to search for topics
+    * @param type    Type to avoid
+    * @param start   Index for fetching result
+    * @param perPage Number of result to return
+    * @return List of perPage topics ordered by creation date.
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   List findTopicsAsc(Forum forum,
+                      int type,
+                      int start,
+                      int perPage)
+      throws ModuleException;
+
+   /**
+    * Returns topics that are ordered by creation date from newest to oldest.
+    *
+    * @param forum   Forum in which we want to search for topics
+    * @param type    Type to avoid
+    * @param start   Index for fetching result
+    * @param perPage Number of result to return
+    * @return List of perPage topics ordered by opposite creation date.
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   List findTopicsDesc(Forum forum,
+                       int type,
+                       int start,
+                       int perPage)
+      throws ModuleException;
+
+   /**
+    * Returns topics that are ordered by creation date from oldest to newest.
+    *
+    * @param forum   Forum in which we want to search for topics
+    * @param start   Index for fetching result
+    * @param perPage Number of result to return
+    * @return List of perPage topics ordered by creation date.
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   List findTopicsAsc(Forum forum,
+                      int start,
+                      int perPage)
+      throws ModuleException;
+
+   /**
+    * Returns some topics of a forum that are not of a certain type
+    * The topics are ordered by creation date from newest to oldest
+    *
+    * @param forum   Forum in which we want to search for topics
+    * @param start   Index for fetching result
+    * @param perPage Number of result to return
+    * @return List of perPage topics ordered by opposite creation date.
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   List findTopicsDesc(Forum forum,
+                       int start,
+                       int perPage)
+      throws ModuleException;
+
+   /**
+    * *
+    *
+    * @param forum Forum in which we want to search for topics
+    * @return List of perPage topics ordered by creation date.
+    * @throws ModuleException Throws an excpetion if unable to find the topics.
+    */
+   List findTopics(Forum forum)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum   DOCUMENT_ME
+    * @param type    DOCUMENT_ME
+    * @param start   DOCUMENT_ME
+    * @param perPage DOCUMENT_ME
+    * @param date    DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findTopicsBefore(Forum forum,
+                         int type,
+                         int start,
+                         int perPage,
+                         Date date)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param replies DOCUMENT_ME
+    * @param limit   DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+
+   /* Luca Stancapiano start - findTopicsHot, findTopicsByLatestPosts,
+      findTopicsHottest, findTopicsMostViewed methods need to a forumInstanceId argument 
+      to take only objects of a specific forum instance 
+   */
+   List findTopicsHot(int replies, int limit, Integer indexInstance)
+     throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param limit DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findTopicsByLatestPosts(int limit, Integer indexInstance)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param after DOCUMENT_ME
+    * @param limit DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findTopicsHottest(Date after, int limit, Integer indexInstance)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param after DOCUMENT_ME
+    * @param limit DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findTopicsMostViewed(Date after, int limit, Integer indexInstance)
+      throws ModuleException;
+   // Luca Stancapiano end
+
+
+   /**
+    * Find a forum by specifying its ID
+    *
+    * @param id ID of the forum to retrieve
+    * @return Forum with specified ID
+    * @throws ModuleException Throws an exception if the forum cannot be found
+    */
+   Forum findForumById(Integer id)
+      throws ModuleException;
+      
+   /**
+    * Find a forum by specifying its ID and fetch Topics of this Forum.
+    *
+    * @param id ID of the forum to retrieve
+    * @return Forum with specified ID
+    * @throws ModuleException Throws an exception if the forum cannot be found
+    */
+   Forum findForumByIdFetchTopics(Integer id)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param category    DOCUMENT_ME
+    * @param name        DOCUMENT_ME
+    * @param description DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Forum createForum(Category category,
+                     String name,
+                     String description)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+
+   /* Luca Stancapiano - findPosts method need to a forumInstanceId argument 
+      to take only posts of a specific forum instance 
+   */
+   public List findPosts(Integer indexInstance) throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param id DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Post findPostById(Integer id)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param userID DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Poster findPosterByUserId(String userID)
+      throws ModuleException;
+
+   /**
+    * Get all the categories of forums.
+    *
+    * @return All the categories
+    * @throws ModuleException
+    */
+
+   /* Luca Stancapiano start - findCategories, findCategoriesFetchForums and 
+      findForums methods need to a forumInstanceId argument 
+      to take only categories of a specific forum instance 
+   */
+   List findCategories(Integer indexInstance)
+      throws ModuleException;
+
+    /**
+     * Get all the categories of forums and fetch forums.
+     *
+     * @return All the categories
+     * @throws ModuleException
+     */
+   List findCategoriesFetchForums(Integer indexInstance)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findForums(Integer indexInstance)
+      throws ModuleException;
+   //  Luca Stancapiano end
+
+   /**
+    * Get all the forums of a category
+    *
+    * @param categoryID Category of forums
+    * @return Forums of one category
+    */
+   List findForumsByCategoryId(Integer categoryID)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum        DOCUMENT_ME
+    * @param message      DOCUMENT_ME
+    * @param creationDate DOCUMENT_ME
+    * @param poster       DOCUMENT_ME
+    * @return The new post created
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Post createTopic(Forum forum,
+                    Message message,
+                    Date creationDate,
+                    Poster poster,
+                    Poll poll,
+                    List attachments,
+                    int type)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum   DOCUMENT_ME
+    * @param userID  DOCUMENT_ME
+    * @param subject DOCUMENT_ME
+    * @param type    DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Topic createTopic(Forum forum,
+                     String userID,
+                     String subject,
+                     int type)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic        DOCUMENT_ME
+    * @param forum        DOCUMENT_ME
+    * @param message      DOCUMENT_ME
+    * @param creationTime DOCUMENT_ME
+    * @param poster       DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Post createPost(Topic topic,
+                   Forum forum,
+                   Message message,
+                   Date creationTime,
+                   Poster poster,
+                   List attachments)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic DOCUMENT_ME
+    * @param poll  DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   public Poll addPollToTopic(Topic topic,
+                              Poll poll)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+    /* Luca Stancapiano - createCategory method need to a forumInstanceId argument 
+       to create only categories of a specific forum instance 
+     */
+    Category createCategory(String name, ForumInstance forumInstance)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param category DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void removeCategory(Category category)
+      throws ModuleException;
+   
+   /* Luca Stancapiano start - I add createForumInstance 
+      and removeForumInstance methods
+      to manage create and remove of a ForumInstance.
+   */
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+    ForumInstance createForumInstance(Integer indexInstance, String name)
+       throws ModuleException;
+    
+    /**
+     * DOCUMENT_ME
+     *
+     * @param forumInstance DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    void removeForumInstance(ForumInstance forumInstance)
+       throws ModuleException;
+    
+    // Luca Stancapiano end
+   
+    /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void removeForum(Forum forum)
+      throws ModuleException;
+
+   /**
+    * Delete a post
+    *
+    * @param post Post to delete
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void removePost(Post post)
+      throws ModuleException;
+
+   /**
+    * Delete a post
+    *
+    * @param topic Post to delete
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void removePollInTopic(Topic topic)
+      throws ModuleException;
+
+   /**
+    * Delete a topic
+    *
+    * @param topic Topic to delete
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void removeTopic(Topic topic)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param categoryID DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   Category findCategoryById(Integer categoryID)
+      throws ModuleException;
+      
+    /**
+     * DOCUMENT_ME
+     *
+     * @param categoryID DOCUMENT_ME
+     * @return DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    Category findCategoryByIdFetchForums(Integer categoryID)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param source DOCUMENT_ME
+    * @param target DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   void addAllForums(Category source,
+                     Category target)
+      throws ModuleException;
+
+   /**
+    * @param topicID
+    * @return DOCUMENT_ME
+    */
+   Topic findTopicById(Integer topicID)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicID DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findPostsByTopicId(Integer topicID)
+      throws ModuleException;
+
+    /**
+     * DOCUMENT_ME
+     *
+     * @param topicID DOCUMENT_ME
+     * @param start   DOCUMENT_ME
+     * @param limit   DOCUMENT_ME
+     * @return DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    List findPostsByIdsAscFetchAttachmentsAndPosters( Collection postIds )
+       throws ModuleException;
+
+    /**
+     * DOCUMENT_ME
+     *
+     * @param topicID DOCUMENT_ME
+     * @param start   DOCUMENT_ME
+     * @param limit   DOCUMENT_ME
+     * @return DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    List findPostsByIdsDescFetchAttachmentsAndPosters( Collection postIds )
+       throws ModuleException;
+       
+    /**
+     * DOCUMENT_ME
+     *
+     * @param topicID DOCUMENT_ME
+     * @param start   DOCUMENT_ME
+     * @param limit   DOCUMENT_ME
+     * @return DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    List findPostIdsAsc(Integer topicID,
+                               int start,
+                               int limit)
+       throws ModuleException;
+
+    /**
+     * DOCUMENT_ME
+     *
+     * @param topicID DOCUMENT_ME
+     * @param start   DOCUMENT_ME
+     * @param limit   DOCUMENT_ME
+     * @return DOCUMENT_ME
+     * @throws ModuleException DOCUMENT_ME
+     */
+    List findPostIdsDesc(Integer topicID,
+                                int start,
+                                int limit)
+       throws ModuleException;   
+    
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicID DOCUMENT_ME
+    * @param start   DOCUMENT_ME
+    * @param limit   DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findPostsByTopicIdAsc(Integer topicID,
+                              int start,
+                              int limit)
+      throws ModuleException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicID DOCUMENT_ME
+    * @param start   DOCUMENT_ME
+    * @param limit   DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   List findPostsByTopicIdDesc(Integer topicID,
+                               int start,
+                               int limit)
+      throws ModuleException;
+
+
+   Date findLastPostDateForUser(User user) throws ModuleException;
+
+   Post findLastPost(Forum forum) throws ModuleException;
+
+   Post findFirstPost(Topic topic) throws ModuleException;
+
+   Post findLastPost(Topic topic) throws ModuleException;
+   
+   Map findLastPostsOfTopics(Collection topics) throws ModuleException;
+   
+   /* Luca Stancapiano - findLastPostsOfForums method need to a forumInstanceId argument 
+      to take only posts of a specific forum instance 
+   */
+   Map findLastPostsOfForums(Integer indexInstance) throws ModuleException;
+
+   /* Luca Stancapiano - findForumWatchByUser method need to a forumInstanceId argument 
+      to take only categories of a specific forum instance 
+   */
+   List findForumWatchByUser(User user, Integer indexInstance) throws ModuleException;
+
+   /* Luca Stancapiano - findForumWatchedByUser method need to a forumInstanceId argument 
+      to take only forums of a specific forum instance 
+   */
+   List findForumWatchedByUser(User user, Integer indexInstance) throws ModuleException;
+   
+   /* Luca Stancapiano - findTopicWatchedByUser method need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+   List findTopicWatchedByUser(User user, Integer indexInstance) throws ModuleException;
+   
+   /* Luca Stancapiano - findTopicWatchedByUser method need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+   List findTopicWatchedByUser(User user,Date date, Integer indexInstance) throws ModuleException;
+   
+   List findPostsFromForumAsc(Forum forum, int limit) throws ModuleException;
+   
+   List findPostsFromForumDesc(Forum forum, int limit) throws ModuleException;
+   
+   List findPostsFromCategoryAsc(Category category, int limit)
+        throws ModuleException;
+   
+   List findPostsFromCategoryDesc(Category category, int limit)
+        throws ModuleException;
+   
+   /* Luca Stancapiano - findTopicWatches method need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+   Map findTopicWatches(User user, Integer indexInstance) throws ModuleException;
+   
+   Attachment findFindAttachmentById(Integer attachID)
+        throws ModuleException;
+
+
+   Poster createPoster(String userID) throws ModuleException;
+
+   /**
+    * @param poster
+    * @param forum
+    * @param i
+    */
+   void createWatch(Poster poster, Forum forum, int i) throws ModuleException;
+
+   /**
+    * @param forumWatchID
+    * @return DOCUMENT_ME
+    */
+   ForumWatch findForumWatchById(Integer forumWatchID) throws ModuleException;
+
+   /* Luca Stancapiano - findForumWatches method need to a forumInstanceId argument 
+      to take only forums of a specific forum instance 
+   */
+   Map findForumWatches(User user, Integer indexInstance) throws ModuleException;
+   
+   /**
+    * 
+    * @param user
+    * @param forumId
+    * @return ForumWatch
+    * @throws ModuleException
+    */
+   ForumWatch findForumWatchByUserAndForum(User user,int forumId) throws ModuleException;
+   
+   /**
+    * 
+    * @param user
+    * @param topicId
+    * @return TopicWatch
+    * @throws ModuleException
+    */
+   TopicWatch findTopicWatchByUserAndTopic(User user,int topicId) throws ModuleException;
+   
+   // Luca Stancapiano start - search method for forum instances
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forumInstanceID DOCUMENT_ME
+    * @return DOCUMENT_ME
+    * @throws ModuleException DOCUMENT_ME
+    */
+   ForumInstance findForumInstanceById(Integer forumInstanceID)
+      throws ModuleException;
+   // Luca Stancapiano end 
+   
+   /**
+    * @param poster
+    * @param topic
+    */
+   void createWatch(Poster poster, Topic topic, int mode) throws ModuleException;
+
+   /**
+    * @param topicWatchID
+    * @return DOCUMENT_ME
+    */
+   TopicWatch findTopicWatchById(Integer topicWatchID) throws ModuleException;
+
+   /**
+    * @param watch
+    */
+   void removeWatch(Watch watch) throws ModuleException;
+   
+   /**
+    * 
+    *
+    */
+   public void processNotifications (Integer postId, int watchType , String postUrl , String replyUrl );
+   
+   /**
+    * 
+    * @return
+    */
+   public UserProfileModule getUserProfileModule();
+   
+   /**
+    * 
+    * @return
+    */
+   public List findPostsDesc(int limit) throws ModuleException;
+   
+   /**
+    * 
+    * @return
+    */
+   public List findPostsAsc(int limit) throws ModuleException;
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLChooseTagHandler.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLChooseTagHandler.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLChooseTagHandler.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//core java
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+
+//jsf
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException; 
+import javax.faces.component.UIComponent;
+
+//logging
+import org.apache.log4j.Logger;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+//servlet
+import javax.el.ELException;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+
+
+//facelets
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.el.ELAdaptor;
+
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Mar 29, 2006
+ *
+ */
+public class ACLChooseTagHandler extends TagHandler 
+{
+    /**
+     * 
+     */
+    private static final Logger log = Logger.getLogger(ACLChooseTagHandler.class);
+    
+    /**
+     * 
+     */
+    private ACLWhenTagHandler when = null;
+    private ACLOtherwiseTagHandler otherwise = null;
+        
+
+    /**
+     * @param config
+     */
+    public ACLChooseTagHandler(TagConfig config) 
+    {
+        super(config); 
+        
+        //setup when tag handler
+        Iterator itr = this.findNextByType(ACLWhenTagHandler.class);
+        if(itr!=null && itr.hasNext())
+        {
+            this.when = (ACLWhenTagHandler)itr.next();
+        }
+        else
+        {
+            throw new TagException(this.tag, "isAllowedChoose Tag must have a isAllowedWhen Tag");
+        }
+        
+        //setup otherwise tag handler
+        Iterator itr2 = this.findNextByType(ACLOtherwiseTagHandler.class);
+        if(itr2!=null && itr2.hasNext())
+        {
+            this.otherwise = (ACLOtherwiseTagHandler)itr2.next();
+        }
+    }
+
+    /**
+     * Threadsafe Method for controlling evaluation of
+     * its child tags, represented by "nextHandler"
+     */
+    public void apply(FaceletContext ctx, UIComponent parent)
+    throws IOException,FacesException,ELException 
+    {
+        if(this.when.isAllowed(ctx))
+        {
+            this.when.apply(ctx,parent);
+            return;
+        }
+        else
+        {
+            if(this.otherwise!=null)
+            {
+                this.otherwise.apply(ctx,parent);
+            }
+        }
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLOtherwiseTagHandler.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLOtherwiseTagHandler.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLOtherwiseTagHandler.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//core java
+import java.io.IOException;
+import java.util.StringTokenizer;
+
+
+//jsf
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException; 
+import javax.faces.component.UIComponent;
+
+//logging
+import org.apache.log4j.Logger;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+//servlet
+import javax.el.ELException;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+
+
+//facelets
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.el.ELAdaptor;
+
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Mar 29, 2006
+ *
+ */
+public class ACLOtherwiseTagHandler extends TagHandler 
+{
+    /**
+     * 
+     */
+    private static final Logger log = Logger.getLogger(ACLOtherwiseTagHandler.class);
+        
+
+    /**
+     * @param config
+     */
+    public ACLOtherwiseTagHandler(TagConfig config) 
+    {
+        super(config);        
+    }
+
+    /**
+     * Threadsafe Method for controlling evaluation of
+     * its child tags, represented by "nextHandler"
+     */
+    public void apply(FaceletContext ctx, UIComponent parent)
+    throws IOException,FacesException,ELException 
+    {
+        this.nextHandler.apply(ctx,parent);
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,170 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//core java
+import java.io.IOException;
+import java.util.StringTokenizer;
+
+
+//jsf
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException; 
+import javax.faces.component.UIComponent;
+
+//logging
+import org.apache.log4j.Logger;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+//servlet
+import javax.el.ELException;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+
+
+//facelets
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.el.ELAdaptor;
+
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Mar 29, 2006
+ *
+ */
+public class ACLTagHandler extends TagHandler 
+{
+    /**
+     * 
+     */
+    private static final Logger log = Logger.getLogger(ACLTagHandler.class);
+    
+    //possible attributes
+    private TagAttribute fragment = null; //required
+    private TagAttribute contextData = null; //optional
+
+    /**
+     * @param config
+     */
+    public ACLTagHandler(TagConfig config) 
+    {
+        super(config);
+        
+        // helper method for getting a required attribute
+        this.fragment = this.getRequiredAttribute("fragment");
+        
+        // helper method, optional attribute
+        this.contextData = this.getAttribute("contextData");
+    }
+
+    /**
+     * Threadsafe Method for controlling evaluation of
+     * its child tags, represented by "nextHandler"
+     */
+    public void apply(FaceletContext ctx, UIComponent parent)
+    throws IOException,FacesException,ELException 
+    {
+        FacesContext facesContext = ctx.getFacesContext();
+        
+        //make sure an authorization provider has been hooked in
+        boolean skipAuth = false;
+        try
+        {        
+	        if(Authorization.getProvider()==null)
+	        {
+	            //no authorization will be enforced
+	            skipAuth = true;
+	        }
+        }
+        catch(Exception e)
+        {
+            log.error(this,e);
+            //something went wrong in the Authorization system
+            skipAuth = true;
+        }
+        
+        if(skipAuth)
+        {
+            this.nextHandler.apply(ctx, parent);
+            return;
+        }
+        
+        //an authorization provider is hooked in....go ahead and perform authorization
+        try
+        {
+	        String resource = this.fragment.getValue();
+	        String contextStr = null;
+	        
+	        if(this.contextData!=null)
+	        {
+	            contextStr = this.contextData.getValue();
+	        }
+	        
+	        //resourcesetup
+	        Object[] runtime = null;
+	        if(contextStr!=null && contextStr.trim().length()>0)
+	        {
+	            StringTokenizer st = new StringTokenizer(contextStr,",");
+	            runtime = new Object[st.countTokens()];
+	            int i=0;
+	            while(st.hasMoreTokens())
+	            {
+	                String parameter = st.nextToken();
+	                Object parameterValue = null;
+	                
+	                //evaluate this expression to a value
+	                ExpressionFactory f = ctx.getExpressionFactory();
+	                ValueExpression expr = f.createValueExpression(ctx,parameter,Object.class);
+	                parameterValue = expr.getValue(ELAdaptor.getELContext(facesContext));
+	                                
+	                runtime[i++] = parameterValue;
+	            }
+	        }
+	                    
+	        //check access here
+	        JSFUIContext securityContext = new JSFUIContext(PortalUtil.getUser(),facesContext);
+	        securityContext.setFragment(resource);
+	        securityContext.setContextData(runtime);
+	        
+	        //feed this context to the Authorization system which will decide whether
+	        //access should be granted or not
+	        boolean isAccessAllowed = Authorization.getProvider().hasAccess(securityContext);
+	        
+	        if(isAccessAllowed)
+	        {
+	            this.nextHandler.apply(ctx, parent);
+	        }	        
+        }
+        catch(NoSuchMethodException nsme)
+        {
+            throw new FacesException(nsme);
+        }
+        catch(Exception e)
+        {
+            throw new FacesException(e);
+        }
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLWhenTagHandler.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLWhenTagHandler.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/ACLWhenTagHandler.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//core java
+import java.io.IOException;
+import java.util.StringTokenizer;
+
+
+//jsf
+import javax.faces.context.FacesContext;
+import javax.faces.FacesException; 
+import javax.faces.component.UIComponent;
+
+//logging
+import org.apache.log4j.Logger;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+//servlet
+import javax.el.ELException;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+
+
+//facelets
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.el.ELAdaptor;
+
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Mar 29, 2006
+ *
+ */
+public class ACLWhenTagHandler extends TagHandler 
+{
+    /**
+     * 
+     */
+    private static final Logger log = Logger.getLogger(ACLWhenTagHandler.class);
+    
+    //possible attributes
+    private TagAttribute fragment = null; //required
+    private TagAttribute contextData = null; //optional
+
+    /**
+     * @param config
+     */
+    public ACLWhenTagHandler(TagConfig config) 
+    {
+        super(config);
+        
+        // helper method for getting a required attribute
+        this.fragment = this.getRequiredAttribute("fragment");
+        
+        // helper method, optional attribute
+        this.contextData = this.getAttribute("contextData");
+    }
+
+    /**
+     * Threadsafe Method for controlling evaluation of
+     * its child tags, represented by "nextHandler"
+     */
+    public void apply(FaceletContext ctx, UIComponent parent)
+    throws IOException,FacesException,ELException 
+    {
+        FacesContext facesContext = ctx.getFacesContext();  
+        this.nextHandler.apply(ctx,parent);
+    }
+    
+    /**
+     * 
+     *
+     */
+    public boolean isAllowed(FaceletContext ctx)
+    {
+        boolean isAllowed = false;
+        
+        FacesContext facesContext = ctx.getFacesContext();
+        
+        //make sure an authorization provider has been hooked in
+        boolean skipAuth = false;
+        try
+        {        
+	        if(Authorization.getProvider()==null)
+	        {
+	            //no authorization will be enforced
+	            skipAuth = true;
+	        }
+        }
+        catch(Exception e)
+        {
+            log.error(this,e);
+            //something went wrong in the Authorization system
+            skipAuth = true;
+        }
+        
+        if(skipAuth)
+        {
+            isAllowed = true;
+            return isAllowed;
+        }
+        
+        //an authorization provider is hooked in....go ahead and perform authorization
+        try
+        {
+	        String resource = this.fragment.getValue();
+	        String contextStr = null;
+	        
+	        if(this.contextData!=null)
+	        {
+	            contextStr = this.contextData.getValue();
+	        }
+	        
+	        //resourcesetup
+	        Object[] runtime = null;
+	        if(contextStr!=null && contextStr.trim().length()>0)
+	        {
+	            StringTokenizer st = new StringTokenizer(contextStr,",");
+	            runtime = new Object[st.countTokens()];
+	            int i=0;
+	            while(st.hasMoreTokens())
+	            {
+	                String parameter = st.nextToken();
+	                Object parameterValue = null;
+	                
+	                //evaluate this expression to a value
+	                ExpressionFactory f = ctx.getExpressionFactory();
+	                ValueExpression expr = f.createValueExpression(ctx,parameter,Object.class);
+	                parameterValue = expr.getValue(ELAdaptor.getELContext(facesContext));
+	                                
+	                runtime[i++] = parameterValue;
+	            }
+	        }
+	                    
+	        //check access here
+	        JSFUIContext securityContext = new JSFUIContext(PortalUtil.getUser(),facesContext);
+	        securityContext.setFragment(resource);
+	        securityContext.setContextData(runtime);
+	        
+	        //feed this context to the Authorization system which will decide whether
+	        //access should be granted or not
+	        isAllowed = Authorization.getProvider().hasAccess(securityContext);	        	        	        
+        }
+        catch(NoSuchMethodException nsme)
+        {
+            throw new FacesException(nsme);
+        }
+        catch(Exception e)
+        {
+            throw new FacesException(e);
+        }
+        
+        return isAllowed;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/Authorization.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/Authorization.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/Authorization.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//jmx related
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/*
+ * Created on May 19, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="maitlo:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class Authorization 
+{
+    static AuthorizationContext cachedContext = null; 
+    
+    /**
+     * look this jmx service up and make this service available to clients of this system
+     * also cache this provider so that jmx lookup is only required once during the life-time of this application
+     *
+     */
+    public static AuthorizationContext getContext() throws Exception
+    {
+        if(Authorization.cachedContext==null)
+        {
+	        //get the registered cms service mbean
+	        MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+	        Authorization.cachedContext = (AuthorizationContext)MBeanProxy.get(AuthorizationContext.class,
+	        new ObjectName("portal.forums:service=AuthorizationContext"), 
+	        mbeanServer);
+        }                
+        return Authorization.cachedContext;
+    } 
+    
+    /**
+     * 
+     *
+     */
+    public static AuthorizationInterface getProvider() throws Exception
+    {
+        AuthorizationInterface provider = null;
+        
+        provider = getContext().provider();
+        
+        return provider;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+/*
+ * Created on May 19, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="maitlo:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public interface AuthorizationContext 
+{    
+    /**
+     * 
+     *
+     */
+    public AuthorizationInterface provider();
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContextImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContextImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationContextImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//logging related
+import org.apache.log4j.Logger;
+
+
+/*
+ * Created on May 19, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="maitlo:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class AuthorizationContextImpl implements AuthorizationContext
+{
+    /**
+     * 
+     */
+    private static final Logger log = Logger.getLogger(AuthorizationContextImpl.class);
+    
+    /**
+     * 
+     */
+    private AuthorizationInterface provider = null;
+    private String providerImpl = null;
+    
+    /**
+     * 
+     *
+     */
+    public AuthorizationContextImpl()
+    {        
+    }
+                
+        
+    /**
+     * @param providerImpl The providerImpl to set.
+     */
+    public void setProviderImpl(String providerImpl) 
+    {
+        this.providerImpl = providerImpl;
+    }
+    
+    //----AuthorizationContext implementation------------------------------------------------------------------------------------------------
+    /**
+    * @return Returns the provider.
+    */
+    public AuthorizationInterface provider() 
+    {
+       return provider;
+    }
+    //------jmx mbean related operations-------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public void start()
+    {
+        try
+        {
+            this.provider = (AuthorizationInterface)Thread.currentThread().getContextClassLoader().loadClass(this.providerImpl).newInstance();
+            //reset the cachedContext
+            Authorization.cachedContext = null;
+            log.info(AuthorizationContextImpl.class.getName()+" successfully started......");
+        }
+        catch(Exception e)
+        {
+            this.stop();
+            log.error(this,e);            
+            log.info(AuthorizationContextImpl.class.getName()+" failed to start......");
+        }
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void stop()
+    {
+        this.provider = null;
+        this.providerImpl = null;
+        Authorization.cachedContext = null;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationInterface.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationInterface.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationInterface.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+/*
+ * Created on May 18, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public interface AuthorizationInterface 
+{
+    public boolean hasAccess(SecurityContext context);
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,182 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+//core java api
+import java.lang.reflect.Method;
+import java.security.AccessControlException;
+
+//jsf api
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.application.Application;
+import javax.faces.component.ActionSource;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.VariableResolver;
+
+
+//myfaces integration
+import org.apache.log4j.Logger;
+import org.apache.myfaces.application.ActionListenerImpl;
+
+//jsf forums classes
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+
+/*
+ * Created on May 17, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class AuthorizationListener extends ActionListenerImpl
+{
+    private static final Logger log = Logger.getLogger(AuthorizationListener.class);
+    
+    /**
+     * 
+     */
+    public AuthorizationListener() throws Exception
+    {        
+    }
+    
+    /* 
+     */
+    public void processAction(ActionEvent actionEvent) throws AbortProcessingException 
+    { 
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        
+        //make sure an authorization provider has been hooked in
+        boolean skipAuth = false;
+        try
+        {        
+	        if(Authorization.getProvider()==null)
+	        {
+	            skipAuth = true;
+	        }
+        }
+        catch(Exception e)
+        {
+            log.error(this,e);
+            
+            //something went wrong in the Authorization system
+            skipAuth = true;
+        }
+        
+        if(skipAuth)
+        {
+            //no authorization will be enforced
+            super.processAction(actionEvent);
+            return;
+        }
+        
+        
+        //an authorization provider is hooked in, go ahead and enforce authorization
+        boolean isAccessAllowed = this.isAccessAllowed(actionEvent);
+        
+        if(isAccessAllowed)
+        {
+            //make method call
+            super.processAction(actionEvent);
+        }
+        else
+        {
+            AccessControlException ace = new AccessControlException("Access Denied"); 
+            JSFUtil.handleException(ace);
+            throw new AbortProcessingException(ace);
+        }
+    } 
+    
+    /**
+     * 
+     *
+     */
+    private boolean isAccessAllowed(ActionEvent actionEvent)
+    {
+        boolean isAccessAllowed = false;
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        Application application = facesContext.getApplication();
+        
+        //enforce authorization security
+        try
+        {	                
+	        ActionSource actionSource = (ActionSource)actionEvent.getComponent();
+	        MethodBinding methodBinding = actionSource.getAction();
+	        Method businessAction = null;
+	        Object managedBean = null;
+	        if(methodBinding!=null)
+	        {
+	            //this means a business action is going to be called...this needs to be authorized
+	            VariableResolver variableResolver = application.getVariableResolver();
+	            String expression = methodBinding.getExpressionString();
+	            String[] methodInfo = this.parseExpression(expression); 
+	            
+	            managedBean = variableResolver.resolveVariable(facesContext,methodInfo[0]);
+	            businessAction = managedBean.getClass().getMethod(methodInfo[1],null);
+	        }
+	        
+	        //start building the SecurityContext here for the Authorization System
+	        JSFActionContext securityContext = new JSFActionContext(PortalUtil.getUser(),facesContext);	        
+	        securityContext.setBusinessAction(businessAction);
+	        securityContext.setManagedBean(managedBean);
+	        
+	        //feed this context to the Authorization system which will decide whether
+	        //access should be granted or not
+	        isAccessAllowed = Authorization.getProvider().hasAccess(securityContext);
+        }
+        catch(NoSuchMethodException nsme)
+        {
+            log.error(this,nsme);
+            throw new FacesException("Error calling action method of component with id " + actionEvent.getComponent().getClientId(facesContext), nsme);
+        }
+        catch(Exception e)
+        {
+            log.error(this,e);
+            throw new FacesException("Error calling action method of component with id " + actionEvent.getComponent().getClientId(facesContext), e);
+        }
+        return isAccessAllowed;
+    }
+    
+    /**
+     * 
+     * Created on May 18, 2006
+     *
+     * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+     */
+    private String[] parseExpression(String expression)
+    {
+        String[] values = new String[2];
+        
+        int startIndex = expression.indexOf('{') + 1;
+        int endIndex = expression.trim().length()-1;
+        int dotIndex = expression.indexOf('.');
+        
+        
+        values[0] = expression.substring(startIndex,dotIndex).trim();
+        values[1] = expression.substring(dotIndex+1,endIndex).trim();
+        
+        return values;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFActionContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFActionContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFActionContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+import java.lang.reflect.Method;
+
+import javax.faces.context.FacesContext;
+
+/*
+ * Created on May 23, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class JSFActionContext extends JSFSecurityContext
+{
+    /**
+     * this is the action method on a JSF Managed Bean that is being called
+     * and needs to be authorized access to
+     */
+    private Method businessAction = null;
+    
+    /**
+     * This is the JSF Managed Bean that is being used
+     */
+    private Object managedBean = null;
+    
+    /**
+     * 
+     *
+     */
+    public JSFActionContext(Object identity,FacesContext facesContext)
+    {
+       super(identity,facesContext);
+    }
+    
+    /**
+     * 
+     *
+     */
+    public Method getBusinessAction()
+    {
+        return this.businessAction;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void setBusinessAction(Method businessAction)
+    {
+        this.businessAction = businessAction;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public Object getManagedBean()
+    {
+        return this.managedBean;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void setManagedBean(Object managedBean)
+    {
+        this.managedBean = managedBean;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFSecurityContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFSecurityContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFSecurityContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+import java.lang.reflect.Method;
+
+import javax.faces.context.FacesContext;
+
+
+
+/*
+ * Created on May 19, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public abstract class JSFSecurityContext implements SecurityContext
+{
+    /**
+     * 
+     */
+    private FacesContext facesContext = null;
+    
+        
+    /**
+     * this is current user that needs to be authorized..
+     * left the type of this identity open ended..
+     * the actual provider can then cast it based on what it expects it to be
+     */
+    private Object identity = null;
+        
+    
+    /**
+     * 
+     *
+     */
+    public JSFSecurityContext(Object identity,FacesContext facesContext)
+    {
+       this.facesContext = facesContext; 
+       this.identity = identity;
+    }
+    
+    
+        
+    /**
+     * @return Returns the identity.
+     */
+    public Object getIdentity() 
+    {
+        return this.identity;
+    }
+    
+    /**
+     * @param identity The identity to set.
+     */
+    public void setIdentity(Object identity) 
+    {
+        this.identity = identity;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public FacesContext getFacesContext()
+    {
+        return this.facesContext;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFUIContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFUIContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/JSFUIContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+import javax.faces.context.FacesContext;
+
+/*
+ * Created on May 23, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class JSFUIContext extends JSFSecurityContext
+{
+    /**
+     * 
+     *
+     */
+    private String fragment = null;
+    private Object[] contextData = null;
+    
+    /**
+     * 
+     *
+     */
+    public JSFUIContext(Object identity,FacesContext facesContext)
+    {
+       super(identity,facesContext);
+    }
+    
+    
+    /**
+     * @return Returns the contextData.
+     */
+    public Object[] getContextData() 
+    {
+        return contextData;
+    }
+    /**
+     * @param contextData The contextData to set.
+     */
+    public void setContextData(Object[] contextData) 
+    {
+        this.contextData = contextData;
+    }
+    /**
+     * @return Returns the fragment.
+     */
+    public String getFragment() 
+    {
+        return fragment;
+    }
+    /**
+     * @param fragment The fragment to set.
+     */
+    public void setFragment(String fragment)
+    {
+        this.fragment = fragment;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/SecurityContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/SecurityContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/auth/SecurityContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.auth;
+
+/*
+ * Created on May 18, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public interface SecurityContext 
+{
+    public Object getIdentity();
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.feeds;
+
+/**
+ * Constants used for RSS/ATOM feeds.
+ * 
+ * @author tomaszszymanski
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class FeedConstants {
+    
+    public final static String CATEGORY = "category";
+    
+    public final static String TOPIC = "topic";
+    
+    public final static String GLOBAL = "global";
+    
+    public final static String FORUM = "forum";
+    
+    public static final String RSS = "rss";
+    
+    public static final String ATOM = "atom";
+    
+    public static final String URL_INIT_PARAM_NAME = "org.jboss.forums.feeds.URL";
+    
+    public static final String URL_TYPE_INIT_PARAM_NAME = "org.jboss.forums.feeds.URL_TYPE";
+    
+    public static final String WRONG_FEED_TYPE = "Wrong feed type: ";
+    
+    public static final String WRONG_FEED_REQ = "Wrong feed request";
+    
+    public static final String WRONG_FEED_SHOW_TYPE = "Wrong feed forum type: ";
+    
+    public static final int POST_LIMIT = 20;
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,384 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.feeds;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.hibernate.TransactionException;
+import org.jboss.portal.common.transaction.TransactionManagerProvider;
+import org.jboss.portal.common.transaction.Transactions;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumsJSFPortlet;
+
+import com.sun.syndication.feed.synd.SyndContent;
+import com.sun.syndication.feed.synd.SyndContentImpl;
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.feed.synd.SyndFeedImpl;
+import com.sun.syndication.io.SyndFeedOutput;
+
+/**
+ * Servlet used for showing RSS entries
+ * 
+ * @author tomaszszymanski
+ * @author Ryszard Kozmik <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * 
+ */
+public class FeedsServlet extends HttpServlet {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    private ForumsModule forumsModule;
+
+    private static final Logger log = Logger.getLogger(FeedsServlet.class);
+
+    private TransactionManager tm;
+
+    public void init() {
+        try {
+            forumsModule = (ForumsModule) new InitialContext()
+                    .lookup("java:portal/ForumsModule");
+        } catch (NamingException e) {
+            log.error(e);
+        }
+    }
+
+    protected void doGet(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException {
+        try {
+            String[] uri = request.getRequestURI().split("/");
+
+            if (uri.length < 5
+                    || (uri[4].equals(FeedConstants.GLOBAL) && uri.length != 5)
+                    || (!uri[4].equals(FeedConstants.GLOBAL) && uri.length != 6)) {
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+                        FeedConstants.WRONG_FEED_REQ);
+                return;
+            }
+
+            String type = uri[3];
+            String what = uri[4];
+
+            Integer id = null;
+
+            if (!what.equals(FeedConstants.GLOBAL))
+                id = Integer.valueOf(uri[5]);
+
+            SyndFeed feed = new SyndFeedImpl();
+
+            if (!setFeedType(feed, type)) {
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+                        FeedConstants.WRONG_FEED_TYPE + type);
+                return;
+            }
+
+            if (tm == null) {
+                try {
+                    tm = TransactionManagerProvider.JBOSS_PROVIDER
+                            .getTransactionManager();
+                } catch (Exception e) {
+                    System.out
+                            .println("Obtaining TransactionManagerProvider Problem....");
+                }
+            }
+            
+            String url = null;
+            String urlType = null;
+            
+            String urlRequestParam = request.getParameter("url");
+            String urlTypeRequestParam = request.getParameter("urlType");
+            
+            if (urlRequestParam!=null && urlRequestParam.trim().length()!=0
+                    && urlTypeRequestParam!=null && urlTypeRequestParam.trim().length()!=0
+                    && ( urlTypeRequestParam.compareTo("p")==0 || urlTypeRequestParam.compareTo("s")==0 ) )
+            {
+                url = request.getParameter("url");
+                urlType = urlTypeRequestParam;
+            }
+            
+            String urlInitParam = this.getServletContext().getInitParameter(FeedConstants.URL_INIT_PARAM_NAME);
+            String urlTypeInitParam = this.getServletContext().getInitParameter(FeedConstants.URL_TYPE_INIT_PARAM_NAME);
+            if (urlInitParam!=null && urlInitParam.trim().length()!=0
+                    && urlTypeInitParam!=null && urlTypeInitParam.trim().length()!=0)
+            {
+                url = urlInitParam;
+                urlType = urlTypeInitParam;
+            }
+            
+            if (url==null || urlType==null)
+            {
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST,FeedConstants.WRONG_FEED_REQ);
+                return;
+            }
+            
+            javax.transaction.Transaction oldTx = null;
+            try {
+                oldTx = Transactions
+                        .applyBefore(Transactions.TYPE_REQUIRED, tm);
+                try {
+                    if (what.equals(FeedConstants.CATEGORY)) {
+                        createCategoryFeed(feed, id, url, urlType);
+                    } else if (what.equals(FeedConstants.FORUM)) {
+                        createForumFeed(feed, id, url, urlType);
+                    } else if (what.equals(FeedConstants.TOPIC)) {
+                        createTopicFeed(feed, id, url, urlType);
+                    } else if (what.equals(FeedConstants.GLOBAL)) {
+                        createGlobalFeed(feed, id, url, urlType);
+                    } else {
+                        response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+                                FeedConstants.WRONG_FEED_SHOW_TYPE + what);
+                        return;
+                    }
+                } catch (ModuleException e) {
+                    response.sendError(
+                            HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e
+                                    .getMessage());
+                    return;
+                }
+
+            } catch (TransactionException e) {
+                System.out.println("JTA problem...");
+            } finally {
+                try {
+                    Transactions.applyAfter(Transactions.TYPE_REQUIRED, tm,
+                            oldTx);
+
+                } catch (TransactionException e) {
+                    // log.error("", e);
+                }
+            }
+            response.setContentType("text/xml");
+
+            Writer writer = response.getWriter();
+
+            SyndFeedOutput output = new SyndFeedOutput();
+            output.output(feed, writer);
+
+            writer.flush();
+
+        } catch (Exception e) {
+            throw new ServletException(e);
+        }
+
+    }
+
+    private void createGlobalFeed(SyndFeed feed, Integer id, String url , String urlType)
+            throws ModuleException {
+        feed.setTitle("JBoss Forums Global Feed");
+        feed.setLink(globalLink(url,urlType));
+        feed.setDescription("Messages posted in JBoss Forums");
+
+        List entries = new ArrayList();
+
+        List posts = forumsModule.findPostsDesc(FeedConstants.POST_LIMIT);
+
+        for (int i = 0; i < posts.size(); i++) {
+            entries.add(getEntry((Post) posts.get(i),url,urlType));
+        }
+
+        feed.setEntries(entries);
+    }
+
+    private void createForumFeed(SyndFeed feed, Integer id, String url , String urlType)
+            throws ModuleException {
+
+        Forum forum = forumsModule.findForumById(id);
+
+        feed.setTitle("JBoss Forums Forum Feed: " + forum.getName());
+        feed.setLink(forumLink(id.toString(),url,urlType));
+        feed.setDescription("Messages posted in forum " + forum.getName()
+                + " in category " + forum.getCategory().getTitle());
+
+        List entries = new ArrayList();
+
+        List posts = forumsModule.findPostsFromForumDesc(forum, FeedConstants.POST_LIMIT);
+
+        for (int i = 0; i < posts.size(); i++) {
+            entries.add(getEntry((Post) posts.get(i),url,urlType));
+        }
+
+        feed.setEntries(entries);
+
+    }
+
+    private void createTopicFeed(SyndFeed feed, Integer id, String url , String urlType)
+            throws ModuleException {
+
+        Topic topic = forumsModule.findTopicById(id);
+
+        feed.setTitle("JBoss Forums Topic Feed: " + topic.getSubject());
+        feed.setLink(topicLink(id.toString(),url,urlType));
+        feed.setDescription("Messages posted in topic " + topic.getSubject()
+                + " in forum " + topic.getForum().getName() + " in category "
+                + topic.getForum().getCategory().getTitle());
+
+        List entries = new ArrayList();
+
+        List posts = topic.getPosts();
+
+        for (int i = 0; i < posts.size(); i++) {
+            entries.add(getEntry((Post) posts.get(i),url,urlType));
+        }
+
+        feed.setEntries(entries);
+
+    }
+
+    private boolean setFeedType(SyndFeed feed, String type) {
+        if (type.equals(FeedConstants.RSS)) {
+            feed.setFeedType("rss_2.0");
+        } else if (type.equals(FeedConstants.ATOM)) {
+            feed.setFeedType("atom_0.3");
+        } else {
+            return false;
+        }
+        return true;
+    }
+
+    private void createCategoryFeed(SyndFeed feed, Integer id, String url , String urlType)
+            throws ModuleException {
+
+        Category category = forumsModule.findCategoryById(id);
+
+        feed.setTitle("JBoss Forums Category Feed: " + category.getTitle());
+        feed.setLink(categoryLink(id.toString(),url,urlType));
+        feed.setDescription("Messages posted in category "
+                + category.getTitle());
+
+        List entries = new ArrayList();
+
+        List posts = forumsModule.findPostsFromCategoryDesc(category,
+                FeedConstants.POST_LIMIT);
+
+        for (int i = 0; i < posts.size(); i++) {
+            entries.add(getEntry((Post) posts.get(i),url,urlType));
+        }
+
+        feed.setEntries(entries);
+
+    }
+
+    private SyndEntry getEntry(Post post, String url , String urlType) {
+        SyndEntry entry;
+        SyndContent description;
+
+        entry = new SyndEntryImpl();
+        entry.setTitle(post.getMessage().getSubject() + " by "
+                + post.getPoster().getUser().getUserName());
+        entry.setLink(postLink(post.getId().toString(),url,urlType));
+        entry.setPublishedDate(post.getCreateDate());
+        description = new SyndContentImpl();
+        description.setType("text/html");
+        
+        String text = post.getMessage()
+        .getText();
+        description.setValue(post.getMessage().getHTMLEnabled() ? 
+        		StringEscapeUtils.escapeHtml(text) : text);
+        entry.setDescription(description);
+
+        return entry;
+    }
+    
+    private String postLink(String id, String url , String urlType)
+    {
+        String viewUrl = ForumsJSFPortlet.getNameForId("t");
+        String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+        return completeUrl + Constants.p_postId + "=" + id + "#"+ id;
+    }
+    
+    private String topicLink(String id, String url , String urlType)
+    {
+        String viewUrl = ForumsJSFPortlet.getNameForId("t");
+        String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+        return completeUrl + Constants.p_topicId + "=" + id;
+    }
+    
+    private String forumLink(String id, String url , String urlType)
+    {
+        String viewUrl = ForumsJSFPortlet.getNameForId("f");
+        String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+        return completeUrl + Constants.p_forumId + "=" + id;
+    }
+    
+    private String categoryLink(String id, String url , String urlType)
+    {
+        return globalLink(url,urlType) + Constants.p_categoryId + "=" + id;
+    }
+    
+    private String globalLink( String url , String urlType)
+    {
+        String viewUrl = ForumsJSFPortlet.getNameForId("c");
+        return buildCompleteUrl(url,urlType,viewUrl);
+    }
+    
+    private String buildCompleteUrl(String url, String urlType, String viewUrl)
+    {
+        if (urlType.compareTo("p")==0)
+        {
+            try
+            {
+                url += "&"
+                    + ForumsJSFPortlet.VIEW
+                    + "="
+                    + URLEncoder.encode(ForumsJSFPortlet.getIdForName(viewUrl), "UTF-8")
+                    + "&";
+            }
+            catch (UnsupportedEncodingException e)
+            {
+                e.printStackTrace();
+            }
+        }
+        else
+        {
+            url += viewUrl + "?";
+        }
+        
+        return url;
+    }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/AbstractParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/AbstractParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/AbstractParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+
+/**
+ * This is an abstract parser. All the parsed events will go though the event notifier interface.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class AbstractParser implements ParseEventNotifier
+{
+
+   /** The event handler. */
+   protected ParseEventHandler handler;
+
+   /** Set the event handler on this parser. */
+   public void setHandler(ParseEventHandler handler)
+   {
+      this.handler = handler;
+   }
+
+   /** Ask the parser to its job. */
+   public abstract void parse(char[] chars, int offset, int length);
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/AbstractParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEvent.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEvent.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEvent.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,28 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+/** An event that is emmited by ParseEventNotifier implementations. */
+public interface ParseEvent
+{
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEvent.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventHandler.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventHandler.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventHandler.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,30 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+
+/** Implementors want to receive events produced by a parser. */
+public interface ParseEventHandler
+{
+   void handle(ParseEvent event);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventHandler.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventNotifier.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventNotifier.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventNotifier.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,30 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+
+/** Implemented by any class that wants to generate parsing events. */
+public interface ParseEventNotifier
+{
+   void setHandler(ParseEventHandler handler);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/ParseEventNotifier.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/TextEvent.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/TextEvent.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/TextEvent.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+
+/** An event implementation that says there is some text to handle. */
+public class TextEvent implements ParseEvent
+{
+
+   protected char[] chars = null;
+   protected int offset = -1;
+   protected int length = -1;
+
+   public void setText(char[] chars, int offset, int length)
+   {
+      this.chars = chars;
+      this.offset = offset;
+      this.length = length;
+   }
+
+   public char[] chars()
+   {
+      return chars;
+   }
+
+   public int offset()
+   {
+      return offset;
+   }
+
+   public int length()
+   {
+      return length;
+   }
+
+   public String toString()
+   {
+      return "text:" + new String(chars, offset, length);
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/TextEvent.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/Token.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/Token.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/Token.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class Token
+{
+   public int type = -1;
+   public String value = null;
+
+   public String toString()
+   {
+      return type + " " + value;
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/Token.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.bbcode;
+
+import java.io.CharArrayReader;
+import org.jboss.portlet.forums.format.parser.Token;;
+
+%%
+
+%unicode
+%public
+%class Analyzer
+%type Token
+
+%{
+
+public static final int OPEN_B = 0;
+public static final int CLOSE_B = 1;
+public static final int OPEN_I = 2;
+public static final int CLOSE_I = 3;
+public static final int OPEN_U = 4;
+public static final int CLOSE_U = 5;
+public static final int OPEN_COLOR = 6;
+public static final int CLOSE_COLOR = 7;
+public static final int OPEN_SIZE = 8;
+public static final int CLOSE_SIZE = 9;
+public static final int OPEN_QUOTE_ANONYMOUS = 10;
+public static final int OPEN_QUOTE = 11;
+public static final int CLOSE_QUOTE = 12;
+public static final int OPEN_CODE = 13;
+public static final int CLOSE_CODE = 14;
+public static final int OPEN_LIST_UNORDERED = 15;
+public static final int OPEN_LIST_ORDERED_NUMERICAL = 16;
+public static final int OPEN_LIST_ORDERED_ALPHABETICAL = 17;
+public static final int CLOSE_LIST = 18;
+public static final int LIST_ITEM = 19;
+public static final int LINK = 20;
+public static final int TEXT = 21;
+public static final int IMAGE = 22;
+
+private static final int FROM_1 = "[url".length();
+private static final int FROM_2 = "[url=".length();
+private static final int DELTA = "[/url]".length();
+
+public void reset(char[] chars, int off, int len)
+{
+   yyreset(new CharArrayReader(chars, off, len));
+}
+
+public Token next()
+{
+   try { return yylex(); }
+   catch(java.io.IOException e) { e.printStackTrace(); return null; }
+}
+
+private Token token = new Token();
+
+private Token token(int type, String value)
+{
+   token.type = type;
+   token.value = value;
+   return token;
+}
+
+%}
+
+%%
+
+<YYINITIAL>
+{
+   "[b]" { return token(OPEN_B, null); }
+   "[/b]" { return token(CLOSE_B, null); }
+   "[i]" { return token(OPEN_I, null); }
+   "[/i]" { return token(CLOSE_I, null); }
+   "[u]" { return token(OPEN_U, null); }
+   "[/u]" { return token(CLOSE_U, null); }
+   "[color="(([A-Za-z]+)|("#"[0-9A-Fa-f]{6}))"]" { return token(OPEN_COLOR, yytext().substring(7, yytext().length() - 1)); }
+   "[/color]" { return token(CLOSE_COLOR, null); }
+   "[size="[0-9]{1,2}"]" { return token(OPEN_SIZE, yytext().substring(6, yytext().length() - 1)); }
+   "[/size]" { return token(CLOSE_SIZE, null); }
+   "[quote]" { return token(OPEN_QUOTE_ANONYMOUS, null); }
+   "[quote="~["]"] { return token(OPEN_QUOTE, yytext().substring(7, yytext().length() - 1)); }
+   "[/quote]" { return token(CLOSE_QUOTE, null); }
+   "[code]" { return token(OPEN_CODE, null); }
+   "[/code]" { return token(CLOSE_CODE, null); }
+   "[list]" { return token(OPEN_LIST_UNORDERED, null); }
+   "[list=1]" { return token(OPEN_LIST_ORDERED_NUMERICAL, null); }
+   "[list=a]" { return token(OPEN_LIST_ORDERED_ALPHABETICAL, null); }
+   "[/list]" { return token(CLOSE_LIST, null); }
+   "[*]" { return token(LIST_ITEM, null); }
+   "[url"~["]"]~["["]"/url]" { return token(LINK, yytext().substring(4, yytext().length() - 6)); }
+   "[img"~["]"]~["["]"/img]" { return token(IMAGE, yytext().substring(5, yytext().length() - 6)); }
+   .|\n { return token(TEXT, yytext()); }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,733 @@
+/* The following code was generated by JFlex 1.4.1 on 25.11.07 19:07 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.bbcode;
+
+import java.io.CharArrayReader;
+import org.jboss.portlet.forums.format.parser.Token;;
+
+
+/**
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
+ * on 25.11.07 19:07 from the specification file
+ * <tt>/Users/rysiek/Work/forums101P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex</tt>
+ */
+public class Analyzer {
+
+  /** This character denotes the end of file */
+  public static final int YYEOF = -1;
+
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
+
+  /** lexical states */
+  public static final int YYINITIAL = 0;
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\12\0\1\0\30\0\1\15\6\0\1\30\4\0\1\4\1\16\1\26"+
+    "\10\16\3\0\1\13\3\0\6\17\24\14\1\1\1\0\1\3\3\0"+
+    "\1\27\1\2\1\7\1\25\1\22\1\17\1\32\1\14\1\5\2\14"+
+    "\1\11\1\31\1\14\1\10\1\14\1\23\1\12\1\20\1\24\1\6"+
+    "\4\14\1\21\uff85\0";
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
+
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\1\0\2\1\11\0\1\2\7\0\1\3\1\0\1\4"+
+    "\5\0\1\5\1\6\1\7\1\10\37\0\1\11\1\12"+
+    "\4\0\1\13\1\14\1\15\7\0\1\16\1\0\1\17"+
+    "\1\20\4\0\1\21\1\22\1\23\1\0\1\24\2\0"+
+    "\1\25\4\0\1\26\1\27\4\0";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[105];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
+
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\33\0\66\0\121\0\154\0\207\0\242\0\275"+
+    "\0\330\0\363\0\u010e\0\u0129\0\33\0\u0144\0\u015f\0\u017a"+
+    "\0\u0195\0\u01b0\0\u01cb\0\u01e6\0\33\0\u0201\0\33\0\u021c"+
+    "\0\u0237\0\u0252\0\u026d\0\u0288\0\33\0\33\0\33\0\33"+
+    "\0\u02a3\0\u02be\0\u02d9\0\u02f4\0\u030f\0\u032a\0\u0345\0\u0360"+
+    "\0\u037b\0\u0396\0\u03b1\0\u03cc\0\u03e7\0\u0402\0\u041d\0\u0438"+
+    "\0\u0453\0\u046e\0\u0489\0\u04a4\0\u04bf\0\u04da\0\u04f5\0\u0510"+
+    "\0\u052b\0\u0546\0\u0561\0\u057c\0\u0597\0\u05b2\0\u05cd\0\33"+
+    "\0\33\0\u05e8\0\u0603\0\u061e\0\u0639\0\33\0\33\0\33"+
+    "\0\u0654\0\u066f\0\u068a\0\u06a5\0\u06c0\0\u06db\0\u06f6\0\33"+
+    "\0\u0711\0\33\0\33\0\u072c\0\u0747\0\u0762\0\u077d\0\33"+
+    "\0\33\0\33\0\u0798\0\33\0\u07b3\0\u07ce\0\33\0\u07e9"+
+    "\0\u0804\0\u081f\0\u083a\0\33\0\33\0\u0855\0\u0870\0\u088b"+
+    "\0\u08a6";
+
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[105];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
+
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
+
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\1\2\1\3\31\2\35\0\1\4\1\0\1\5\1\6"+
+    "\1\7\1\10\1\0\1\11\6\0\1\12\2\0\1\13"+
+    "\4\0\1\14\5\0\1\15\31\0\1\16\2\0\1\17"+
+    "\1\20\1\21\1\0\1\22\6\0\1\23\2\0\1\24"+
+    "\12\0\1\25\25\0\1\26\4\0\1\27\6\0\1\30"+
+    "\30\0\1\31\27\0\1\32\32\0\1\33\33\0\1\34"+
+    "\27\0\1\35\32\0\1\36\32\0\1\37\32\0\1\40"+
+    "\37\0\1\41\27\0\1\42\32\0\1\43\33\0\1\44"+
+    "\56\0\1\45\11\0\1\46\32\0\1\47\13\0\1\50"+
+    "\25\0\1\51\33\0\1\52\21\0\1\53\33\0\1\54"+
+    "\13\0\1\55\25\0\1\56\33\0\1\57\21\0\1\60"+
+    "\22\0\3\45\1\61\27\45\3\46\1\62\27\46\10\0"+
+    "\1\63\44\0\1\64\34\0\1\65\30\0\1\66\34\0"+
+    "\1\67\16\0\1\70\44\0\1\71\34\0\1\72\30\0"+
+    "\1\73\34\0\1\74\6\0\1\61\1\75\31\61\1\62"+
+    "\1\76\31\62\12\0\1\77\23\0\1\100\32\0\1\101"+
+    "\7\0\1\102\32\0\1\103\41\0\1\104\22\0\1\105"+
+    "\23\0\1\106\32\0\1\107\32\0\1\110\51\0\1\111"+
+    "\14\0\1\112\32\0\1\113\41\0\1\114\45\0\1\115"+
+    "\1\116\21\0\1\117\7\0\1\117\7\0\1\120\7\0"+
+    "\1\121\22\0\1\122\32\0\1\123\34\0\1\124\33\0"+
+    "\1\125\26\0\1\126\2\0\6\126\1\0\1\126\1\127"+
+    "\1\0\7\126\1\0\1\126\1\0\2\126\3\0\1\130"+
+    "\32\0\1\131\32\0\1\132\12\0\1\133\7\0\1\133"+
+    "\4\0\3\121\1\134\27\121\31\0\1\135\13\0\1\136"+
+    "\22\0\1\126\1\137\1\0\6\126\1\0\1\126\2\0"+
+    "\7\126\1\0\1\126\1\0\2\126\2\0\1\140\4\0"+
+    "\1\140\6\0\2\140\2\0\1\140\2\0\3\140\6\0"+
+    "\1\132\61\0\1\141\11\0\1\142\23\0\1\143\4\0"+
+    "\1\143\6\0\2\143\2\0\1\143\2\0\3\143\6\0"+
+    "\1\144\32\0\1\145\31\0\1\146\4\0\1\146\6\0"+
+    "\2\146\2\0\1\146\2\0\3\146\5\0\1\147\4\0"+
+    "\1\147\6\0\2\147\2\0\1\147\2\0\3\147\5\0"+
+    "\1\150\4\0\1\150\6\0\2\150\2\0\1\150\2\0"+
+    "\3\150\5\0\1\151\4\0\1\151\6\0\2\151\2\0"+
+    "\1\151\2\0\3\151\6\0\1\137\27\0";
+
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[2241];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
+
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
+
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\1\0\1\11\1\1\11\0\1\11\7\0\1\11\1\0"+
+    "\1\11\5\0\4\11\37\0\2\11\4\0\3\11\7\0"+
+    "\1\11\1\0\2\11\4\0\3\11\1\0\1\11\2\0"+
+    "\1\11\4\0\2\11\4\0";
+
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[105];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+  /** the input device */
+  private java.io.Reader zzReader;
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the textposition at the last state to be included in yytext */
+  private int zzPushbackPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /** number of newlines encountered up to the start of the matched text */
+  private int yyline;
+
+  /** the number of characters up to the start of the matched text */
+  private int yychar;
+
+  /**
+   * the number of characters from the last newline up to the start of the 
+   * matched text
+   */
+  private int yycolumn;
+
+  /** 
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /* user code: */
+
+public static final int OPEN_B = 0;
+public static final int CLOSE_B = 1;
+public static final int OPEN_I = 2;
+public static final int CLOSE_I = 3;
+public static final int OPEN_U = 4;
+public static final int CLOSE_U = 5;
+public static final int OPEN_COLOR = 6;
+public static final int CLOSE_COLOR = 7;
+public static final int OPEN_SIZE = 8;
+public static final int CLOSE_SIZE = 9;
+public static final int OPEN_QUOTE_ANONYMOUS = 10;
+public static final int OPEN_QUOTE = 11;
+public static final int CLOSE_QUOTE = 12;
+public static final int OPEN_CODE = 13;
+public static final int CLOSE_CODE = 14;
+public static final int OPEN_LIST_UNORDERED = 15;
+public static final int OPEN_LIST_ORDERED_NUMERICAL = 16;
+public static final int OPEN_LIST_ORDERED_ALPHABETICAL = 17;
+public static final int CLOSE_LIST = 18;
+public static final int LIST_ITEM = 19;
+public static final int LINK = 20;
+public static final int TEXT = 21;
+public static final int IMAGE = 22;
+
+private static final int FROM_1 = "[url".length();
+private static final int FROM_2 = "[url=".length();
+private static final int DELTA = "[/url]".length();
+
+public void reset(char[] chars, int off, int len)
+{
+   yyreset(new CharArrayReader(chars, off, len));
+}
+
+public Token next()
+{
+   try { return yylex(); }
+   catch(java.io.IOException e) { e.printStackTrace(); return null; }
+}
+
+private Token token = new Token();
+
+private Token token(int type, String value)
+{
+   token.type = type;
+   token.value = value;
+   return token;
+}
+
+
+
+  /**
+   * Creates a new scanner
+   * There is also a java.io.InputStream version of this constructor.
+   *
+   * @param   in  the java.io.Reader to read input from.
+   */
+  public Analyzer(java.io.Reader in) {
+    this.zzReader = in;
+  }
+
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public Analyzer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
+
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 86) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
+
+
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   * 
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+
+    /* first: make room (if you can) */
+    if (zzStartRead > 0) {
+      System.arraycopy(zzBuffer, zzStartRead,
+                       zzBuffer, 0,
+                       zzEndRead-zzStartRead);
+
+      /* translate stored positions */
+      zzEndRead-= zzStartRead;
+      zzCurrentPos-= zzStartRead;
+      zzMarkedPos-= zzStartRead;
+      zzPushbackPos-= zzStartRead;
+      zzStartRead = 0;
+    }
+
+    /* is the buffer big enough? */
+    if (zzCurrentPos >= zzBuffer.length) {
+      /* if not: blow it up */
+      char newBuffer[] = new char[zzCurrentPos*2];
+      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
+      zzBuffer = newBuffer;
+    }
+
+    /* finally: fill the buffer with new input */
+    int numRead = zzReader.read(zzBuffer, zzEndRead,
+                                            zzBuffer.length-zzEndRead);
+
+    if (numRead < 0) {
+      return true;
+    }
+    else {
+      zzEndRead+= numRead;
+      return false;
+    }
+  }
+
+    
+  /**
+   * Closes the input stream.
+   */
+  public final void yyclose() throws java.io.IOException {
+    zzAtEOF = true;            /* indicate end of file */
+    zzEndRead = zzStartRead;  /* invalidate buffer    */
+
+    if (zzReader != null)
+      zzReader.close();
+  }
+
+
+  /**
+   * Resets the scanner to read from a new input stream.
+   * Does not close the old reader.
+   *
+   * All internal variables are reset, the old input stream 
+   * <b>cannot</b> be reused (internal buffer is discarded and lost).
+   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
+   *
+   * @param reader   the new input stream 
+   */
+  public final void yyreset(java.io.Reader reader) {
+    zzReader = reader;
+    zzAtBOL  = true;
+    zzAtEOF  = false;
+    zzEndRead = zzStartRead = 0;
+    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
+    yyline = yychar = yycolumn = 0;
+    zzLexicalState = YYINITIAL;
+  }
+
+
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
+
+
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
+
+
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final String yytext() {
+    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
+  }
+
+
+  /**
+   * Returns the character at position <tt>pos</tt> from the 
+   * matched text. 
+   * 
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch. 
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBuffer[zzStartRead+pos];
+  }
+
+
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
+
+
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of 
+   * yypushback(int) and a match-all fallback rule) this method 
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
+
+    throw new Error(message);
+  } 
+
+
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
+
+    zzMarkedPos -= number;
+  }
+
+
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public Token yylex() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
+
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    char [] zzBufferL = zzBuffer;
+    char [] zzCMapL = ZZ_CMAP;
+
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
+
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
+
+      zzAction = -1;
+
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+  
+      zzState = zzLexicalState;
+
+
+      zzForAction: {
+        while (true) {
+    
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferL[zzCurrentPosL++];
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferL[zzCurrentPosL++];
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
+
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
+
+        }
+      }
+
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
+
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 1: 
+          { return token(TEXT, yytext());
+          }
+        case 24: break;
+        case 16: 
+          { return token(CLOSE_QUOTE, null);
+          }
+        case 25: break;
+        case 10: 
+          { return token(OPEN_LIST_UNORDERED, null);
+          }
+        case 26: break;
+        case 18: 
+          { return token(OPEN_LIST_ORDERED_ALPHABETICAL, null);
+          }
+        case 27: break;
+        case 22: 
+          { return token(IMAGE, yytext().substring(5, yytext().length() - 6));
+          }
+        case 28: break;
+        case 11: 
+          { return token(CLOSE_CODE, null);
+          }
+        case 29: break;
+        case 4: 
+          { return token(OPEN_U, null);
+          }
+        case 30: break;
+        case 7: 
+          { return token(CLOSE_I, null);
+          }
+        case 31: break;
+        case 14: 
+          { return token(OPEN_QUOTE_ANONYMOUS, null);
+          }
+        case 32: break;
+        case 12: 
+          { return token(CLOSE_LIST, null);
+          }
+        case 33: break;
+        case 3: 
+          { return token(OPEN_I, null);
+          }
+        case 34: break;
+        case 20: 
+          { return token(OPEN_QUOTE, yytext().substring(7, yytext().length() - 1));
+          }
+        case 35: break;
+        case 19: 
+          { return token(OPEN_SIZE, yytext().substring(6, yytext().length() - 1));
+          }
+        case 36: break;
+        case 2: 
+          { return token(OPEN_B, null);
+          }
+        case 37: break;
+        case 21: 
+          { return token(OPEN_COLOR, yytext().substring(7, yytext().length() - 1));
+          }
+        case 38: break;
+        case 8: 
+          { return token(CLOSE_U, null);
+          }
+        case 39: break;
+        case 23: 
+          { return token(LINK, yytext().substring(4, yytext().length() - 6));
+          }
+        case 40: break;
+        case 15: 
+          { return token(CLOSE_COLOR, null);
+          }
+        case 41: break;
+        case 13: 
+          { return token(CLOSE_SIZE, null);
+          }
+        case 42: break;
+        case 17: 
+          { return token(OPEN_LIST_ORDERED_NUMERICAL, null);
+          }
+        case 43: break;
+        case 5: 
+          { return token(LIST_ITEM, null);
+          }
+        case 44: break;
+        case 9: 
+          { return token(OPEN_CODE, null);
+          }
+        case 45: break;
+        case 6: 
+          { return token(CLOSE_B, null);
+          }
+        case 46: break;
+        default: 
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            return null;
+          } 
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
+
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,348 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.bbcode;
+
+import org.jboss.portlet.forums.format.parser.AbstractParser;
+import org.jboss.portlet.forums.format.parser.ParseEvent;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+import org.jboss.portlet.forums.format.parser.Token;
+import org.jboss.portlet.forums.format.parser.chars.MutableChars;
+import org.jboss.portlet.forums.format.util.Stack;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Iterator;
+
+/**
+ * This nasty class parse BB code and create events.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class BBCodeParser
+   extends AbstractParser
+{
+
+   // Public constants
+
+   public static final int EVENT_NORMAL = 0;
+   public static final int EVENT_BOLD = 1;
+   public static final int EVENT_ITALIC = 2;
+   public static final int EVENT_UNDERLINE = 3;
+   public static final int EVENT_COLOR = 4;
+   public static final int EVENT_SIZE = 5;
+   public static final int EVENT_QUOTE = 6;
+   public static final int EVENT_CODE = 7;
+   public static final int EVENT_ITEM = 8;
+   public static final int EVENT_LINK = 9;
+   public static final int EVENT_UNORDERED_LIST = 10;
+   public static final int EVENT_ALPHABETICALLY_ORDERED_LIST = 11;
+   public static final int EVENT_NUMERICALLY_ORDERED_LIST = 12;
+   public static final int EVENT_IMAGE = 13;
+
+   public static final String BUNDLE_KEY_CODE = "Message_code";
+   public static final String BUNDLE_KEY_QUOTE = "Message_quote";
+   public static final String BUNDLE_KEY_WROTE = "Message_wrote";
+
+   // The parser state
+
+   public static final Reader NULL_READER = new Reader()
+   {
+      public int read(char cbuf[], int off, int len) throws IOException
+      {
+         return 0;
+      }
+
+      public void close() throws IOException
+      {
+      }
+   };
+
+   private Analyzer analyzer = new Analyzer(BBCodeParser.NULL_READER);
+   private CodeKey myKey = new CodeKey();
+   private MutableChars buffer = new MutableChars();
+   private TextEvent textEvent = new TextEvent();
+   private OpenEvent openEvent = new OpenEvent();
+
+   private Stack stack = new Stack(10)
+   {
+      protected Stack.Key createKey()
+      {
+         return new CloseEvent();
+      }
+
+      protected boolean equals(Stack.Key key1, Stack.Key key2)
+      {
+         return ((CodeKey)key1).getType() == ((CodeKey)key2).getType();
+      }
+   };
+
+   public BBCodeParser()
+   {
+   }
+
+   public void parse(char[] chars, int offset, int length)
+   {
+      // First we initialize the parser state
+      stack.reset();
+      analyzer.reset(chars, offset, length);
+      buffer.reset();
+
+      // First
+      _start(EVENT_NORMAL, null);
+
+      // Enter the switch loop
+      while (true)
+      {
+         // Get the next token
+         Token t = analyzer.next();
+
+         if (t == null)
+         {
+            // No more tokens to read
+            break;
+         }
+
+         // According to the token we fire the approriate events
+         switch (t.type)
+         {
+            case Analyzer.OPEN_B:
+               _start(EVENT_BOLD, null);
+               break;
+            case Analyzer.CLOSE_B:
+               _end(EVENT_BOLD);
+               break;
+
+            case Analyzer.OPEN_I:
+               _start(EVENT_ITALIC, null);
+               break;
+            case Analyzer.CLOSE_I:
+               _end(EVENT_ITALIC);
+               break;
+
+            case Analyzer.OPEN_U:
+               _start(EVENT_UNDERLINE, null);
+               break;
+            case Analyzer.CLOSE_U:
+               _end(EVENT_UNDERLINE);
+               break;
+
+            case Analyzer.OPEN_COLOR:
+               _start(EVENT_COLOR, t.value);
+               break;
+            case Analyzer.CLOSE_COLOR:
+               _end(EVENT_COLOR);
+               break;
+
+            case Analyzer.OPEN_SIZE:
+               _start(EVENT_SIZE, t.value);
+               break;
+            case Analyzer.CLOSE_SIZE:
+               _end(EVENT_SIZE);
+               break;
+
+            case Analyzer.OPEN_QUOTE_ANONYMOUS:
+               _start(EVENT_QUOTE, null);
+               break;
+            case Analyzer.OPEN_QUOTE:
+               _start(EVENT_QUOTE, t.value);
+               break;
+            case Analyzer.CLOSE_QUOTE:
+               _end(EVENT_QUOTE);
+               break;
+
+            case Analyzer.OPEN_CODE:
+               _start(EVENT_CODE, null);
+               break;
+            case Analyzer.CLOSE_CODE:
+               _end(EVENT_CODE);
+               break;
+
+            case Analyzer.IMAGE:
+                _start(EVENT_IMAGE, t.value);
+                _end(EVENT_IMAGE);
+                break;
+               
+            case Analyzer.OPEN_LIST_UNORDERED:
+               _start(EVENT_UNORDERED_LIST, null);
+               break;
+            case Analyzer.OPEN_LIST_ORDERED_NUMERICAL:
+               _start(EVENT_NUMERICALLY_ORDERED_LIST, null);
+               break;
+            case Analyzer.OPEN_LIST_ORDERED_ALPHABETICAL:
+               _start(EVENT_ALPHABETICALLY_ORDERED_LIST, null);
+               break;
+
+            case Analyzer.CLOSE_LIST:
+               // If we match a list token on the stack at
+               // level -1 (because of the list item that should
+               // be pushed on the stack) we close
+               CodeKey tmp = (CodeKey)stack.peek(0);
+               if (tmp != null)
+               {
+                  int type = tmp.type;
+                  if (type == EVENT_UNORDERED_LIST ||
+                     type == EVENT_NUMERICALLY_ORDERED_LIST ||
+                     type == EVENT_ALPHABETICALLY_ORDERED_LIST)
+                  {
+                     _end(type);
+                  }
+               }
+               break;
+
+            case Analyzer.LIST_ITEM:
+               // If we have a sibling item close it
+               CodeKey tmp2 = (CodeKey)stack.peek(0);
+               if (tmp2 != null && tmp2.type == EVENT_ITEM)
+               {
+                  _end(EVENT_ITEM);
+               }
+               _start(EVENT_ITEM, null);
+               break;
+
+            case Analyzer.LINK:
+               int bracket = t.value.indexOf(']');
+               if (bracket > 0)
+               {
+                  boolean hasEquals = t.value.charAt(0) == '=';
+                  if (hasEquals)
+                  {
+                     // todo add support for the link value which is not used yet
+                     String url = t.value.substring(1, bracket);
+                     String name = t.value.substring(bracket + 1);
+                     _start(EVENT_LINK, url , name );
+                     _end(EVENT_LINK);
+                  }
+               }
+               else
+               {
+                  _start(EVENT_LINK, t.value.substring(1));
+                  _end(EVENT_LINK);
+               }
+               break;
+
+            case Analyzer.TEXT:
+               buffer.append(t.value.charAt(0));
+               break;
+
+            default:
+               throw new IllegalStateException("This should not be possible");
+         }
+      }
+
+      // Last
+      _end(EVENT_NORMAL);
+   }
+
+   private void _text()
+   {
+      if (buffer.length() > 0)
+      {
+         textEvent.setText(buffer.chars(), 0, buffer.length());
+         buffer.reset();
+         handler.handle(textEvent);
+      }
+   }
+
+   private void _start(int type, String string)
+   {
+      _text();
+      CloseEvent closeEvent = (CloseEvent)stack.push();
+      openEvent.type = closeEvent.type = type;
+      openEvent.string = string;
+      openEvent.string2 = null;
+      handler.handle(openEvent);
+   }
+   
+   private void _start(int type, String string1 , String string2 )
+   {
+       _text();
+       CloseEvent closeEvent = (CloseEvent)stack.push();
+       openEvent.type = closeEvent.type = type;
+       openEvent.string = string1;
+       openEvent.string2= string2;
+       handler.handle(openEvent); 
+   }
+
+   private void _end(int type)
+   {
+      myKey.type = type;
+      Iterator i = stack.pop(myKey);
+      if (i.hasNext())
+      {
+         _text();
+         do
+         {
+            handler.handle((CloseEvent)i.next());
+         }
+         while (i.hasNext());
+      }
+   }
+
+   private static class CodeKey implements Stack.Key
+   {
+      protected int type;
+      protected String string;
+      protected String string2;
+
+      public CodeKey()
+      {
+         type = -1;
+         string = null;
+         string2 = null;
+      }
+
+      public int getType()
+      {
+         return type;
+      }
+
+      public String getString()
+      {
+         return string;
+      }
+      
+      public String getString2()
+      {
+         return string2;
+      }
+   }
+
+   public static class OpenEvent extends CodeKey implements ParseEvent
+   {
+      public String toString()
+      {
+         return "open: " + type + " " + string;
+      }
+   }
+
+   public static class CloseEvent extends CodeKey implements ParseEvent
+   {
+      public String toString()
+      {
+         return "close: " + type + " " + string;
+      }
+   }
+}
+
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/Chars.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/Chars.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/Chars.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.chars;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+/**
+ * An ordered collection of char.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface Chars
+{
+   /** Append the chars to a Writer. */
+   void appendTo(Writer writer) throws IOException;
+
+   /** Get a Reader for the chars. */
+   Reader getReader();
+
+   /** Returns how many chars there are. */
+   int length();
+
+   /** Returns a String made of the chars. */
+   String toString();
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/Chars.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/MutableChars.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/MutableChars.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/MutableChars.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,154 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.chars;
+
+import java.io.CharArrayReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class MutableChars implements Chars
+{
+
+   protected int index;
+   protected char[] chars;
+   protected Writer writer;
+
+   public MutableChars(int length)
+   {
+      this(new char[length]);
+   }
+
+   public MutableChars()
+   {
+      this(20);
+   }
+
+   public MutableChars(char[] chars)
+   {
+      this.index = 0;
+      this.chars = chars;
+      this.writer = new MyWriter();
+   }
+
+   public MutableChars(String s)
+   {
+      this(s.toCharArray());
+   }
+
+   private void increase()
+   {
+      char[] temp = new char[1 + chars.length * 2];
+      System.arraycopy(chars, 0, temp, 0, chars.length);
+      chars = temp;
+   }
+
+   public MutableChars append(String s)
+   {
+      int mark = index;
+      index += s.length();
+      while (index > chars.length - 1)
+      {
+         increase();
+      }
+      s.getChars(0, s.length(), chars, mark);
+      return this;
+   }
+
+   public MutableChars append(char cbuf[], int off, int len)
+   {
+      int mark = index;
+      index += len;
+      while (index > chars.length - 1)
+      {
+         increase();
+      }
+      System.arraycopy(cbuf, off, chars, mark, len);
+      return this;
+   }
+
+   public MutableChars append(char c)
+   {
+      if (index > chars.length - 1) // ~ to index >= length
+      {
+         increase();
+      }
+      chars[index++] = c;
+      return this;
+   }
+
+   public void reset()
+   {
+      index = 0;
+   }
+
+   public void appendTo(Writer writer) throws IOException
+   {
+      writer.write(chars, 0, index);
+   }
+
+   public String toString()
+   {
+      return new String(chars, 0, index);
+   }
+
+   public Reader getReader()
+   {
+      return new CharArrayReader(chars, 0, index);
+   }
+
+   public int length()
+   {
+      return index;
+   }
+
+   public Writer getWriter()
+   {
+      return writer;
+   }
+
+   public char[] chars()
+   {
+      return chars;
+   }
+
+   public class MyWriter extends Writer
+   {
+      public void write(char cbuf[], int off, int len) throws IOException
+      {
+         MutableChars.this.append(cbuf, off, len);
+      }
+
+      public void flush() throws IOException
+      {
+      }
+
+      public void close() throws IOException
+      {
+      }
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/chars/MutableChars.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/CharacterEntityReferenceEvent.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/CharacterEntityReferenceEvent.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/CharacterEntityReferenceEvent.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.entity;
+
+import org.jboss.portlet.forums.format.parser.TextEvent;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CharacterEntityReferenceEvent extends TextEvent
+{
+   public String toString()
+   {
+      return "charref:" + new String(chars, offset, length);
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/CharacterEntityReferenceEvent.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/HTML4_0CharacterEntityReferenceParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/HTML4_0CharacterEntityReferenceParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/HTML4_0CharacterEntityReferenceParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.entity;
+
+import org.jboss.portlet.forums.format.parser.AbstractParser;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+import org.jboss.portlet.forums.format.util.EntityTable;
+
+/**
+ * Convert chars that have an an HTML 4 character reference.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class HTML4_0CharacterEntityReferenceParser extends AbstractParser
+{
+
+   private final TextEvent textEvent = new TextEvent();
+   private final CharacterEntityReferenceEvent cere = new CharacterEntityReferenceEvent();
+   private final char[] buffer = new char[10];
+
+   public void parse(char[] chars, int startOffset, int length)
+   {
+      // Calculate the startOffset of the last chars to process
+      int endOffset = startOffset + length;
+      int previousOffset = startOffset;
+
+      // Iterates over all the chars
+      for (int currentOffset = startOffset; currentOffset < endOffset; currentOffset++)
+      {
+         char c = chars[currentOffset];
+         String result = EntityTable.FULL.lookup(c);
+         if (result != null)
+         {
+            if (currentOffset > previousOffset)
+            {
+               textEvent.setText(chars, previousOffset, currentOffset - previousOffset);
+               handler.handle(textEvent);
+            }
+
+            int size = result.length();
+            buffer[0] = '&';
+            result.getChars(0, size, buffer, 1);
+            buffer[size + 1] = ';';
+            cere.setText(buffer, 0, size + 2);
+            handler.handle(cere);
+            previousOffset = currentOffset + 1;
+         }
+      }
+
+      // Send the last chunck
+      if (endOffset > previousOffset)
+      {
+         textEvent.setText(chars, previousOffset, endOffset - previousOffset);
+         handler.handle(textEvent);
+      }
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/HTML4_0CharacterEntityReferenceParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/XML1_0CharacterEntityReferenceParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/XML1_0CharacterEntityReferenceParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/XML1_0CharacterEntityReferenceParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.entity;
+
+import org.jboss.portlet.forums.format.parser.AbstractParser;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Detect XML 1.0 character entity references.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class XML1_0CharacterEntityReferenceParser extends AbstractParser
+{
+
+   private final TextEvent textEvent = new TextEvent();
+   private final CharacterEntityReferenceEvent cere = new CharacterEntityReferenceEvent();
+
+   private static Pattern pattern = Pattern.compile("&#(?:(?:x[0-9a-fA-F]{1,4})|(?:[0-9]{1,5}));");
+
+   public void parse(char[] chars, int offset, int length)
+   {
+      CharSequence seq = new CharSequenceImpl(chars, offset, length);
+      Matcher matcher = pattern.matcher(seq);
+      int from = offset;
+      while (matcher.find())
+      {
+         int to = matcher.start();
+         textEvent.setText(chars, from, to - from);
+         handler.handle(textEvent);
+         from = matcher.end();
+         cere.setText(chars, to, from - to);
+         handler.handle(cere);
+      }
+      if (from < offset + length)
+      {
+         textEvent.setText(chars, from, offset + length - from);
+         handler.handle(textEvent);
+      }
+   }
+
+   private static class CharSequenceImpl implements CharSequence
+   {
+      private final char[] chars;
+      private final int offset;
+      private final int length;
+
+      public CharSequenceImpl(char[] chars, int offset, int length)
+      {
+         this.chars = chars;
+         this.offset = offset;
+         this.length = length;
+      }
+
+      public int length()
+      {
+         return length;
+      }
+
+      public char charAt(int index)
+      {
+         return chars[offset + index];
+      }
+
+      public CharSequence subSequence(int start, int end)
+      {
+         return new CharSequenceImpl(chars, start, end - start);
+      }
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/entity/XML1_0CharacterEntityReferenceParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.html;
+
+import java.io.CharArrayReader;
+import org.jboss.portlet.forums.format.parser.Token;
+
+%%
+
+%unicode
+%public
+%class Analyzer
+%type Token
+
+%{
+
+public static final int STAG = 0;
+public static final int ETAG = 1;
+public static final int EMPTY = 2;
+public static final int CDATA = 3;
+
+
+public void reset(char[] chars, int off, int len)
+{
+   yyreset(new CharArrayReader(chars, off, len));
+}
+
+public Token next()
+{
+   try { return yylex(); }
+   catch(java.io.IOException e) { e.printStackTrace(); return null; }
+}
+
+private Token token = new Token();
+
+private Token token(int type, String value)
+{
+   token.type = type;
+   token.value = value;
+   return token;
+}
+
+%}
+
+S = (" "|"\t"|"\r"|"\n")+
+Name = [A-Za-z]+
+Attribute = [A-Za-z]+(" "|"\t"|"\r"|"\n")*"="(" "|"\t"|"\r"|"\n")*[\"']~[\"']
+
+%%
+
+<YYINITIAL>
+{
+   "<"{Name}({S}{Attribute})*{S}?">" { return token(STAG, yytext()); }
+   "</"{Name}{S}?">" { return token(ETAG, yytext()); }
+   "<"{Name}({S}{Attribute})*{S}?"/>" { return token(EMPTY, yytext()); }
+   .|\n { return token(CDATA, yytext()); }
+}
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,588 @@
+/* The following code was generated by JFlex 1.4.1 on 25.11.07 03:07 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.html;
+
+import java.io.CharArrayReader;
+import org.jboss.portlet.forums.format.parser.Token;
+
+
+/**
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
+ * on 25.11.07 03:07 from the specification file
+ * <tt>/Users/rysiek/Work/forums101P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex</tt>
+ */
+public class Analyzer {
+
+  /** This character denotes the end of file */
+  public static final int YYEOF = -1;
+
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
+
+  /** lexical states */
+  public static final int YYINITIAL = 0;
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\11\0\1\1\1\1\2\0\1\1\22\0\1\1\1\0\1\4\4\0"+
+    "\1\4\7\0\1\7\14\0\1\5\1\3\1\6\2\0\32\2\6\0"+
+    "\32\2\uff85\0";
+
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
+
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\1\0\2\1\3\0\1\2\3\0\1\3\1\0\1\4"+
+    "\4\0";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[17];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
+
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\10\0\20\0\30\0\40\0\50\0\10\0\60"+
+    "\0\70\0\100\0\10\0\110\0\10\0\120\0\130\0\140"+
+    "\0\150";
+
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[17];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
+
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
+
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\5\2\1\3\2\2\12\0\1\4\4\0\1\5\1\0"+
+    "\1\6\1\4\3\0\1\7\1\10\2\0\1\11\6\0"+
+    "\1\6\1\12\3\0\1\7\1\10\6\0\1\13\2\0"+
+    "\1\14\1\11\3\0\1\15\2\0\1\16\1\12\1\17"+
+    "\5\0\1\14\4\0\1\15\2\0\1\16\1\0\1\17"+
+    "\5\0\1\17\2\0\1\20\3\0\4\20\1\21\3\20"+
+    "\1\0\1\6\4\0\1\7\1\10";
+
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[112];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
+
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
+
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\1\0\1\11\1\1\3\0\1\11\3\0\1\11\1\0"+
+    "\1\11\4\0";
+
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[17];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
+
+  /** the input device */
+  private java.io.Reader zzReader;
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the textposition at the last state to be included in yytext */
+  private int zzPushbackPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /** number of newlines encountered up to the start of the matched text */
+  private int yyline;
+
+  /** the number of characters up to the start of the matched text */
+  private int yychar;
+
+  /**
+   * the number of characters from the last newline up to the start of the 
+   * matched text
+   */
+  private int yycolumn;
+
+  /** 
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /* user code: */
+
+public static final int STAG = 0;
+public static final int ETAG = 1;
+public static final int EMPTY = 2;
+public static final int CDATA = 3;
+
+
+public void reset(char[] chars, int off, int len)
+{
+   yyreset(new CharArrayReader(chars, off, len));
+}
+
+public Token next()
+{
+   try { return yylex(); }
+   catch(java.io.IOException e) { e.printStackTrace(); return null; }
+}
+
+private Token token = new Token();
+
+private Token token(int type, String value)
+{
+   token.type = type;
+   token.value = value;
+   return token;
+}
+
+
+
+  /**
+   * Creates a new scanner
+   * There is also a java.io.InputStream version of this constructor.
+   *
+   * @param   in  the java.io.Reader to read input from.
+   */
+  public Analyzer(java.io.Reader in) {
+    this.zzReader = in;
+  }
+
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public Analyzer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
+
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 44) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
+
+
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   * 
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+
+    /* first: make room (if you can) */
+    if (zzStartRead > 0) {
+      System.arraycopy(zzBuffer, zzStartRead,
+                       zzBuffer, 0,
+                       zzEndRead-zzStartRead);
+
+      /* translate stored positions */
+      zzEndRead-= zzStartRead;
+      zzCurrentPos-= zzStartRead;
+      zzMarkedPos-= zzStartRead;
+      zzPushbackPos-= zzStartRead;
+      zzStartRead = 0;
+    }
+
+    /* is the buffer big enough? */
+    if (zzCurrentPos >= zzBuffer.length) {
+      /* if not: blow it up */
+      char newBuffer[] = new char[zzCurrentPos*2];
+      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
+      zzBuffer = newBuffer;
+    }
+
+    /* finally: fill the buffer with new input */
+    int numRead = zzReader.read(zzBuffer, zzEndRead,
+                                            zzBuffer.length-zzEndRead);
+
+    if (numRead < 0) {
+      return true;
+    }
+    else {
+      zzEndRead+= numRead;
+      return false;
+    }
+  }
+
+    
+  /**
+   * Closes the input stream.
+   */
+  public final void yyclose() throws java.io.IOException {
+    zzAtEOF = true;            /* indicate end of file */
+    zzEndRead = zzStartRead;  /* invalidate buffer    */
+
+    if (zzReader != null)
+      zzReader.close();
+  }
+
+
+  /**
+   * Resets the scanner to read from a new input stream.
+   * Does not close the old reader.
+   *
+   * All internal variables are reset, the old input stream 
+   * <b>cannot</b> be reused (internal buffer is discarded and lost).
+   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
+   *
+   * @param reader   the new input stream 
+   */
+  public final void yyreset(java.io.Reader reader) {
+    zzReader = reader;
+    zzAtBOL  = true;
+    zzAtEOF  = false;
+    zzEndRead = zzStartRead = 0;
+    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
+    yyline = yychar = yycolumn = 0;
+    zzLexicalState = YYINITIAL;
+  }
+
+
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
+
+
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
+
+
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final String yytext() {
+    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
+  }
+
+
+  /**
+   * Returns the character at position <tt>pos</tt> from the 
+   * matched text. 
+   * 
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch. 
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBuffer[zzStartRead+pos];
+  }
+
+
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
+
+
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of 
+   * yypushback(int) and a match-all fallback rule) this method 
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
+
+    throw new Error(message);
+  } 
+
+
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
+
+    zzMarkedPos -= number;
+  }
+
+
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public Token yylex() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
+
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    char [] zzBufferL = zzBuffer;
+    char [] zzCMapL = ZZ_CMAP;
+
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
+
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
+
+      zzAction = -1;
+
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+  
+      zzState = zzLexicalState;
+
+
+      zzForAction: {
+        while (true) {
+    
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferL[zzCurrentPosL++];
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferL[zzCurrentPosL++];
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
+
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
+
+        }
+      }
+
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
+
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 3: 
+          { return token(EMPTY, yytext());
+          }
+        case 5: break;
+        case 4: 
+          { return token(ETAG, yytext());
+          }
+        case 6: break;
+        case 2: 
+          { return token(STAG, yytext());
+          }
+        case 7: break;
+        case 1: 
+          { return token(CDATA, yytext());
+          }
+        case 8: break;
+        default: 
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            return null;
+          } 
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
+
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/TagParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/TagParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/TagParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,223 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.html;
+
+import org.jboss.portlet.forums.format.parser.AbstractParser;
+import org.jboss.portlet.forums.format.parser.ParseEvent;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+import org.jboss.portlet.forums.format.parser.Token;
+import org.jboss.portlet.forums.format.parser.bbcode.BBCodeParser;
+import org.jboss.portlet.forums.format.parser.chars.MutableChars;
+import org.jboss.portlet.forums.format.util.Stack;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class TagParser
+   extends AbstractParser
+{
+
+   public static final int EVENT_NORMAL = 0;
+   public static final int EVENT_TAG = 1;
+
+   private MutableChars buffer = new MutableChars();
+   private Analyzer analyzer = new Analyzer(BBCodeParser.NULL_READER);
+
+   private OpenEvent openEvent = new OpenEvent();
+   private TextEvent textEvent = new TextEvent();
+
+   private Stack stack = new Stack(10)
+   {
+      protected Stack.Key createKey()
+      {
+         return new CloseEvent();
+      }
+
+      protected boolean equals(Stack.Key o1, Stack.Key o2)
+      {
+         HTMLKey key1 = (HTMLKey)o1;
+         HTMLKey key2 = (HTMLKey)o2;
+         if (key1.getType() != key2.getType())
+         {
+            return false;
+         }
+         if (key1.getType() == 1)
+         {
+            return key1.getTag().equals(key2.getTag());
+         }
+         return false;
+      }
+   };
+
+   public TagParser()
+   {
+   }
+
+   private HTMLKey temporaryKey = new HTMLKey();
+
+   public void parse(char[] chars, int off, int len)
+   {
+
+      // Build the stream
+      stack.reset();
+      analyzer.reset(chars, off, len);
+      buffer.reset();
+
+      //
+      CloseEvent closeEvent = (CloseEvent)stack.push();
+      closeEvent.type = openEvent.type = EVENT_NORMAL;
+      closeEvent.tag = openEvent.tag = null;
+      openEvent.attributes = null;
+      handler.handle(openEvent);
+
+      while (true)
+      {
+         // Get the next token
+         Token t = analyzer.next();
+
+         if (t == null)
+         {
+            // No more token to read
+            break;
+         }
+
+         switch (t.type)
+         {
+            case Analyzer.STAG:
+            {
+               closeEvent = (CloseEvent)stack.push();
+               String tag = t.value;
+               int start = 1;
+               int end = tag.indexOf(' ', 1);
+               if (end == -1)
+               {
+                  openEvent.type = closeEvent.type = EVENT_TAG;
+                  openEvent.tag = closeEvent.tag = tag.substring(start, tag.length() - 1);
+                  openEvent.attributes = "";
+               }
+               else
+               {
+                  openEvent.type = closeEvent.type = EVENT_TAG;
+                  openEvent.tag = closeEvent.tag = tag.substring(start, end);
+                  openEvent.attributes = tag.substring(end, tag.length() - 1);
+               }
+               text();
+               handler.handle(openEvent);
+               break;
+            }
+            case Analyzer.ETAG:
+            {
+               temporaryKey.type = 1;
+               temporaryKey.tag = t.value.substring(2, t.value.length() - 1);
+               Iterator i = stack.pop(temporaryKey);
+               if (i.hasNext())
+               {
+                  text();
+                  do
+                  {
+                     handler.handle((CloseEvent)i.next());
+                  }
+                  while (i.hasNext());
+               }
+               break;
+            }
+            case Analyzer.EMPTY:
+            {
+//               String tag = t.value;
+//               int start = 1;
+//               int end = tag.indexOf(' ', 1);
+//               if (end == -1)
+//               {
+//                  end = tag.length() - 2;
+//               }
+//               String name = tag.substring(start, end);
+//               helper.empty(1, name);
+               break;
+            }
+            case Analyzer.CDATA:
+               buffer.append(t.value.charAt(0));
+               break;
+            default:
+               throw new IllegalStateException("Unexpected token : " + t.type);
+         }
+      }
+
+      //
+      text();
+      temporaryKey.type = EVENT_NORMAL;
+      Iterator i = stack.pop(temporaryKey);
+      while (i.hasNext())
+      {
+         handler.handle((CloseEvent)i.next());
+      }
+   }
+
+   private void text()
+   {
+      if (buffer.length() > 0)
+      {
+         textEvent.setText(buffer.chars(), 0, buffer.length());
+         buffer.reset();
+         handler.handle(textEvent);
+      }
+   }
+
+   private static class HTMLKey implements Stack.Key
+   {
+      int type;
+      String tag;
+
+      private HTMLKey()
+      {
+         type = -1;
+         tag = null;
+      }
+
+      public int getType()
+      {
+         return type;
+      }
+
+      public String getTag()
+      {
+         return tag;
+      }
+   }
+
+   public static class OpenEvent extends HTMLKey implements ParseEvent
+   {
+      private String attributes;
+
+      public String getAttribute()
+      {
+         return attributes;
+      }
+   }
+
+   public static class CloseEvent extends HTMLKey implements ParseEvent
+   {
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/TagParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/LineBreakParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/LineBreakParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/LineBreakParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.parser.linebreak;
+
+import org.jboss.portlet.forums.format.parser.AbstractParser;
+import org.jboss.portlet.forums.format.parser.ParseEvent;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+
+/**
+ * Break the parsed chars into text events and line break events.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class LineBreakParser extends AbstractParser
+{
+
+   private static final LineBreakEvent event = new LineBreakEvent();
+
+   private final TextEvent textEvent = new TextEvent();
+
+   public void parse(char[] chars, int startOffset, int length)
+   {
+      int endOffset = startOffset + length;
+      int previousOffset = startOffset;
+      for (int currentOffset = startOffset; currentOffset < endOffset; currentOffset++)
+      {
+         char c = chars[currentOffset];
+         if (c == '\n')
+         {
+            if (currentOffset > previousOffset)
+            {
+               textEvent.setText(chars, previousOffset, currentOffset - previousOffset);
+               handler.handle(textEvent);
+            }
+            handler.handle(event);
+            previousOffset = currentOffset + 1;
+         }
+      }
+      if (endOffset > previousOffset)
+      {
+         textEvent.setText(chars, previousOffset, endOffset - previousOffset);
+         handler.handle(textEvent);
+      }
+   }
+
+   public static class LineBreakEvent implements ParseEvent
+   {
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/parser/linebreak/LineBreakParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/AbstractRenderer.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/AbstractRenderer.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/AbstractRenderer.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.render;
+
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/** An abstract renderer. */
+public abstract class AbstractRenderer
+{
+
+
+   /** The logger. */
+   protected final Logger log = Logger.getLogger(getClass());
+
+   /** Hold the final result. */
+   protected Writer writer = null;
+
+   /** Render. */
+   public abstract void render(char[] chars, int offset, int length);
+
+
+   /** Render. */
+   public void render(String string)
+   {
+      char[] tmp = string.toCharArray();
+      render(tmp, 0, tmp.length);
+   }
+
+   /** Set the write that will hold the rendered result. */
+   public final void setWriter(Writer writer)
+   {
+      this.writer = writer;
+   }
+
+   /** Helper method that catch any IOException throw by the write. */
+   protected final void write(String s)
+   {
+      try
+      {
+         writer.write(s);
+      }
+      catch (IOException e)
+      {
+         log.error("Cannot write to output", e);
+      }
+   }
+
+   /** @see #write(java.lang.String) */
+   protected final void write(char[] chars, int offset, int length)
+   {
+      try
+      {
+         writer.write(chars, offset, length);
+      }
+      catch (IOException e)
+      {
+         log.error("Cannot write to output", e);
+      }
+   }
+
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/AbstractRenderer.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLConfig.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLConfig.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLConfig.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,241 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.render.bbcodehtml;
+
+import org.apache.log4j.Logger;
+import org.jboss.portlet.forums.format.template.BuildException;
+import org.jboss.portlet.forums.format.template.Template;
+import org.jboss.portlet.forums.format.template.TemplateLoader;
+import org.jboss.portlet.forums.format.template.TemplateRepository;
+import org.jboss.portlet.forums.format.util.CLLoader;
+import org.jboss.portlet.forums.format.util.Loader;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ */
+public class ToHTMLConfig
+{
+
+   /** Template name constants. */
+
+   public static final String TPL_THEME_CODE_B_CLOSE = "b_close";
+   public static final String TPL_THEME_CODE_B_OPEN = "b_open";
+   public static final String TPL_THEME_CODE_CODE_CLOSE = "code_close";
+   public static final String TPL_THEME_CODE_CODE_OPEN = "code_open";
+   public static final String TPL_THEME_CODE_COLOR_CLOSE = "color_close";
+   public static final String TPL_THEME_CODE_COLOR_OPEN = "color_open";
+   public static final String TPL_THEME_CODE_EMAIL = "email";
+   public static final String TPL_THEME_CODE_I_CLOSE = "i_close";
+   public static final String TPL_THEME_CODE_I_OPEN = "i_open";
+   public static final String TPL_THEME_CODE_IMG = "img";
+   public static final String TPL_THEME_CODE_LISTITEM = "listitem";
+   public static final String TPL_THEME_CODE_OLIST_CLOSE = "olist_close";
+   public static final String TPL_THEME_CODE_OLIST_OPEN = "olist_open";
+   public static final String TPL_THEME_CODE_QUOTE_CLOSE = "quote_close";
+   public static final String TPL_THEME_CODE_QUOTE_OPEN = "quote_open";
+   public static final String TPL_THEME_CODE_QUOTE_USERNAME_OPEN = "quote_username_open";
+   public static final String TPL_THEME_CODE_SIZE_CLOSE = "size_close";
+   public static final String TPL_THEME_CODE_SIZE_OPEN = "size_open";
+   public static final String TPL_THEME_CODE_U_CLOSE = "u_close";
+   public static final String TPL_THEME_CODE_U_OPEN = "u_open";
+   public static final String TPL_THEME_CODE_ULIST_CLOSE = "ulist_close";
+   public static final String TPL_THEME_CODE_ULIST_OPEN = "ulist_open";
+   public static final String TPL_THEME_CODE_URL = "url";
+
+   public static final int FILTER_MODE_ALWAYS_PRINT = 0;
+   public static final int FILTER_MODE_NEVER_PRINT = 1;
+   public static final int FILTER_MODE_PRINT_IF_NOT_IN_TAGS = 2;
+   public static final int FILTER_MODE_PRINT_IF_IN_TAGS = 3;
+
+   public static final int OUTPUT_MODE_REMOVE = 0;
+   public static final int OUTPUT_MODE_DISPLAY = 1;
+
+   private static final Loader loader = new CLLoader(ToHTMLRenderer.class.getClassLoader(), "");
+   private static final TemplateRepository defaultRepository = createRepository(loader);
+
+   Template r_ulist_open;
+   Template r_ulist_close;
+   Template r_olist_open;
+   Template r_olist_close;
+   Template r_listitem;
+   Template r_quote_open;
+   Template r_quote_close;
+   Template r_quote_username_open;
+   Template r_code_open;
+   Template r_code_close;
+   Template r_b_open;
+   Template r_b_close;
+   Template r_u_open;
+   Template r_u_close;
+   Template r_i_open;
+   Template r_i_close;
+   Template r_color_open;
+   Template r_color_close;
+   Template r_size_open;
+   Template r_size_close;
+   Template r_img;
+   Template r_url;
+   Template r_email;
+
+   private Set tags = new HashSet();
+   private int filterMode = FILTER_MODE_ALWAYS_PRINT;
+   private int ouputMode = OUTPUT_MODE_REMOVE;
+   private int maxTextWidth = 100;
+
+   public ToHTMLConfig()
+   {
+      setRepository(defaultRepository);
+   }
+
+   public void setLoader(Loader loader)
+   {
+      TemplateRepository repository = createRepository(loader);
+      setRepository(repository);
+   }
+
+   public int getMaxTextWidth()
+   {
+      return maxTextWidth;
+   }
+
+   public void setMaxTextWidth(int maxTextWidth)
+   {
+      this.maxTextWidth = maxTextWidth;
+   }
+
+   public void setTags(Set tags)
+   {
+      this.tags = tags;
+   }
+
+   public Set getTags()
+   {
+      return tags;
+   }
+
+   public int getFilterMode()
+   {
+      return filterMode;
+   }
+
+   public void setFilterMode(int filterMode)
+   {
+      this.filterMode = filterMode;
+   }
+
+   public int getOuputMode()
+   {
+      return ouputMode;
+   }
+
+   public void setOuputMode(int ouputMode)
+   {
+      this.ouputMode = ouputMode;
+   }
+
+   public boolean print(String tag)
+   {
+      switch (filterMode)
+      {
+         case FILTER_MODE_NEVER_PRINT:
+            return false;
+         case FILTER_MODE_PRINT_IF_NOT_IN_TAGS:
+            return !tags.contains(tag);
+         case FILTER_MODE_PRINT_IF_IN_TAGS:
+            return tags.contains(tag);
+         case FILTER_MODE_ALWAYS_PRINT:
+            return true;
+      }
+      return false;
+   }
+
+   private void setRepository(TemplateRepository repository)
+   {
+      r_ulist_open = repository.createTemplate(TPL_THEME_CODE_ULIST_OPEN);
+      r_ulist_close = repository.createTemplate(TPL_THEME_CODE_ULIST_CLOSE);
+      r_olist_open = repository.createTemplate(TPL_THEME_CODE_OLIST_OPEN);
+      r_olist_close = repository.createTemplate(TPL_THEME_CODE_OLIST_CLOSE);
+      r_listitem = repository.createTemplate(TPL_THEME_CODE_LISTITEM);
+      r_quote_open = repository.createTemplate(TPL_THEME_CODE_QUOTE_OPEN);
+      r_quote_close = repository.createTemplate(TPL_THEME_CODE_QUOTE_CLOSE);
+      r_quote_username_open = repository.createTemplate(TPL_THEME_CODE_QUOTE_USERNAME_OPEN);
+      r_code_open = repository.createTemplate(TPL_THEME_CODE_CODE_OPEN);
+      r_code_close = repository.createTemplate(TPL_THEME_CODE_CODE_CLOSE);
+      r_b_open = repository.createTemplate(TPL_THEME_CODE_B_OPEN);
+      r_b_close = repository.createTemplate(TPL_THEME_CODE_B_CLOSE);
+      r_u_open = repository.createTemplate(TPL_THEME_CODE_U_OPEN);
+      r_u_close = repository.createTemplate(TPL_THEME_CODE_U_CLOSE);
+      r_i_open = repository.createTemplate(TPL_THEME_CODE_I_OPEN);
+      r_i_close = repository.createTemplate(TPL_THEME_CODE_I_CLOSE);
+      r_color_open = repository.createTemplate(TPL_THEME_CODE_COLOR_OPEN);
+      r_color_close = repository.createTemplate(TPL_THEME_CODE_COLOR_CLOSE);
+      r_size_open = repository.createTemplate(TPL_THEME_CODE_SIZE_OPEN);
+      r_size_close = repository.createTemplate(TPL_THEME_CODE_SIZE_CLOSE);
+      r_img = repository.createTemplate(TPL_THEME_CODE_IMG);
+      r_url = repository.createTemplate(TPL_THEME_CODE_URL);
+      r_email = repository.createTemplate(TPL_THEME_CODE_EMAIL);
+   }
+
+   private static void loadTemplate(TemplateLoader repository, String name)
+   {
+      try
+      {
+         repository.addTemplate(name, "/" + name + ".tpl");
+      }
+      catch (BuildException e)
+      {
+         Logger.getLogger(ToHTMLRenderer.class).error("Cannot load template : " + name, e);
+      }
+   }
+
+   private static TemplateLoader createRepository(Loader loader)
+   {
+      TemplateLoader repository = new TemplateLoader(loader);
+      loadTemplate(repository, TPL_THEME_CODE_ULIST_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_ULIST_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_OLIST_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_OLIST_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_LISTITEM);
+      loadTemplate(repository, TPL_THEME_CODE_QUOTE_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_QUOTE_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_QUOTE_USERNAME_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_CODE_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_CODE_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_B_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_B_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_U_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_U_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_I_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_I_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_COLOR_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_COLOR_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_SIZE_OPEN);
+      loadTemplate(repository, TPL_THEME_CODE_SIZE_CLOSE);
+      loadTemplate(repository, TPL_THEME_CODE_IMG);
+      loadTemplate(repository, TPL_THEME_CODE_URL);
+      loadTemplate(repository, TPL_THEME_CODE_EMAIL);
+      return repository;
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLConfig.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,381 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.render.bbcodehtml;
+
+import org.jboss.portlet.forums.format.parser.ParseEvent;
+import org.jboss.portlet.forums.format.parser.ParseEventHandler;
+import org.jboss.portlet.forums.format.parser.TextEvent;
+import org.jboss.portlet.forums.format.parser.bbcode.BBCodeParser;
+import org.jboss.portlet.forums.format.parser.entity.CharacterEntityReferenceEvent;
+import org.jboss.portlet.forums.format.parser.entity.HTML4_0CharacterEntityReferenceParser;
+import org.jboss.portlet.forums.format.parser.entity.XML1_0CharacterEntityReferenceParser;
+import org.jboss.portlet.forums.format.parser.html.TagParser;
+import org.jboss.portlet.forums.format.parser.linebreak.LineBreakParser;
+import org.jboss.portlet.forums.format.render.AbstractRenderer;
+import org.jboss.portlet.forums.format.template.DelegateContext;
+
+import java.util.ResourceBundle;
+
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ToHTMLRenderer extends AbstractRenderer
+{
+
+   /*
+    * Different parsers.
+    */
+
+   private final BBCodeParser codeParser = new BBCodeParser();
+   private final TagParser tagParser = new TagParser();
+   private final XML1_0CharacterEntityReferenceParser XMLCERP = new XML1_0CharacterEntityReferenceParser();
+   private final HTML4_0CharacterEntityReferenceParser HTMLCERP = new HTML4_0CharacterEntityReferenceParser();
+   private final LineBreakParser lineBreakParser = new LineBreakParser();
+
+   /** Context used by the code handler templates. */
+   private final DelegateContext ctx = new DelegateContext();
+
+   /** Code depth. */
+   private int isInPre = 0;
+
+   /** Config. */
+   private ToHTMLConfig config;
+
+   /*
+    * Templates.
+    */
+
+   /** Setup the renderer with the given template repository. */
+   public ToHTMLRenderer(ToHTMLConfig config, ResourceBundle bundle)
+   {
+      if (config == null)
+      {
+         throw new IllegalArgumentException("no config");
+      }
+      if (bundle == null)
+      {
+         throw new IllegalArgumentException("no bundle");
+      }
+      this.config = config;
+      codeParser.setHandler(bbCodeHandler);
+      tagParser.setHandler(tagHandler);
+      XMLCERP.setHandler(XMLCRPHandler);
+      HTMLCERP.setHandler(HTMLCRPHandler);
+      lineBreakParser.setHandler(lineBreakHandler);
+      ctx.put("L_CODE", bundle.getString(BBCodeParser.BUNDLE_KEY_CODE));
+      ctx.put("L_QUOTE", bundle.getString(BBCodeParser.BUNDLE_KEY_QUOTE));
+      ctx.put("L_WROTE", bundle.getString(BBCodeParser.BUNDLE_KEY_WROTE));
+   }
+
+   public ToHTMLRenderer(ResourceBundle bundle)
+   {
+      this(new ToHTMLConfig(), bundle);
+   }
+
+   public ToHTMLConfig getConfig()
+   {
+      return config;
+   }
+
+   public void setConfig(ToHTMLConfig config)
+   {
+      this.config = config;
+   }
+
+   public void render(char[] chars, int offset, int length)
+   {
+      codeParser.parse(chars, offset, length);
+   }
+
+   public ParseEventHandler bbCodeHandler = new ParseEventHandler()
+   {
+      public void handle(ParseEvent event)
+      {
+         if (event instanceof BBCodeParser.OpenEvent)
+         {
+            BBCodeParser.OpenEvent openEvent = (BBCodeParser.OpenEvent)event;
+            String string = openEvent.getString();
+            String string2 = openEvent.getString2();
+            switch (openEvent.getType())
+            {
+               case BBCodeParser.EVENT_BOLD:
+                  config.r_b_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ITALIC:
+                  config.r_i_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_UNDERLINE:
+                  config.r_u_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_COLOR:
+                  ctx.put("COLOR", string);
+                  config.r_color_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_SIZE:
+                  ctx.put("SIZE", string);
+                  config.r_size_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_QUOTE:
+                  if (string == null)
+                  {
+                     config.r_quote_open.render(ctx, writer);
+                  }
+                  else
+                  {
+                     ctx.put("USERNAME", string);
+                     config.r_quote_username_open.render(ctx, writer);
+                  }
+                  break;
+               case BBCodeParser.EVENT_CODE:
+                  isInPre++;
+                  config.r_code_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_IMAGE:
+                   ctx.put("URL", string);
+                   config.r_img.render(ctx, writer);
+                   break;
+               case BBCodeParser.EVENT_UNORDERED_LIST:
+                  config.r_ulist_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_NUMERICALLY_ORDERED_LIST:
+                  ctx.put("LIST_TYPE", "1");
+                  config.r_olist_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ALPHABETICALLY_ORDERED_LIST:
+                  ctx.put("LIST_TYPE", "a");
+                  config.r_olist_open.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ITEM:
+                  config.r_listitem.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_LINK:
+                  if (string2==null)
+                  {
+                     ctx.put("URL", string);
+                     ctx.put("DESCRIPTION", string);
+                  }
+                  else
+                  {
+                      ctx.put("URL", string);
+                      ctx.put("DESCRIPTION", string2); 
+                  }
+                  config.r_url.render(ctx, writer);
+                  break;
+            }
+         }
+         else if (event instanceof BBCodeParser.CloseEvent)
+         {
+            BBCodeParser.CloseEvent closeEvent = (BBCodeParser.CloseEvent)event;
+            switch (closeEvent.getType())
+            {
+               case BBCodeParser.EVENT_BOLD:
+                  config.r_b_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ITALIC:
+                  config.r_i_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_UNDERLINE:
+                  config.r_u_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_COLOR:
+                  config.r_color_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_SIZE:
+                  config.r_size_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_QUOTE:
+                  config.r_quote_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_CODE:
+                  isInPre--;
+                  config.r_code_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_IMAGE:
+                   break;
+               case BBCodeParser.EVENT_UNORDERED_LIST:
+                  config.r_ulist_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_NUMERICALLY_ORDERED_LIST:
+                  config.r_olist_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ALPHABETICALLY_ORDERED_LIST:
+                  config.r_olist_close.render(ctx, writer);
+                  break;
+               case BBCodeParser.EVENT_ITEM:
+                  break;
+               case BBCodeParser.EVENT_LINK:
+                  break;
+            }
+         }
+         else
+         {
+            TextEvent textEvent = (TextEvent)event;
+            if (isInPre > 0)
+            {
+               XMLCERP.parse(textEvent.chars(), textEvent.offset(), textEvent.length());
+            }
+            else
+            {
+               tagParser.parse(textEvent.chars(), textEvent.offset(), textEvent.length());
+            }
+         }
+      }
+   };
+
+   public ParseEventHandler tagHandler = new ParseEventHandler()
+   {
+      public void handle(ParseEvent event)
+      {
+         if (event instanceof TagParser.OpenEvent)
+         {
+            TagParser.OpenEvent openEvent = (TagParser.OpenEvent)event;
+            switch (openEvent.getType())
+            {
+               case TagParser.EVENT_TAG:
+                  String tag = openEvent.getTag();
+                  if (config.print(tag))
+                  {
+                     if ("pre".equals(tag))
+                     {
+                        isInPre++;
+                     }
+                     write("<");
+                     write(tag);
+                     write(openEvent.getAttribute());
+                     write(">");
+                  }
+                  else if (config.getOuputMode() == ToHTMLConfig.OUTPUT_MODE_DISPLAY)
+                  {
+                     write("&lt;");
+                     write(tag);
+                     write(openEvent.getAttribute());
+                     write("&gt;");
+                  }
+                  break;
+            }
+         }
+         else if (event instanceof TagParser.CloseEvent)
+         {
+            TagParser.CloseEvent closeEvent = (TagParser.CloseEvent)event;
+            switch (closeEvent.getType())
+            {
+               case TagParser.EVENT_TAG:
+                  String tag = closeEvent.getTag();
+                  if (config.print(tag))
+                  {
+                     if ("pre".equals(tag))
+                     {
+                        isInPre--;
+                     }
+                     write("</");
+                     write(tag);
+                     write(">");
+                  }
+                  else if (config.getOuputMode() == ToHTMLConfig.OUTPUT_MODE_DISPLAY)
+                  {
+                     write("&lt;/");
+                     write(tag);
+                     write("&gt;");
+                  }
+                  break;
+            }
+         }
+         else
+         {
+            TextEvent textEvent = (TextEvent)event;
+            XMLCERP.parse(textEvent.chars(), textEvent.offset(), textEvent.length());
+         }
+      }
+   };
+
+   public ParseEventHandler XMLCRPHandler = new ParseEventHandler()
+   {
+      public void handle(ParseEvent event)
+      {
+         if (event instanceof CharacterEntityReferenceEvent)
+         {
+            CharacterEntityReferenceEvent cere = (CharacterEntityReferenceEvent)event;
+            lineBreakParser.parse(cere.chars(), cere.offset(), cere.length());
+         }
+         else
+         {
+            TextEvent te = (TextEvent)event;
+            HTMLCERP.parse(te.chars(), te.offset(), te.length());
+         }
+      }
+   };
+
+   public ParseEventHandler HTMLCRPHandler = new ParseEventHandler()
+   {
+      public void handle(ParseEvent event)
+      {
+         TextEvent textEvent = (TextEvent)event;
+         lineBreakParser.parse(textEvent.chars(), textEvent.offset(), textEvent.length());
+      }
+   };
+
+   public ParseEventHandler lineBreakHandler = new ParseEventHandler()
+   {
+      public void handle(ParseEvent event)
+      {
+         if (event instanceof TextEvent)
+         {
+            TextEvent textEvent = (TextEvent)event;
+            if (isInPre == 0)
+            {
+               write(textEvent.chars(), textEvent.offset(), textEvent.length());
+            }
+            else
+            {
+               // Break the content in small chunks
+               char[] chars = textEvent.chars();
+               int offset = textEvent.offset();
+               int length = textEvent.length();
+               int maxSize = config.getMaxTextWidth();
+               while (length > maxSize)
+               {
+                  write(chars, offset, maxSize);
+                  length -= maxSize;
+                  offset += maxSize;
+                  write("\n");
+               }
+               // Ouput the last chunk
+               write(chars, offset, length);
+            }
+         }
+         else
+         {
+            if (isInPre == 0)
+            {
+               write("<br/>");
+            }
+            else
+            {
+               write("\n");
+            }
+         }
+      }
+   };
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ASCII_CharStream.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ASCII_CharStream.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ASCII_CharStream.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,400 @@
+/* Generated By:JavaCC: Do not edit this line. ASCII_CharStream.java Version 0.7pre6 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public final class ASCII_CharStream
+{
+  public static final boolean staticFlag = false;
+  int bufsize;
+  int available;
+  int tokenBegin;
+  public int bufpos = -1;
+  private int bufline[];
+  private int bufcolumn[];
+
+  private int column = 0;
+  private int line = 1;
+
+  private boolean prevCharIsCR = false;
+  private boolean prevCharIsLF = false;
+
+  private java.io.Reader inputStream;
+
+  private char[] buffer;
+  private int maxNextCharInd = 0;
+  private int inBuf = 0;
+
+  private final void ExpandBuff(boolean wrapAround)
+  {
+     char[] newbuffer = new char[bufsize + 2048];
+     int newbufline[] = new int[bufsize + 2048];
+     int newbufcolumn[] = new int[bufsize + 2048];
+
+     try
+     {
+        if (wrapAround)
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           System.arraycopy(buffer, 0, newbuffer,
+                                             bufsize - tokenBegin, bufpos);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+        }
+        else
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos -= tokenBegin);
+        }
+     }
+     catch (Throwable t)
+     {
+        throw new Error(t.getMessage());
+     }
+
+
+     bufsize += 2048;
+     available = bufsize;
+     tokenBegin = 0;
+  }
+
+  private final void FillBuff() throws java.io.IOException
+  {
+     if (maxNextCharInd == available)
+     {
+        if (available == bufsize)
+        {
+           if (tokenBegin > 2048)
+           {
+              bufpos = maxNextCharInd = 0;
+              available = tokenBegin;
+           }
+           else if (tokenBegin < 0)
+              bufpos = maxNextCharInd = 0;
+           else
+              ExpandBuff(false);
+        }
+        else if (available > tokenBegin)
+           available = bufsize;
+        else if ((tokenBegin - available) < 2048)
+           ExpandBuff(true);
+        else
+           available = tokenBegin;
+     }
+
+     int i;
+     try {
+        if ((i = inputStream.read(buffer, maxNextCharInd,
+                                    available - maxNextCharInd)) == -1)
+        {
+           inputStream.close();
+           throw new java.io.IOException();
+        }
+        else
+           maxNextCharInd += i;
+        return;
+     }
+     catch(java.io.IOException e) {
+        --bufpos;
+        backup(0);
+        if (tokenBegin == -1)
+           tokenBegin = bufpos;
+        throw e;
+     }
+  }
+
+  public final char BeginToken() throws java.io.IOException
+  {
+     tokenBegin = -1;
+     char c = readChar();
+     tokenBegin = bufpos;
+
+     return c;
+  }
+
+  private final void UpdateLineColumn(char c)
+  {
+     column++;
+
+     if (prevCharIsLF)
+     {
+        prevCharIsLF = false;
+        line += (column = 1);
+     }
+     else if (prevCharIsCR)
+     {
+        prevCharIsCR = false;
+        if (c == '\n')
+        {
+           prevCharIsLF = true;
+        }
+        else
+           line += (column = 1);
+     }
+
+     switch (c)
+     {
+        case '\r' :
+           prevCharIsCR = true;
+           break;
+        case '\n' :
+           prevCharIsLF = true;
+           break;
+        case '\t' :
+           column--;
+           column += (8 - (column & 07));
+           break;
+        default :
+           break;
+     }
+
+     bufline[bufpos] = line;
+     bufcolumn[bufpos] = column;
+  }
+
+  public final char readChar() throws java.io.IOException
+  {
+     if (inBuf > 0)
+     {
+        --inBuf;
+        return (char)((char)0xff & buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]);
+     }
+
+     if (++bufpos >= maxNextCharInd)
+        FillBuff();
+
+     char c = (char)((char)0xff & buffer[bufpos]);
+
+     UpdateLineColumn(c);
+     return (c);
+  }
+
+  /**
+   * @deprecated 
+   * @see #getEndColumn
+   */
+
+  public final int getColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  /**
+   * @deprecated 
+   * @see #getEndLine
+   */
+
+  public final int getLine() {
+     return bufline[bufpos];
+  }
+
+  public final int getEndColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  public final int getEndLine() {
+     return bufline[bufpos];
+  }
+
+  public final int getBeginColumn() {
+     return bufcolumn[tokenBegin];
+  }
+
+  public final int getBeginLine() {
+     return bufline[tokenBegin];
+  }
+
+  public final void backup(int amount) {
+
+    inBuf += amount;
+    if ((bufpos -= amount) < 0)
+       bufpos += bufsize;
+  }
+
+  public ASCII_CharStream(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    available = bufsize = buffersize;
+    buffer = new char[buffersize];
+    bufline = new int[buffersize];
+    bufcolumn = new int[buffersize];
+  }
+
+  public ASCII_CharStream(java.io.Reader dstream, int startline,
+                                                           int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+  public void ReInit(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    if (buffer == null || buffersize != buffer.length)
+    {
+      available = bufsize = buffersize;
+      buffer = new char[buffersize];
+      bufline = new int[buffersize];
+      bufcolumn = new int[buffersize];
+    }
+    prevCharIsLF = prevCharIsCR = false;
+    tokenBegin = inBuf = maxNextCharInd = 0;
+    bufpos = -1;
+  }
+
+  public void ReInit(java.io.Reader dstream, int startline,
+                                                           int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+  public ASCII_CharStream(java.io.InputStream dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+  }
+
+  public ASCII_CharStream(java.io.InputStream dstream, int startline,
+                                                           int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+
+  public void ReInit(java.io.InputStream dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+  }
+  public void ReInit(java.io.InputStream dstream, int startline,
+                                                           int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+  public final String GetImage()
+  {
+     if (bufpos >= tokenBegin)
+        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+     else
+        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+                              new String(buffer, 0, bufpos + 1);
+  }
+
+  public final char[] GetSuffix(int len)
+  {
+     char[] ret = new char[len];
+
+     if ((bufpos + 1) >= len)
+        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+     else
+     {
+        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+                                                          len - bufpos - 1);
+        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+     }
+
+     return ret;
+  }
+
+  public void Done()
+  {
+     buffer = null;
+     bufline = null;
+     bufcolumn = null;
+  }
+
+  /**
+   * Method to adjust line and column numbers for the start of a token.<BR>
+   */
+  public void adjustBeginLineColumn(int newLine, int newCol)
+  {
+     int start = tokenBegin;
+     int len;
+
+     if (bufpos >= tokenBegin)
+     {
+        len = bufpos - tokenBegin + inBuf + 1;
+     }
+     else
+     {
+        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+     }
+
+     int i = 0, j = 0, k = 0;
+     int nextColDiff = 0, columnDiff = 0;
+
+     while (i < len &&
+            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+     {
+        bufline[j] = newLine;
+        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+        bufcolumn[j] = newCol + columnDiff;
+        columnDiff = nextColDiff;
+        i++;
+     } 
+
+     if (i < len)
+     {
+        bufline[j] = newLine++;
+        bufcolumn[j] = newCol + columnDiff;
+
+        while (i++ < len)
+        {
+           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+              bufline[j] = newLine++;
+           else
+              bufline[j] = newLine;
+        }
+     }
+
+     line = bufline[j];
+     column = bufcolumn[j];
+  }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/AbstractContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/AbstractContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/AbstractContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class AbstractContext implements Context
+{
+   public Iterator childIterator(String name)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   public String get(String o)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   public Context put(String key, String value)
+   {
+      throw new UnsupportedOperationException();
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/AbstractContext.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/BuildException.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/BuildException.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/BuildException.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import org.jboss.util.NestedException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class BuildException
+   extends NestedException
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -2549615796913473453L;
+
+   public BuildException()
+   {
+   }
+
+   public BuildException(String message)
+   {
+      super(message);
+   }
+
+   public BuildException(Exception nested)
+   {
+      super(nested);
+   }
+
+   public BuildException(String message, Exception nested)
+   {
+      super(message, nested);
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/BuildException.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ChildrenStrategy.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ChildrenStrategy.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ChildrenStrategy.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ChildrenStrategy
+{
+
+   public ChildrenStrategy(Map children)
+   {
+      this.children = children;
+   }
+
+   private Map children;
+
+   public void append(String name, Context ctx)
+   {
+      List child = (List)children.get(name);
+      if (child == null)
+      {
+         child = new LinkedList();
+         children.put(name, child);
+      }
+      child.add(ctx);
+   }
+
+   public Iterator childIterator(String name)
+   {
+      List child = (List)children.get(name);
+      return child != null ? child.iterator() : Collections.EMPTY_LIST.iterator();
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ChildrenStrategy.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Context.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Context.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Context.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import java.util.Collections;
+import java.util.Iterator;
+
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface Context
+{
+   /** null context */
+   Context NULL_CONTEXT = new AbstractContext()
+   {
+      final Iterator it = Collections.EMPTY_LIST.iterator();
+
+      public Iterator childIterator(String name)
+      {
+         return it;
+      }
+
+      public String get(String key)
+      {
+         return "";
+      }
+
+      public Context put(String key, String value)
+      {
+         return this;
+      }
+   };
+
+   /**
+    * get the template data from the context
+    *
+    * @param key template variable name
+    * @return template value
+    */
+   public String get(String key);
+
+   /**
+    * add data to be rendered in the template through variable substitution
+    *
+    * @param key   template variable name
+    * @param value value to render in template
+    * @return context to place data into
+    */
+   public Context put(String key, String value);
+
+   /**
+    * get an iterator for the nested/loop data contexts
+    *
+    * @param name template variable prefix name
+    * @return iterator for the children
+    */
+   Iterator childIterator(String name);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Context.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/DelegateContext.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/DelegateContext.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/DelegateContext.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DelegateContext implements Context
+{
+   /** context's children */
+   private ChildrenStrategy children;
+
+   /** template name/value pairs for substitution */
+   private Map delegate;
+
+   /** creates a new DelegateContext object. */
+   public DelegateContext()
+   {
+      this(new HashMap(), new HashMap());
+   }
+
+   /**
+    * creates a new DelegateContext object.
+    *
+    * @param delegate name/value pairs for "root" data
+    * @param children name/value pairs for nested or loop data
+    */
+   public DelegateContext(Map delegate, Map children)
+   {
+      this.delegate = delegate;
+      this.children = new ChildrenStrategy(children);
+   }
+
+   /**
+    * create a new "root" data context and name/value pairs to be used as nested or loop data
+    *
+    * @param children name/value pairs for nested or loop data
+    * @return context to continue adding template data too
+    */
+   public static final DelegateContext createWithChildren(Map children)
+   {
+      return new DelegateContext(new HashMap(), children);
+   }
+
+   /**
+    * create a new data context with already existing name/value pairs
+    *
+    * @param values existing name/value pair map
+    * @return context to continue adding template data too
+    */
+   public static final DelegateContext createWithValues(Map values)
+   {
+      return new DelegateContext(values, new HashMap());
+   }
+
+   /**
+    * add an existing data context into this context for use in template loops or nested template data.
+    *
+    * @param name variable prefix name
+    * @param ctx  context to add
+    */
+   public void append(String name, Context ctx)
+   {
+      children.append(name, ctx);
+   }
+
+   /** @see org.jboss.portal.format.template.Context#childIterator(java.lang.String) */
+   public Iterator childIterator(String name)
+   {
+      return children.childIterator(name);
+   }
+
+   /** @see org.jboss.portal.format.template.Context#get(java.lang.String) */
+   public String get(String key)
+   {
+      return (String)delegate.get(key);
+   }
+
+   /**
+    * create a new object to place data for use in template loops or nested template data. tpl var format: {
+    * prefix.VAR_NAME }
+    *
+    * @param name variable prefix name
+    * @return delegate context that will contain the loop or nested data
+    */
+   public DelegateContext next(String name)
+   {
+      DelegateContext ctx = new DelegateContext();
+      append(name, ctx);
+
+      return ctx;
+   }
+
+   /** @see org.jboss.portal.format.template.Context#put(java.lang.String,java.lang.String) */
+   public Context put(String key, String value)
+   {
+      delegate.put(key, value);
+
+      return this;
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/DelegateContext.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ParseException.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ParseException.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/ParseException.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,214 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 0.7pre6 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+  /**
+   * This constructor is used by the method "generateParseException"
+   * in the generated parser.  Calling this constructor generates
+   * a new object of this type with the fields "currentToken",
+   * "expectedTokenSequences", and "tokenImage" set.  The boolean
+   * flag "specialConstructor" is also set to true to indicate that
+   * this constructor was used to create this object.
+   * This constructor calls its super class with the empty string
+   * to force the "toString" method of parent class "Throwable" to
+   * print the error message in the form:
+   *     ParseException: <result of getMessage>
+   */
+  public ParseException(Token currentTokenVal,
+                        int[][] expectedTokenSequencesVal,
+                        String[] tokenImageVal
+                       )
+  {
+    super("");
+    specialConstructor = true;
+    currentToken = currentTokenVal;
+    expectedTokenSequences = expectedTokenSequencesVal;
+    tokenImage = tokenImageVal;
+  }
+
+  /**
+   * The following constructors are for use by you for whatever
+   * purpose you can think of.  Constructing the exception in this
+   * manner makes the exception behave in the normal way - i.e., as
+   * documented in the class "Throwable".  The fields "errorToken",
+   * "expectedTokenSequences", and "tokenImage" do not contain
+   * relevant information.  The JavaCC generated code does not use
+   * these constructors.
+   */
+
+  public ParseException() {
+    super();
+    specialConstructor = false;
+  }
+
+  public ParseException(String message) {
+    super(message);
+    specialConstructor = false;
+  }
+
+  /**
+   * This variable determines which constructor was used to create
+   * this object and thereby affects the semantics of the
+   * "getMessage" method (see below).
+   */
+  protected boolean specialConstructor;
+
+  /**
+   * This is the last token that has been consumed successfully.  If
+   * this object has been created due to a parse error, the token
+   * followng this token will (therefore) be the first error token.
+   */
+  public Token currentToken;
+
+  /**
+   * Each entry in this array is an array of integers.  Each array
+   * of integers represents a sequence of tokens (by their ordinal
+   * values) that is expected at this point of the parse.
+   */
+  public int[][] expectedTokenSequences;
+
+  /**
+   * This is a reference to the "tokenImage" array of the generated
+   * parser within which the parse error occurred.  This array is
+   * defined in the generated ...Constants interface.
+   */
+  public String[] tokenImage;
+
+  /**
+   * This method has the standard behavior when this object has been
+   * created using the standard constructors.  Otherwise, it uses
+   * "currentToken" and "expectedTokenSequences" to generate a parse
+   * error message and returns it.  If this object has been created
+   * due to a parse error, and you do not catch it (it gets thrown
+   * from the parser), then this method is called during the printing
+   * of the final stack trace, and hence the correct error message
+   * gets displayed.
+   */
+  public String getMessage() {
+    if (!specialConstructor) {
+      return super.getMessage();
+    }
+    String expected = "";
+    int maxSize = 0;
+    for (int i = 0; i < expectedTokenSequences.length; i++) {
+      if (maxSize < expectedTokenSequences[i].length) {
+        maxSize = expectedTokenSequences[i].length;
+      }
+      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
+      }
+      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+        expected += "...";
+      }
+      expected += eol + "    ";
+    }
+    String retval = "Encountered \"";
+    Token tok = currentToken.next;
+    for (int i = 0; i < maxSize; i++) {
+      if (i != 0) retval += " ";
+      if (tok.kind == 0) {
+        retval += tokenImage[0];
+        break;
+      }
+      retval += add_escapes(tok.image);
+      tok = tok.next; 
+    }
+    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol;
+    if (expectedTokenSequences.length == 1) {
+      retval += "Was expecting:" + eol + "    ";
+    } else {
+      retval += "Was expecting one of:" + eol + "    ";
+    }
+    retval += expected;
+    return retval;
+  }
+
+  /**
+   * The end of line string for this machine.
+   */
+  protected String eol = System.getProperty("line.separator", "\n");
+ 
+  /**
+   * Used to convert raw characters to their escaped version
+   * when these raw version cannot be used as part of an ASCII
+   * string literal.
+   */
+  protected String add_escapes(String str) {
+      StringBuffer retval = new StringBuffer();
+      char ch;
+      for (int i = 0; i < str.length(); i++) {
+        switch (str.charAt(i))
+        {
+           case 0 :
+              continue;
+           case '\b':
+              retval.append("\\b");
+              continue;
+           case '\t':
+              retval.append("\\t");
+              continue;
+           case '\n':
+              retval.append("\\n");
+              continue;
+           case '\f':
+              retval.append("\\f");
+              continue;
+           case '\r':
+              retval.append("\\r");
+              continue;
+           case '\"':
+              retval.append("\\\"");
+              continue;
+           case '\'':
+              retval.append("\\\'");
+              continue;
+           case '\\':
+              retval.append("\\\\");
+              continue;
+           default:
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                 String s = "0000" + Integer.toString(ch, 16);
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+              } else {
+                 retval.append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.toString();
+   }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Template.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Template.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Template.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import org.apache.log4j.Logger;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+/** @author <a href="mailto:julien at jboss.org">Julien Viet</a> */
+public abstract class Template
+{
+
+   public final Logger log = Logger.getLogger(getClass());
+
+   protected final Context local;
+
+   public Template(Context local)
+   {
+      this.local = local;
+   }
+
+   public final String render(Context ctx)
+   {
+      StringWriter writer = new StringWriter();
+      render(ctx, writer);
+      return writer.toString();
+   }
+
+   public final Context getLocalContext()
+   {
+      return local;
+   }
+
+   /** This may be subclassed. */
+   public void render(Context ctx, Writer writer)
+   {
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Template.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,172 @@
+/* Generated By:JavaCC: Do not edit this line. TemplateAnalyzer.java */
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ */
+public class TemplateAnalyzer implements TemplateAnalyzerConstants {
+
+  public TemplateAnalyzerTokenManager token_source;
+  ASCII_CharStream jj_input_stream;
+  public Token token, jj_nt;
+  private int jj_ntk;
+  private int jj_gen;
+  final private int[] jj_la1 = new int[0];
+  final private int[] jj_la1_0 = {};
+
+  public TemplateAnalyzer(java.io.InputStream stream) {
+    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
+    token_source = new TemplateAnalyzerTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(java.io.InputStream stream) {
+    jj_input_stream.ReInit(stream, 1, 1);
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  public TemplateAnalyzer(java.io.Reader stream) {
+    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
+    token_source = new TemplateAnalyzerTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(java.io.Reader stream) {
+    jj_input_stream.ReInit(stream, 1, 1);
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  public TemplateAnalyzer(TemplateAnalyzerTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(TemplateAnalyzerTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+  }
+
+  final private Token jj_consume_token(int kind) throws ParseException {
+    Token oldToken;
+    if ((oldToken = token).next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    if (token.kind == kind) {
+      jj_gen++;
+      return token;
+    }
+    token = oldToken;
+    jj_kind = kind;
+    throw generateParseException();
+  }
+
+  final public Token getNextToken() {
+    if (token.next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    jj_gen++;
+    return token;
+  }
+
+  final public Token getToken(int index) {
+    Token t = token;
+    for (int i = 0; i < index; i++) {
+      if (t.next != null) t = t.next;
+      else t = t.next = token_source.getNextToken();
+    }
+    return t;
+  }
+
+  final private int jj_ntk() {
+    if ((jj_nt=token.next) == null)
+      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+    else
+      return (jj_ntk = jj_nt.kind);
+  }
+
+  private java.util.Vector jj_expentries = new java.util.Vector();
+  private int[] jj_expentry;
+  private int jj_kind = -1;
+
+  final public ParseException generateParseException() {
+    jj_expentries.removeAllElements();
+    boolean[] la1tokens = new boolean[8];
+    for (int i = 0; i < 8; i++) {
+      la1tokens[i] = false;
+    }
+    if (jj_kind >= 0) {
+      la1tokens[jj_kind] = true;
+      jj_kind = -1;
+    }
+    for (int i = 0; i < 0; i++) {
+      if (jj_la1[i] == jj_gen) {
+        for (int j = 0; j < 32; j++) {
+          if ((jj_la1_0[i] & (1<<j)) != 0) {
+            la1tokens[j] = true;
+          }
+        }
+      }
+    }
+    for (int i = 0; i < 8; i++) {
+      if (la1tokens[i]) {
+        jj_expentry = new int[1];
+        jj_expentry[0] = i;
+        jj_expentries.addElement(jj_expentry);
+      }
+    }
+    int[][] exptokseq = new int[jj_expentries.size()][];
+    for (int i = 0; i < jj_expentries.size(); i++) {
+      exptokseq[i] = (int[])jj_expentries.elementAt(i);
+    }
+    return new ParseException(token, exptokseq, tokenImage);
+  }
+
+  final public void enable_tracing() {
+  }
+
+  final public void disable_tracing() {
+  }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,78 @@
+options
+{
+  STATIC = false;
+}
+
+PARSER_BEGIN(TemplateAnalyzer)
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ */
+public class TemplateAnalyzer
+{
+}
+
+PARSER_END(TemplateAnalyzer)
+
+<DEFAULT> TOKEN :
+{
+   <BEGIN: "<!-- BEGIN " (~[" "])+ " -->" >
+}
+
+<DEFAULT> TOKEN :
+{
+   <END: "<!-- END " (~[" "])+ " -->" >
+}
+
+<DEFAULT> TOKEN :
+{
+   <PROPERTY: "${" (~["}"])* "}" >
+}
+
+<DEFAULT> TOKEN :
+{
+   <REF: "{" (<LITTERAL> ".")* <LITTERAL> "}" >
+}
+
+<DEFAULT> TOKEN :
+{
+   <#LITTERAL: (["A"-"Z","a"-"z","0"-"9","-","_"])* >
+}
+
+<DEFAULT> TOKEN :
+{
+   <TEXT: ~["\n"] >
+}
+
+<DEFAULT> TOKEN :
+{
+   <NEWLINE: "\n" >
+}
+
+
+
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzer.jj
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerConstants.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerConstants.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerConstants.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,50 @@
+/* Generated By:JavaCC: Do not edit this line. TemplateAnalyzerConstants.java */
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+public interface TemplateAnalyzerConstants {
+
+  int EOF = 0;
+  int BEGIN = 1;
+  int END = 2;
+  int PROPERTY = 3;
+  int REF = 4;
+  int LITTERAL = 5;
+  int TEXT = 6;
+  int NEWLINE = 7;
+
+  int DEFAULT = 0;
+
+  String[] tokenImage = {
+    "<EOF>",
+    "<BEGIN>",
+    "<END>",
+    "<PROPERTY>",
+    "<REF>",
+    "<LITTERAL>",
+    "<TEXT>",
+    "\"\\n\"",
+  };
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerTokenManager.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerTokenManager.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateAnalyzerTokenManager.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,494 @@
+/* Generated By:JavaCC: Do not edit this line. TemplateAnalyzerTokenManager.java */
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+public class TemplateAnalyzerTokenManager implements TemplateAnalyzerConstants
+{
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+   switch (pos)
+   {
+      default :
+         return -1;
+   }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
+private final int jjStopAtPos(int pos, int kind)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   return pos + 1;
+}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) { return pos + 1; }
+   return jjMoveNfa_0(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_0()
+{
+   switch(curChar)
+   {
+      case 10:
+         return jjStopAtPos(0, 7);
+      default :
+         return jjMoveNfa_0(3, 0);
+   }
+}
+private final void jjCheckNAdd(int state)
+{
+   if (jjrounds[state] != jjround)
+   {
+      jjstateSet[jjnewStateCnt++] = state;
+      jjrounds[state] = jjround;
+   }
+}
+private final void jjAddStates(int start, int end)
+{
+   do {
+      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+   } while (start++ != end);
+}
+private final void jjCheckNAddTwoStates(int state1, int state2)
+{
+   jjCheckNAdd(state1);
+   jjCheckNAdd(state2);
+}
+private final void jjCheckNAddStates(int start, int end)
+{
+   do {
+      jjCheckNAdd(jjnextStates[start]);
+   } while (start++ != end);
+}
+private final void jjCheckNAddStates(int start)
+{
+   jjCheckNAdd(jjnextStates[start]);
+   jjCheckNAdd(jjnextStates[start + 1]);
+}
+static final long[] jjbitVec0 = {
+   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private final int jjMoveNfa_0(int startState, int curPos)
+{
+   int[] nextStates;
+   int startsAt = 0;
+   jjnewStateCnt = 40;
+   int i = 1;
+   jjstateSet[0] = startState;
+   int j, kind = 0x7fffffff;
+   for (;;)
+   {
+      if (++jjround == 0x7fffffff)
+         ReInitRounds();
+      if (curChar < 64)
+      {
+         long l = 1L << curChar;
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 3:
+                  if ((0xfffffffffffffbffL & l) != 0L)
+                  {
+                     if (kind > 6)
+                        kind = 6;
+                  }
+                  if (curChar == 60)
+                     jjAddStates(0, 1);
+                  else if (curChar == 36)
+                     jjstateSet[jjnewStateCnt++] = 0;
+                  break;
+               case 1:
+                  jjAddStates(2, 3);
+                  break;
+               case 5:
+                  if (curChar == 46)
+                     jjCheckNAddStates(4, 6);
+                  break;
+               case 7:
+                  if ((0x3ff200000000000L & l) != 0L)
+                     jjCheckNAddStates(7, 10);
+                  break;
+               case 8:
+                  if ((0x3ff200000000000L & l) != 0L)
+                     jjCheckNAddTwoStates(8, 5);
+                  break;
+               case 9:
+                  if ((0x3ff200000000000L & l) != 0L)
+                     jjCheckNAddTwoStates(9, 6);
+                  break;
+               case 10:
+                  if ((0xfffffffffffffbffL & l) != 0L && kind > 6)
+                     kind = 6;
+                  break;
+               case 11:
+                  if (curChar == 60)
+                     jjAddStates(0, 1);
+                  break;
+               case 12:
+                  if (curChar == 32)
+                     jjCheckNAdd(13);
+                  break;
+               case 13:
+                  if ((0xfffffffeffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(13, 17);
+                  break;
+               case 14:
+                  if (curChar == 62 && kind > 1)
+                     kind = 1;
+                  break;
+               case 15:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 14;
+                  break;
+               case 16:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 15;
+                  break;
+               case 17:
+                  if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 16;
+                  break;
+               case 23:
+                  if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 22;
+                  break;
+               case 24:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 23;
+                  break;
+               case 25:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 24;
+                  break;
+               case 26:
+                  if (curChar == 33)
+                     jjstateSet[jjnewStateCnt++] = 25;
+                  break;
+               case 27:
+                  if (curChar == 32)
+                     jjCheckNAdd(28);
+                  break;
+               case 28:
+                  if ((0xfffffffeffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(28, 32);
+                  break;
+               case 29:
+                  if (curChar == 62 && kind > 2)
+                     kind = 2;
+                  break;
+               case 30:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 29;
+                  break;
+               case 31:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 30;
+                  break;
+               case 32:
+                  if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 31;
+                  break;
+               case 36:
+                  if (curChar == 32)
+                     jjstateSet[jjnewStateCnt++] = 35;
+                  break;
+               case 37:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 36;
+                  break;
+               case 38:
+                  if (curChar == 45)
+                     jjstateSet[jjnewStateCnt++] = 37;
+                  break;
+               case 39:
+                  if (curChar == 33)
+                     jjstateSet[jjnewStateCnt++] = 38;
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else if (curChar < 128)
+      {
+         long l = 1L << (curChar & 077);
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 3:
+                  if (kind > 6)
+                     kind = 6;
+                  if (curChar == 123)
+                     jjCheckNAddStates(4, 6);
+                  break;
+               case 0:
+                  if (curChar == 123)
+                     jjCheckNAddTwoStates(1, 2);
+                  break;
+               case 1:
+                  if ((0xdfffffffffffffffL & l) != 0L)
+                     jjCheckNAddTwoStates(1, 2);
+                  break;
+               case 2:
+                  if (curChar == 125 && kind > 3)
+                     kind = 3;
+                  break;
+               case 4:
+                  if (curChar == 123)
+                     jjCheckNAddStates(4, 6);
+                  break;
+               case 6:
+                  if (curChar == 125 && kind > 4)
+                     kind = 4;
+                  break;
+               case 7:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     jjCheckNAddStates(7, 10);
+                  break;
+               case 8:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     jjCheckNAddTwoStates(8, 5);
+                  break;
+               case 9:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                     jjCheckNAddTwoStates(9, 6);
+                  break;
+               case 10:
+                  if (kind > 6)
+                     kind = 6;
+                  break;
+               case 13:
+                  jjAddStates(11, 12);
+                  break;
+               case 18:
+                  if (curChar == 78)
+                     jjstateSet[jjnewStateCnt++] = 12;
+                  break;
+               case 19:
+                  if (curChar == 73)
+                     jjstateSet[jjnewStateCnt++] = 18;
+                  break;
+               case 20:
+                  if (curChar == 71)
+                     jjstateSet[jjnewStateCnt++] = 19;
+                  break;
+               case 21:
+                  if (curChar == 69)
+                     jjstateSet[jjnewStateCnt++] = 20;
+                  break;
+               case 22:
+                  if (curChar == 66)
+                     jjstateSet[jjnewStateCnt++] = 21;
+                  break;
+               case 28:
+                  jjAddStates(13, 14);
+                  break;
+               case 33:
+                  if (curChar == 68)
+                     jjstateSet[jjnewStateCnt++] = 27;
+                  break;
+               case 34:
+                  if (curChar == 78)
+                     jjstateSet[jjnewStateCnt++] = 33;
+                  break;
+               case 35:
+                  if (curChar == 69)
+                     jjstateSet[jjnewStateCnt++] = 34;
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else
+      {
+         int i2 = (curChar & 0xff) >> 6;
+         long l2 = 1L << (curChar & 077);
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 3:
+                  if ((jjbitVec0[i2] & l2) != 0L && kind > 6)
+                     kind = 6;
+                  break;
+               case 1:
+                  if ((jjbitVec0[i2] & l2) != 0L)
+                     jjAddStates(2, 3);
+                  break;
+               case 13:
+                  if ((jjbitVec0[i2] & l2) != 0L)
+                     jjAddStates(11, 12);
+                  break;
+               case 28:
+                  if ((jjbitVec0[i2] & l2) != 0L)
+                     jjAddStates(13, 14);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      if (kind != 0x7fffffff)
+      {
+         jjmatchedKind = kind;
+         jjmatchedPos = curPos;
+         kind = 0x7fffffff;
+      }
+      ++curPos;
+      if ((i = jjnewStateCnt) == (startsAt = 40 - (jjnewStateCnt = startsAt)))
+         return curPos;
+      try { curChar = input_stream.readChar(); }
+      catch(java.io.IOException e) { return curPos; }
+   }
+}
+static final int[] jjnextStates = {
+   26, 39, 1, 2, 5, 6, 7, 8, 5, 9, 6, 13, 17, 28, 32, 
+};
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, "\12", };
+public static final String[] lexStateNames = {
+   "DEFAULT", 
+};
+private ASCII_CharStream input_stream;
+private final int[] jjrounds = new int[40];
+private final int[] jjstateSet = new int[80];
+protected char curChar;
+public TemplateAnalyzerTokenManager(ASCII_CharStream stream)
+{
+   if (ASCII_CharStream.staticFlag)
+      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+   input_stream = stream;
+}
+public TemplateAnalyzerTokenManager(ASCII_CharStream stream, int lexState)
+{
+   this(stream);
+   SwitchTo(lexState);
+}
+public void ReInit(ASCII_CharStream stream)
+{
+   jjmatchedPos = jjnewStateCnt = 0;
+   curLexState = defaultLexState;
+   input_stream = stream;
+   ReInitRounds();
+}
+private final void ReInitRounds()
+{
+   int i;
+   jjround = 0x80000001;
+   for (i = 40; i-- > 0;)
+      jjrounds[i] = 0x80000000;
+}
+public void ReInit(ASCII_CharStream stream, int lexState)
+{
+   ReInit(stream);
+   SwitchTo(lexState);
+}
+public void SwitchTo(int lexState)
+{
+   if (lexState >= 1 || lexState < 0)
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+   else
+      curLexState = lexState;
+}
+
+private final Token jjFillToken()
+{
+   Token t = Token.newToken(jjmatchedKind);
+   t.kind = jjmatchedKind;
+   String im = jjstrLiteralImages[jjmatchedKind];
+   t.image = (im == null) ? input_stream.GetImage() : im;
+   t.beginLine = input_stream.getBeginLine();
+   t.beginColumn = input_stream.getBeginColumn();
+   t.endLine = input_stream.getEndLine();
+   t.endColumn = input_stream.getEndColumn();
+   return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+public final Token getNextToken() 
+{
+  int kind;
+  Token specialToken = null;
+  Token matchedToken;
+  int curPos = 0;
+
+  EOFLoop :
+  for (;;)
+  {   
+   try   
+   {     
+      curChar = input_stream.BeginToken();
+   }     
+   catch(java.io.IOException e)
+   {        
+      jjmatchedKind = 0;
+      matchedToken = jjFillToken();
+      return matchedToken;
+   }
+
+   jjmatchedKind = 0x7fffffff;
+   jjmatchedPos = 0;
+   curPos = jjMoveStringLiteralDfa0_0();
+   if (jjmatchedKind != 0x7fffffff)
+   {
+      if (jjmatchedPos + 1 < curPos)
+         input_stream.backup(curPos - jjmatchedPos - 1);
+         matchedToken = jjFillToken();
+         return matchedToken;
+   }
+   int error_line = input_stream.getEndLine();
+   int error_column = input_stream.getEndColumn();
+   String error_after = null;
+   boolean EOFSeen = false;
+   try { input_stream.readChar(); input_stream.backup(1); }
+   catch (java.io.IOException e1) {
+      EOFSeen = true;
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+      if (curChar == '\n' || curChar == '\r') {
+         error_line++;
+         error_column = 0;
+      }
+      else
+         error_column++;
+   }
+   if (!EOFSeen) {
+      input_stream.backup(1);
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+   }
+   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+  }
+}
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateBuilder.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateBuilder.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateBuilder.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,206 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import javassist.CannotCompileException;
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.CtConstructor;
+import javassist.CtField;
+import javassist.CtMethod;
+import javassist.CtNewMethod;
+import javassist.LoaderClassPath;
+import javassist.Modifier;
+import javassist.NotFoundException;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.Node;
+import org.dom4j.Text;
+
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Set;
+
+/** @author <a href="mailto:julien at jboss.org">Julien Viet</a> */
+public class TemplateBuilder
+{
+
+   private static final String CONTEXT = Context.class.getName();
+   private static final String ITERATOR = Iterator.class.getName();
+
+   private final ClassPool pool;
+   private final Element node;
+   private final int index;
+   private final Logger log;
+   private final Set propertyNames;
+   private CtClass cc;
+
+   public static int classNameCounter = 0;
+
+   public TemplateBuilder(Document doc, Set propertyNames)
+   {
+      this(doc.getRootElement(), propertyNames);
+   }
+
+   public TemplateBuilder(Element node, Set propertyNames)
+   {
+      this(new ClassPool(null), node, propertyNames);
+      pool.appendClassPath(new LoaderClassPath(Thread.currentThread().getContextClassLoader()));
+   }
+
+   public TemplateBuilder(ClassPool pool, Document doc, Set names)
+   {
+      this(pool, doc.getRootElement(), names);
+   }
+
+   public TemplateBuilder(ClassPool pool, Element node, Set names)
+   {
+      this.index = classNameCounter++;
+      this.pool = pool;
+      this.node = node;
+      this.propertyNames = names;
+      this.log = Logger.getLogger(getClass() + "." + index);
+   }
+
+   public CtClass getGeneratedClass()
+   {
+      return cc;
+   }
+
+   public void build() throws BuildException
+   {
+      try
+      {
+         cc = pool.makeClass("org.jboss.nukes.common.template.Generated" + index);
+         cc.setSuperclass(pool.get(Template.class.getName()));
+         cc.setModifiers(Modifier.PUBLIC);
+
+         addConstructor();
+         implementRender();
+      }
+      catch (CannotCompileException e)
+      {
+         throw new BuildException("Unexpected error, cannot build template", e);
+      }
+      catch (NotFoundException e)
+      {
+         throw new BuildException("Unexpected error, cannot build template", e);
+      }
+   }
+
+   private void addConstructor() throws CannotCompileException, NotFoundException
+   {
+      CtConstructor ctor = new CtConstructor(new CtClass[]{pool.get(CONTEXT)}, cc);
+      ctor.setBody("{ super($1); }");
+      cc.addConstructor(ctor);
+      log.debug("Added constructor on template " + cc.getName());
+   }
+
+   private void implementRender() throws CannotCompileException, NotFoundException
+   {
+      LinkedList stack = new LinkedList();
+      stack.add("");
+      StringBuffer buffer = new StringBuffer();
+      buffer.append("public void render(").append(Context.class.getName()).append(" ctx, ").append(Writer.class.getName()).append(" writer)\n").
+         append("{\n").
+         append("   ").append(CONTEXT).append(" ctx_ = $1;\n");
+      generateRender(stack, buffer, "   ", node);
+      buffer.append("}\n");
+      String code = buffer.toString();
+      CtMethod method = CtNewMethod.make(code, cc);
+      cc.addMethod(method);
+      CtField gc = new CtField(pool.get(String.class.getName()), "_generated_code", cc);
+      gc.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
+      CtField.Initializer initializer = CtField.Initializer.constant(code);
+      cc.addField(gc, initializer);
+      log.debug("Created render method on template " + cc.getName() + " with body " + code);
+   }
+
+   private void generateRender(LinkedList stack, StringBuffer buffer, String indent, Element node)
+   {
+      buffer.append(indent).append("String s_").append(stack.size()).append(" = null;\n");
+      for (Iterator i = node.content().iterator(); i.hasNext();)
+      {
+         Node item = (Node)i.next();
+         if (item instanceof Text)
+         {
+            String text = item.getText().trim();
+            text = org.jboss.portal.common.util.Tools.replace(text, "\n", "\\n");
+            text = org.jboss.portal.common.util.Tools.replace(text, "\"", "\\\"");
+            buffer.append(indent).append("$2.write(\"").append(text).append("\");\n");
+         }
+         else if (item instanceof Element)
+         {
+            Element elt = (Element)item;
+            if ("loop".equals(elt.getName()))
+            {
+               String name = elt.attributeValue("name");
+               String iterator = "it_" + name;
+               String context = "ctx_" + name;
+               buffer.append(indent).append("for (").append(ITERATOR).append(" ").append(iterator).append(" = ").append("ctx_").append(stack.getLast()).append(".childIterator(\"").append(name).append("\");").
+                  append(iterator).append(".hasNext();").
+                  append(")\n").
+                  append(indent).append("{\n").
+                  append(indent).append("   ").append(CONTEXT).append(" ").append(context).append(" = (").append(CONTEXT).append(")").append(iterator).append(".next();\n");
+               stack.add(name);
+               generateRender(stack, buffer, indent + "   ", elt.element("node"));
+               stack.removeLast();
+               buffer.append(indent).append("}\n");
+            }
+            else if ("ref".equals(elt.getName()))
+            {
+               String name = elt.attributeValue("name");
+               int depth = Integer.parseInt(elt.attributeValue("depth"));
+               String target = null;
+               if (depth == 0)
+               {
+                  target = propertyNames.contains(name) ? "$0.local" : "ctx_";
+               }
+               else
+               {
+                  target = "ctx_" + (String)stack.get(depth);
+               }
+               if (target != null)
+               {
+                  buffer.append(indent).append("s_").append(stack.size()).append(" = (java.lang.String)").append(target).append(".get(\"").append(name).append("\");\n").
+                     append(indent).append("if (s_").append(stack.size()).append(" != null)\n").
+                     append(indent).append("{\n").
+                     append(indent).append("   $2.write(s_").append(stack.size()).append(");\n").
+                     append(indent).append("}\n").
+                     append(indent).append("else if (log.isDebugEnabled())\n").
+                     append(indent).append("{\n").
+                     append(indent).append("   log.debug(\"field ").append(name).append(" is null\");\n").
+                     append(indent).append("}\n");
+               }
+               else
+               {
+//                  log.warn("Path not usable ");
+               }
+            }
+         }
+      }
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateBuilder.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateLoader.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateLoader.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateLoader.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,180 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import org.dom4j.Document;
+import org.jboss.portlet.forums.format.util.CLLoader;
+import org.jboss.portlet.forums.format.util.Loader;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 7374 $
+ */
+public class TemplateLoader extends TemplateRepository
+{
+
+   private Loader loader;
+//   private Map defaults = new HashMap();
+
+   public TemplateLoader(Loader loader)
+   {
+      setLoader(loader);
+   }
+
+   public Loader getLoader()
+   {
+      return loader;
+   }
+
+   public void setLoader(Loader loader)
+   {
+      if (loader == null)
+      {
+         throw new IllegalArgumentException("loader cannot be null");
+      }
+      this.loader = loader;
+   }
+
+//   public void load(String name)
+//   {
+//      InputStream in = loader.load(name + ".properties");
+//      if (in != null)
+//      {
+//         Properties props = new Properties();
+//      }
+//      else
+//      {
+//
+//      }
+//   }
+
+//   /**
+//    * Creates a template instance.
+//    */
+//   public Template createTemplate(String name)
+//   {
+//      Properties props = (Properties)defaults.get(name);
+//      Context ctx = Context.NULL_CONTEXT;
+//      if (props != null)
+//      {
+//         ctx = new HashContext();
+//         ctx.putAll(props);
+//      }
+//      return createTemplate(name, ctx);
+//   }
+
+//   public void addTemplate(String name)
+//   {
+//      addTemplate(name, name);
+//   }
+//
+//
+
+   public void addTemplate(String name, String loadName) throws BuildException
+   {
+      Document doc = loadTemplate(loadName);
+      addTemplate(name, doc);
+   }
+
+   public void addTemplate(String name, String loadName, Set names) throws BuildException
+   {
+      Document doc = loadTemplate(loadName);
+      addTemplate(name, doc, names);
+   }
+
+//   public void addSubTemplate(String templateName, String loadName, String xpath, Set names)
+//   {
+//      Document template = loadTemplate(loadName);
+//      addTemplate(templateName, (Element)template.selectSingleNode(xpath), names);
+//   }
+
+//   public void addSubTemplate(String templateName, String loadName, String xpath)
+//   {
+//      InputStream pin = null;
+//      try
+//      {
+//         Properties props = new Properties();
+//         pin = loader.loadProperties(loadName);
+//         if (pin != null)
+//         {
+//            defaults.put(loadName, props);
+//            props.load(pin);
+//         }
+//         addSubTemplate(templateName, props.keySet());
+//      }
+//      catch(IOException e)
+//      {
+//         e.printStackTrace();
+//      }
+//      finally
+//      {
+//         Tools.safeClose(pin);
+//      }
+//   }
+
+   /** Simply loads a template and returns it. */
+   public Document loadTemplate(String name) throws BuildException
+   {
+      InputStream tin = null;
+      try
+      {
+         tin = loader.load(name);
+         if (tin != null)
+         {
+            Reader reader = new InputStreamReader(tin);
+            TemplateParser parser = new TemplateParser(reader);
+            return parser.parse();
+         }
+         else
+         {
+            throw new BuildException("Template " + name + " not found");
+         }
+      }
+      catch (ParseException e)
+      {
+         throw new BuildException("Cannot parse the template source " + name, e);
+      }
+      finally
+      {
+         try
+         {
+            tin.close();
+         }
+         catch (IOException e)
+         {
+             throw new BuildException("Could not close templates InputStreamReader."+name,e);
+         }
+      }
+   }
+
+   public static TemplateLoader create(ClassLoader cl, String base)
+   {
+      return new TemplateLoader(new CLLoader(cl, base));
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateLoader.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateParser.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateParser.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateParser.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,192 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.LinkedList;
+
+/** @author <a href="mailto:julien at jboss.org">Julien Viet</a> */
+public final class TemplateParser
+   implements TemplateAnalyzerConstants
+{
+
+   private Reader source;
+   private TemplateAnalyzerTokenManager analyzer;
+   private LinkedList stack = new LinkedList();
+   private Document template;
+   private Element current;
+   private StringBuffer text = null;
+
+   public TemplateParser(File source) throws FileNotFoundException
+   {
+      this(new FileReader(source));
+   }
+
+   public TemplateParser(String source)
+   {
+      this(new StringReader(source));
+   }
+
+   public TemplateParser(Reader source)
+   {
+      this.source = source;
+      analyzer = new TemplateAnalyzerTokenManager(new ASCII_CharStream(source, 1, 1));
+      template = DocumentFactory.getInstance().createDocument();
+      current = template.addElement("node");
+   }
+
+   /** This method should be called only once. If it is called more than once there are no garanty on the result. */
+   public Document parse() throws ParseException
+   {
+      while (true)
+      {
+         // getChild the next token
+         Token t = analyzer.getNextToken();
+
+         if (t.image.length() == 0)
+         {
+            if (text != null)
+            {
+               current.addText(text.toString());
+               text = null;
+            }
+
+            // no more token to read
+            if (current != template.getRootElement())
+            {
+               throw new ParseException("An opening loop is not closed");
+            }
+            return template;
+         }
+
+         switch (t.kind)
+         {
+            case BEGIN:
+               if (text != null)
+               {
+                  current.addText(text.toString());
+                  text = null;
+               }
+               Element loop = current.addElement("loop");
+               loop.addAttribute("name", t.image.substring("<!-- BEGIN ".length(), t.image.length() - " -->".length()));
+               push(loop.addElement("node"));
+               break;
+
+            case END:
+               if (text != null)
+               {
+                  current.addText(text.toString());
+                  text = null;
+               }
+               if (!"node".equals(current.getName()))
+               {
+                  throw new ParseException("Unexpected closing loop");
+               }
+               pop();
+//            if (!((Loop)current.getContent().getLast()).validate(t.image))
+//            {
+//               throw new ParseException("Closing loop does not match");
+//            }
+               break;
+
+            case PROPERTY:
+            case TEXT:
+               if (text == null)
+               {
+                  text = new StringBuffer();
+               }
+               text.append(t.image);
+               break;
+            case NEWLINE:
+               if (text == null)
+               {
+                  text = new StringBuffer();
+               }
+               text.append("\n");
+               break;
+
+
+            case REF:
+               if (text != null)
+               {
+                  current.addText(text.toString());
+                  text = null;
+               }
+               Element ref = current.addElement("ref");
+               String tmp = t.image.substring(1, t.image.length() - 1);
+               int count = 0;
+               int previous = -1;
+               while (true)
+               {
+                  int index = tmp.indexOf('.', previous + 1);
+                  if (index == -1)
+                  {
+                     String name = tmp.substring(previous + 1);
+                     ref.addAttribute("name", name);
+                     break;
+                  }
+                  count++;
+                  previous = index;
+               }
+               ref.addAttribute("depth", "" + count);
+               break;
+
+            default:
+               throw new ParseException("Unexpected token");
+         }
+      }
+   }
+
+   public void close()
+   {
+      try
+      {
+         source.close();
+      }
+      catch (IOException ignore)
+      {
+         //
+      }
+   }
+
+   private void push(Element node)
+   {
+      stack.addLast(current);
+      current = node;
+   }
+
+   private void pop()
+   {
+      current = (Element)stack.removeLast();
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateParser.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateRepository.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateRepository.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateRepository.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,198 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+import javassist.CannotCompileException;
+import javassist.CtClass;
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.Element;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/** @author <a href="mailto:julien at jboss.org">Julien Viet</a> */
+public class TemplateRepository
+{
+
+   /** The class logger. */
+   private final Logger log = Logger.getLogger(getClass());
+
+   /** Template name -> template object. */
+   private Map templates = new HashMap();
+
+   /** Template name -> Class object. */
+   private Map classes = new HashMap();
+
+   /** Compile the template definitions to bytecode. */
+   private TemplateClassLoader tcl = new TemplateClassLoader(Thread.currentThread().getContextClassLoader());
+
+   public TemplateRepository()
+   {
+   }
+
+   public Template createTemplate(String name)
+   {
+      return createTemplate(name, Context.NULL_CONTEXT);
+   }
+
+   /**
+    * Creates a new template instance.
+    *
+    * @param name the template name
+    * @param ctx  the context with the template properties
+    * @return the template instance or null if it is not found
+    */
+   public Template createTemplate(String name, Context ctx)
+   {
+      Template template = null;
+      try
+      {
+         Class clazz = (Class)classes.get(name);
+         if (clazz != null)
+         {
+            Constructor ctor = clazz.getConstructor(new Class[]{Context.class});
+            template = (Template)ctor.newInstance(new Object[]{ctx});
+         }
+         else
+         {
+            log.warn("Template " + name + " not found");
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot instantiate template " + name, e);
+         throw new RuntimeException("An unexpected exception occured during the template instantiation");
+      }
+      return template;
+   }
+
+   public void addTemplate(String name, Document doc) throws BuildException
+   {
+      addTemplate(name, doc, Collections.EMPTY_SET);
+   }
+
+   public void addTemplate(String name, Element node) throws BuildException
+   {
+      addTemplate(name, node, Collections.EMPTY_SET);
+   }
+
+   public void addTemplate(String name, Document doc, Set names) throws BuildException
+   {
+      addTemplate(name, doc.getRootElement(), names);
+   }
+
+   public void addTemplate(String name, Element node, Set names) throws BuildException
+   {
+      // Keep the original template
+      templates.put(name, node);
+      log.debug("Loaded template " + name);
+
+      // Generate the class
+      Class clazz = generate(node, names);
+      log.debug("Template " + name + " generated " + clazz.getName());
+
+      // Save the class for later
+      classes.put(name, clazz);
+   }
+
+   private Class generate(Element node, Set names) throws BuildException
+   {
+      try
+      {
+         // This is the classloader that will load the template
+         String className = tcl.addTemplate(node, names);
+
+         // Return the class corresponding to the template
+         return tcl.loadClass(className);
+      }
+      catch (ClassNotFoundException e)
+      {
+         throw new BuildException("Unexpected error, cannot compile template", e);
+      }
+   }
+
+   public void clear()
+   {
+      classes.clear();
+      templates.clear();
+      tcl = new TemplateClassLoader(Thread.currentThread().getContextClassLoader());
+   }
+
+   public static class TemplateClassLoader extends ClassLoader
+   {
+
+      private final Map classes;
+
+      public TemplateClassLoader(ClassLoader parent)
+      {
+         super(parent);
+         this.classes = new HashMap();
+      }
+
+      public String addTemplate(Document doc, Set names) throws BuildException
+      {
+         return addTemplate(doc.getRootElement(), names);
+      }
+
+      public String addTemplate(Element node, Set names) throws BuildException
+      {
+         try
+         {
+            TemplateBuilder builder = new TemplateBuilder(node, names);
+            builder.build();
+            CtClass cc = builder.getGeneratedClass();
+            classes.put(cc.getName(), cc.toBytecode());
+            return cc.getName();
+         }
+         catch (IOException e)
+         {
+            throw new BuildException("Unexpected error cannot compile template", e);
+         }
+         catch (CannotCompileException e)
+         {
+            throw new BuildException("Unexpected error cannot compile template", e);
+         }
+      }
+
+      public Collection getClassNames()
+      {
+         return Collections.unmodifiableCollection(classes.keySet());
+      }
+
+      protected Class findClass(String name) throws ClassNotFoundException
+      {
+         byte[] bytes = (byte[])classes.get(name);
+         if (bytes == null)
+         {
+            throw new ClassNotFoundException("Class " + name + " does not exists");
+         }
+         return defineClass(name, bytes, 0, bytes.length);
+      }
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TemplateRepository.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Token.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Token.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/Token.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,104 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token {
+
+  /**
+   * An integer that describes the kind of this token.  This numbering
+   * system is determined by JavaCCParser, and a table of these numbers is
+   * stored in the file ...Constants.java.
+   */
+  public int kind;
+
+  /**
+   * beginLine and beginColumn describe the position of the first character
+   * of this token; endLine and endColumn describe the position of the
+   * last character of this token.
+   */
+  public int beginLine, beginColumn, endLine, endColumn;
+
+  /**
+   * The string image of the token.
+   */
+  public String image;
+
+  /**
+   * A reference to the next regular (non-special) token from the input
+   * stream.  If this is the last token from the input stream, or if the
+   * token manager has not read tokens beyond this one, this field is
+   * set to null.  This is true only if this token is also a regular
+   * token.  Otherwise, see below for a description of the contents of
+   * this field.
+   */
+  public Token next;
+
+  /**
+   * This field is used to access special tokens that occur prior to this
+   * token, but after the immediately preceding regular (non-special) token.
+   * If there are no such special tokens, this field is set to null.
+   * When there are more than one such special token, this field refers
+   * to the last of these special tokens, which in turn refers to the next
+   * previous special token through its specialToken field, and so on
+   * until the first special token (whose specialToken field is null).
+   * The next fields of special tokens refer to other special tokens that
+   * immediately follow it (without an intervening regular token).  If there
+   * is no such token, this field is null.
+   */
+  public Token specialToken;
+
+  /**
+   * Returns the image.
+   */
+  public final String toString()
+  {
+     return image;
+  }
+
+  /**
+   * Returns a new Token object, by default. However, if you want, you
+   * can create and return subclass objects based on the value of ofKind.
+   * Simply add the cases to the switch for all those special cases.
+   * For example, if you have a subclass of Token called IDToken that
+   * you want to create if ofKind is ID, simlpy add something like :
+   *
+   *    case MyParserConstants.ID : return new IDToken();
+   *
+   * to the following switch statement. Then you can cast matchedToken
+   * variable to the appropriate type and use it in your lexical actions.
+   */
+  public static final Token newToken(int ofKind)
+  {
+     switch(ofKind)
+     {
+       default : return new Token();
+     }
+  }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TokenMgrError.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TokenMgrError.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/template/TokenMgrError.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,156 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 0.7pre2 */
+
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.template;
+
+public class TokenMgrError extends Error
+{
+   /*
+    * Ordinals for various reasons why an Error of this type can be thrown.
+    */
+
+   /**
+    * Lexical error occured.
+    */
+   static final int LEXICAL_ERROR = 0;
+
+   /**
+    * An attempt wass made to create a second instance of a static token manager.
+    */
+   static final int STATIC_LEXER_ERROR = 1;
+
+   /**
+    * Tried to change to an invalid lexical state.
+    */
+   static final int INVALID_LEXICAL_STATE = 2;
+
+   /**
+    * Detected (and bailed out of) an infinite loop in the token manager.
+    */
+   static final int LOOP_DETECTED = 3;
+
+   /**
+    * Indicates the reason why the exception is thrown. It will have
+    * one of the above 4 values.
+    */
+   int errorCode;
+
+   /**
+    * Replaces unprintable characters by their espaced (or unicode escaped)
+    * equivalents in the given string
+    */
+   protected static final String addEscapes(String str) {
+      StringBuffer retval = new StringBuffer();
+      char ch;
+      for (int i = 0; i < str.length(); i++) {
+        switch (str.charAt(i))
+        {
+           case 0 :
+              continue;
+           case '\b':
+              retval.append("\\b");
+              continue;
+           case '\t':
+              retval.append("\\t");
+              continue;
+           case '\n':
+              retval.append("\\n");
+              continue;
+           case '\f':
+              retval.append("\\f");
+              continue;
+           case '\r':
+              retval.append("\\r");
+              continue;
+           case '\"':
+              retval.append("\\\"");
+              continue;
+           case '\'':
+              retval.append("\\\'");
+              continue;
+           case '\\':
+              retval.append("\\\\");
+              continue;
+           default:
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                 String s = "0000" + Integer.toString(ch, 16);
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+              } else {
+                 retval.append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.toString();
+   }
+
+   /**
+    * Returns a detailed message for the Error when it is thrown by the
+    * token manager to indicate a lexical error.
+    * Parameters : 
+    *    EOFSeen     : indicates if EOF caused the lexicl error
+    *    curLexState : lexical state in which this error occured
+    *    errorLine   : line number when the error occured
+    *    errorColumn : column number when the error occured
+    *    errorAfter  : prefix that was seen before this error occured
+    *    curchar     : the offending character
+    * Note: You can customize the lexical error message by modifying this method.
+    */
+   private static final String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+      return("Lexical error at line " +
+           errorLine + ", column " +
+           errorColumn + ".  Encountered: " +
+           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+           "after : \"" + addEscapes(errorAfter) + "\"");
+   }
+
+   /**
+    * You can also modify the body of this method to customize your error messages.
+    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+    * of end-users concern, so you can return something like : 
+    *
+    *     "Internal Error : Please file a bug report .... "
+    *
+    * from this method for such cases in the release version of your parser.
+    */
+   public String getMessage() {
+      return super.getMessage();
+   }
+
+   /*
+    * Constructors of various flavors follow.
+    */
+
+   public TokenMgrError() {
+   }
+
+   public TokenMgrError(String message, int reason) {
+      super(message);
+      errorCode = reason;
+   }
+
+   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+   }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/CLLoader.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/CLLoader.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/CLLoader.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.util;
+
+import java.io.InputStream;
+
+/**
+ * Loader implementation that loads through a ClassLoader.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CLLoader implements Loader
+{
+
+   private final ClassLoader cl;
+   private String base;
+
+   public CLLoader()
+   {
+      this(Thread.currentThread().getContextClassLoader(), null);
+   }
+
+   public CLLoader(ClassLoader cl, String base)
+   {
+      this.cl = cl;
+      setBase(base);
+   }
+
+   public CLLoader(ClassLoader cl)
+   {
+      this(cl, null);
+   }
+
+   public CLLoader(String base)
+   {
+      this(Thread.currentThread().getContextClassLoader(), base);
+   }
+
+   public String getBase()
+   {
+      return base;
+   }
+
+   public void setBase(String base)
+   {
+      this.base = base != null ? base : "";
+   }
+
+   public InputStream load(String name)
+   {
+      return cl.getResourceAsStream(base.length() == 0 ? name.substring(1) : base + name);
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/CLLoader.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/EntityTable.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/EntityTable.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/EntityTable.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,366 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.util;
+
+/** This table provides lookup for converting a char to its HTML entity representation. */
+public class EntityTable
+{
+
+   /** All HTML entities. */
+   public static final EntityTable FULL = new EntityTable();
+
+   /** All HTML entities except the HTML chars which are used to do HTML itself. */
+   public static final EntityTable BASIC = new BasicEntityTable();
+
+   private static class BasicEntityTable extends EntityTable
+   {
+      public BasicEntityTable()
+      {
+         remove('<');
+         remove('>');
+         remove('"');
+         remove('&');
+      }
+   }
+
+   private String[] charToEntity = new String[65536];
+
+   protected EntityTable()
+   {
+      put(160, "nbsp");
+      put(161, "iexcl");
+      put(162, "cent");
+      put(163, "pound");
+      put(164, "curren");
+      put(165, "yen");
+      put(166, "brvbar");
+      put(167, "sect");
+      put(168, "uml");
+      put(169, "copy");
+      put(170, "ordf");
+      put(171, "laquo");
+      put(172, "not");
+      put(173, "shy");
+      put(174, "reg");
+      put(175, "macr");
+      put(176, "deg");
+      put(177, "plusmn");
+      put(178, "sup2");
+      put(179, "sup3");
+      put(180, "acute");
+      put(181, "micro");
+      put(182, "para");
+      put(183, "middot");
+      put(184, "cedil");
+      put(185, "sup1");
+      put(186, "ordm");
+      put(187, "raquo");
+      put(188, "frac14");
+      put(189, "frac12");
+      put(190, "frac34");
+      put(191, "iquest");
+      put(192, "Agrave");
+      put(193, "Aacute");
+      put(194, "Acirc");
+      put(195, "Atilde");
+      put(196, "Auml");
+      put(197, "Aring");
+      put(198, "AElig");
+      put(199, "Ccedil");
+      put(200, "Egrave");
+      put(201, "Eacute");
+      put(202, "Ecirc");
+      put(203, "Euml");
+      put(204, "Igrave");
+      put(205, "Iacute");
+      put(206, "Icirc");
+      put(207, "Iuml");
+      put(208, "ETH");
+      put(209, "Ntilde");
+      put(210, "Ograve");
+      put(211, "Oacute");
+      put(212, "Ocirc");
+      put(213, "Otilde");
+      put(214, "Ouml");
+      put(215, "times");
+      put(216, "Oslash");
+      put(217, "Ugrave");
+      put(218, "Uacute");
+      put(219, "Ucirc");
+      put(220, "Uuml");
+      put(221, "Yacute");
+      put(222, "THORN");
+      put(223, "szlig");
+      put(224, "agrave");
+      put(225, "aacute");
+      put(226, "acirc");
+      put(227, "atilde");
+      put(228, "auml");
+      put(229, "aring");
+      put(230, "aelig");
+      put(231, "ccedil");
+      put(232, "egrave");
+      put(233, "eacute");
+      put(234, "ecirc");
+      put(235, "euml");
+      put(236, "igrave");
+      put(237, "iacute");
+      put(238, "icirc");
+      put(239, "iuml");
+      put(240, "eth");
+      put(241, "ntilde");
+      put(242, "ograve");
+      put(243, "oacute");
+      put(244, "ocirc");
+      put(245, "otilde");
+      put(246, "ouml");
+      put(247, "divide");
+      put(248, "oslash");
+      put(249, "ugrave");
+      put(250, "uacute");
+      put(251, "ucirc");
+      put(252, "uuml");
+      put(253, "yacute");
+      put(254, "thorn");
+      put(255, "yuml");
+      put(402, "fnof");
+      put(913, "Alpha");
+      put(914, "Beta");
+      put(915, "Gamma");
+      put(916, "Delta");
+      put(917, "Epsilon");
+      put(918, "Zeta");
+      put(919, "Eta");
+      put(920, "Theta");
+      put(921, "Iota");
+      put(922, "Kappa");
+      put(923, "Lambda");
+      put(924, "Mu");
+      put(925, "Nu");
+      put(926, "Xi");
+      put(927, "Omicron");
+      put(928, "Pi");
+      put(929, "Rho");
+      put(931, "Sigma");
+      put(932, "Tau");
+      put(933, "Upsilon");
+      put(934, "Phi");
+      put(935, "Chi");
+      put(936, "Psi");
+      put(937, "Omega");
+      put(945, "alpha");
+      put(946, "beta");
+      put(947, "gamma");
+      put(948, "delta");
+      put(949, "epsilon");
+      put(950, "zeta");
+      put(951, "eta");
+      put(952, "theta");
+      put(953, "iota");
+      put(954, "kappa");
+      put(955, "lambda");
+      put(956, "mu");
+      put(957, "nu");
+      put(958, "xi");
+      put(959, "omicron");
+      put(960, "pi");
+      put(961, "rho");
+      put(962, "sigmaf");
+      put(963, "sigma");
+      put(964, "tau");
+      put(965, "upsilon");
+      put(966, "phi");
+      put(967, "chi");
+      put(968, "psi");
+      put(969, "omega");
+      put(977, "thetasym");
+      put(978, "upsih");
+      put(982, "piv");
+      put(8226, "bull");
+      put(8230, "hellip");
+      put(8242, "prime");
+      put(8243, "Prime");
+      put(8254, "oline");
+      put(8260, "frasl");
+      put(8472, "weierp");
+      put(8465, "image");
+      put(8476, "real");
+      put(8482, "trade");
+      put(8501, "alefsym");
+      put(8592, "larr");
+      put(8593, "uarr");
+      put(8594, "rarr");
+      put(8595, "darr");
+      put(8596, "harr");
+      put(8629, "crarr");
+      put(8656, "lArr");
+      put(8657, "uArr");
+      put(8658, "rArr");
+      put(8659, "dArr");
+      put(8660, "hArr");
+      put(8704, "forall");
+      put(8706, "part");
+      put(8707, "exist");
+      put(8709, "empty");
+      put(8711, "nabla");
+      put(8712, "isin");
+      put(8713, "notin");
+      put(8715, "ni");
+      put(8719, "prod");
+      put(8721, "sum");
+      put(8722, "minus");
+      put(8727, "lowast");
+      put(8730, "radic");
+      put(8733, "prop");
+      put(8734, "infin");
+      put(8736, "ang");
+      put(8743, "and");
+      put(8744, "or");
+      put(8745, "cap");
+      put(8746, "cup");
+      put(8747, "int");
+      put(8756, "there4");
+      put(8764, "sim");
+      put(8773, "cong");
+      put(8776, "asymp");
+      put(8800, "ne");
+      put(8801, "equiv");
+      put(8804, "le");
+      put(8805, "ge");
+      put(8834, "sub");
+      put(8835, "sup");
+      put(8836, "nsub");
+      put(8838, "sube");
+      put(8839, "supe");
+      put(8853, "oplus");
+      put(8855, "otimes");
+      put(8869, "perp");
+      put(8901, "sdot");
+      put(8968, "lceil");
+      put(8969, "rceil");
+      put(8970, "lfloor");
+      put(8971, "rfloor");
+      put(9001, "lang");
+      put(9002, "rang");
+      put(9674, "loz");
+      put(9824, "spades");
+      put(9827, "clubs");
+      put(9829, "hearts");
+      put(9830, "diams");
+      put(34, "quot");
+      put(38, "amp");
+      put(60, "lt");
+      put(62, "gt");
+      put(338, "OElig");
+      put(339, "oelig");
+      put(352, "Scaron");
+      put(353, "scaron");
+      put(376, "Yuml");
+      put(710, "circ");
+      put(732, "tilde");
+      put(8194, "ensp");
+      put(8195, "emsp");
+      put(8201, "thinsp");
+      put(8204, "zwnj");
+      put(8205, "zwj");
+      put(8206, "lrm");
+      put(8207, "rlm");
+      put(8211, "ndash");
+      put(8212, "mdash");
+      put(8216, "lsquo");
+      put(8217, "rsquo");
+      put(8218, "sbquo");
+      put(8220, "ldquo");
+      put(8221, "rdquo");
+      put(8222, "bdquo");
+      put(8224, "dagger");
+      put(8225, "Dagger");
+      put(8240, "permil");
+      put(8249, "lsaquo");
+      put(8250, "rsaquo");
+      put(8364, "euro");
+   }
+
+   protected final void put(int c, String entity)
+   {
+      charToEntity[c] = entity;
+   }
+
+   protected final void remove(int c)
+   {
+      charToEntity[c] = null;
+   }
+
+   /** Returns null if no entity is found or return the converted entity. */
+   public final String lookup(char c)
+   {
+      return charToEntity[c];
+   }
+
+   public final String convertEntities(String txt)
+   {
+      // Get the chars it's faster
+      char[] chars = txt.toCharArray();
+
+      // The new result if any
+      StringBuffer result = null;
+
+      // The index of the last copied char
+      int previous = 0;
+
+      // Perform lookup char by char
+      for (int current = 0; current < chars.length; current++)
+      {
+         // Lookup
+         String replacement = lookup(chars[current]);
+
+         // Do we have a replacement
+         if (replacement != null)
+         {
+            // We lazy create the result
+            if (result == null)
+            {
+               // Allocate 1/2 more than the current txt size
+               result = new StringBuffer(txt.length() * 3 / 2);
+            }
+            // Append the previous chars if any
+            result.append(chars, previous, current - previous);
+            // Append the replaced entity
+            result.append('&').append(replacement).append(';');
+            // Update the previous pointer
+            previous = current + 1;
+         }
+      }
+
+      // If we have a result we need to complete it
+      if (result != null)
+      {
+         result.append(chars, previous, chars.length - previous);
+         return result.toString();
+      }
+      else
+      {
+         return txt;
+      }
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/EntityTable.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Loader.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Loader.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Loader.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.util;
+
+import java.io.InputStream;
+
+/**
+ * A generic interface which define loading capabilities. The name format must follow the regular expression :
+ * ^(/[-a-zA-Z0-9_\.]+)+$
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface Loader
+{
+
+   String NAME_VALIDATOR = "^(/[-a-zA-Z0-9_\\.]+)+$";
+
+   /** Returns an InputStream or null if not found. */
+   InputStream load(String path);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Loader.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Stack.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Stack.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Stack.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.format.util;
+
+import java.util.Collections;
+import java.util.Iterator;
+
+/**
+ * The goal of this class is to ensure that any event with open/close well formdness semantics are respected.
+ * <p/>
+ * This class maintain a stack of keys.
+ * <p/>
+ * To be operational this class must be subclassed to provide semantics that the user wants to give to the key
+ * identities.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class Stack
+{
+
+   /** The stack pointer which always points the first available element. */
+   protected int ptr = 0;
+
+   /** The stack holder. */
+   protected Key[] stack;
+
+   /** The reusable iterator. */
+   private KeyIterator iterator = new KeyIterator();
+
+   /** Create a new stack with a specified depth. */
+   public Stack(int initalCapacity)
+   {
+      this.stack = new Key[initalCapacity];
+      for (int i = 0; i < stack.length; i++)
+      {
+         this.stack[i] = createKey();
+      }
+   }
+
+   /** Reset the stack state. */
+   public final void reset()
+   {
+      ptr = 0;
+   }
+
+   /** Push a key on the stack. */
+   public final Key push()
+   {
+      if (ptr == stack.length)
+      {
+         enlarge();
+      }
+      return stack[ptr++];
+   }
+
+   /** Peek a key on the stack. */
+   public Key peek(int level)
+   {
+      level = ptr - 1 - level;
+      return level >= 0 ? stack[level] : null;
+   }
+
+   /** Pop keys until it finds the good one. */
+   public final Iterator pop(Key candidate)
+   {
+      if (ptr > 0)
+      {
+         iterator.from = ptr - 1;
+         for (Key key = stack[--ptr]; !equals(candidate, key) && ptr >= 1; key = stack[--ptr])
+         {
+            ;
+         }
+         iterator.to = ptr - 1;
+         return iterator;
+      }
+      else
+      {
+         // This is a warn because it is not possible to pop with empty stack
+         return Collections.EMPTY_LIST.iterator();
+      }
+   }
+
+   /** The implementation must provide a reusable key. */
+   protected abstract Key createKey();
+
+   /** The implementation must test keys equality. */
+   protected abstract boolean equals(Key key1, Key key2);
+
+   /** Enlarge the key stack. For now it simply add 3 keys to the actual length */
+   protected void enlarge()
+   {
+      Key[] tmp = new Key[stack.length + 3];
+      System.arraycopy(stack, 0, tmp, 0, stack.length);
+      for (int i = stack.length; i < tmp.length; i++)
+      {
+         tmp[i] = createKey();
+      }
+      stack = tmp;
+   }
+
+   /** Iterates over the poped keys. */
+   public class KeyIterator implements Iterator
+   {
+      private int from;
+      private int to;
+
+      public boolean hasNext()
+      {
+         return from > to;
+      }
+
+      public Object next()
+      {
+         return stack[from--];
+      }
+
+      public void remove()
+      {
+         throw new UnsupportedOperationException();
+      }
+   }
+
+   /** A key for the stack. */
+   public interface Key
+   {
+   }
+
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer();
+      buffer.append("[stack[");
+      for (int i = 0; i < ptr; i++)
+      {
+         Stack.Key key = stack[i];
+         buffer.append(i == 0 ? "" : ",").append(key);
+      }
+      buffer.append("]]");
+      return buffer.toString();
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/format/util/Stack.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/FileBinding.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/FileBinding.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/FileBinding.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.helper;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1018 $
+ */
+
+public class FileBinding
+{
+
+   protected String fileId;
+   protected String fileName;
+   protected String comment;
+
+   public FileBinding()
+   {
+
+   }
+
+   public String getFileId()
+   {
+      return fileId;
+   }
+
+   public void setFileId(String fileId)
+   {
+      this.fileId = fileId;
+   }
+
+   public String getFileName()
+   {
+      return fileName;
+   }
+
+   public void setFileName(String realName)
+   {
+      this.fileName = realName;
+   }
+
+   public String getComment()
+   {
+      return comment;
+   }
+
+   public void setComment(String comment)
+   {
+      this.comment = comment;
+   }
+}
+
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/FileBinding.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/TempFileBinding.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/TempFileBinding.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/TempFileBinding.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,186 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.helper;
+
+import org.jboss.portlet.forums.model.UploadedFile;
+import org.jboss.portlet.forums.model.Attachment;
+import org.jboss.portlet.forums.impl.UploadedFileImpl;
+import org.jboss.portlet.forums.impl.AttachmentImpl;
+import org.hibernate.Hibernate;
+
+import java.io.IOException;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
+
+
+/**
+ * Provides binding to temp file stored to disk.
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1018 $
+ */
+public class TempFileBinding extends FileBinding
+{
+   private String filePath;
+
+   private String contentType;
+   //private String fileID;
+
+   /**
+    * Creates TempFileBinding. Content will be strored in temporary file using File.createTempFile
+    * @param contentType
+    * @param content
+    * @param name
+    * @param id
+    * @throws IOException
+    */
+   public TempFileBinding(String contentType, byte[] content, String name, String id) throws IOException
+   {
+      setContentType(contentType);
+      setFileName(name);
+      setFileId(id);
+      File tmpFile = File.createTempFile(id, "portal-forums-tmpfile");
+      setFilePath(tmpFile.getCanonicalPath());
+      FileOutputStream fo = new FileOutputStream(tmpFile);
+      fo.write(content);
+
+      fo.close();
+   }
+
+   /**
+    * Deletes stored on disk file.
+    */
+   public void delete()
+   {
+      File file = new File(filePath);
+      if (!file.delete())
+      {
+         file.deleteOnExit();
+      }
+   }
+
+   public String getFilePath()
+   {
+      return filePath;
+   }
+
+   public void setFilePath(String filePath)
+   {
+      this.filePath = filePath;
+   }
+
+
+   public String getContentType()
+   {
+      return contentType;
+   }
+
+   public void setContentType(String contentType)
+   {
+      this.contentType = contentType;
+   }
+
+   /**
+    * produces UploadedFile from stored on disk file.
+    * @return
+    */
+   public UploadedFile produceUploadedFile()
+   {
+      File tmp = new File(this.filePath);
+
+      try
+      {
+         /*Blob content = Hibernate.createBlob(getBytesFromFile(tmp));
+   return new UploadedFileImpl(contentType, content, fileName, tmp.length() );*/
+         return new UploadedFileImpl(contentType, getBytesFromFile(tmp), fileName, tmp.length());
+      }
+      catch (FileNotFoundException e)
+      {
+         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+      }
+      catch (IOException e)
+      {
+         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+      }
+      return null;
+   }
+
+   /**
+    * produces Attachment object form stored on disk file
+    * @return
+    */
+   public Attachment produceAttachment()
+   {
+      Attachment attach = new AttachmentImpl();
+      attach.setComment(comment);
+      attach.setFile(produceUploadedFile());
+      return attach;
+   }
+
+   // Returns the contents of the file in a byte array.
+   public static byte[] getBytesFromFile(File file) throws IOException
+   {
+      InputStream is = new FileInputStream(file);
+
+      // Get the size of the file
+      long length = file.length();
+
+      // You cannot create an array using a long type.
+      // It needs to be an int type.
+      // Before converting to an int type, check
+      // to ensure that file is not larger than Integer.MAX_VALUE.
+      if (length > Integer.MAX_VALUE)
+      {
+         //TODO:BD To long file - do smthng...
+         // File is too large
+      }
+
+      // Create the byte array to hold the data
+      byte[] bytes = new byte[(int)length];
+
+      // Read in the bytes
+      int offset = 0;
+      int numRead = 0;
+      while (offset < bytes.length
+         && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0)
+      {
+         offset += numRead;
+      }
+
+      // Ensure all the bytes have been read in
+      if (offset < bytes.length)
+      {
+         throw new IOException("Could not completely read file " + file.getName());
+      }
+
+      // Close the input stream and return bytes
+      is.close();
+      return bytes;
+   }
+
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/helper/TempFileBinding.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/AttachmentImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/AttachmentImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/AttachmentImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import org.jboss.portlet.forums.model.Attachment;
+import org.jboss.portlet.forums.model.UploadedFile;
+import org.jboss.portlet.forums.model.Post;
+
+import java.io.Serializable;
+
+/**
+ * Created on 29 juil. 2004
+ * @author theute
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * $Revision: 1018 $
+ */
+public class AttachmentImpl implements Attachment, Serializable
+{
+   private Integer id;
+   private UploadedFile file;
+   private String comment;
+   private Post post;
+
+
+   public AttachmentImpl()
+   {
+
+   }
+
+   /**
+    */
+   public String getComment() {
+      return comment;
+   }
+   /**
+    * @param comment The comment to set.
+    */
+   public void setComment(String comment) {
+      this.comment = comment;
+   }
+
+   /**
+    */
+   public UploadedFile getFile() {
+      return file;
+   }
+   /**
+    * @param file The file to set.
+    */
+   public void setFile(UploadedFile file) {
+      this.file = file;
+   }
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   public void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /**
+    */
+   public Post getPost()
+   {
+      return post;
+   }
+
+   public void setPost(Post post)
+   {
+      this.post = post;
+   }
+}
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/AttachmentImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Indexed;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+
+//Luca Stancapiano - import
+import org.jboss.portlet.forums.model.ForumInstance;
+
+/**
+ * Category of forums.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+ at Indexed(index="categories")
+public class CategoryImpl
+   implements Serializable,
+   Category
+{
+   private List forums;
+   /* Luca Stancapiano - forumInstance field to tie category to it, so that
+      each forum can to get different categories
+   */
+   private ForumInstance forumInstance;
+   private int order;
+   private String title;
+   
+   @DocumentId
+   private Integer id;
+
+   /**
+    * Creates a new {@link CategoryImpl} object.
+    */
+   public CategoryImpl()
+   {
+      setForums(new ArrayList());
+   }
+
+   /**
+    */
+   public List getForums()
+   {
+      return forums;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   public void setForums(List value)
+   {
+      forums = value;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   public void addForum(Forum value)
+   {
+      value.setCategory(this);
+      forums.add(value);
+   }
+
+   /**
+    */
+   public int getOrder()
+   {
+      return order;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param order DOCUMENT_ME
+    */
+   public void setOrder(int order)
+   {
+      this.order = order;
+   }
+
+   /**
+    */
+   public String getTitle()
+   {
+      return title;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param title DOCUMENT_ME
+    */
+   public void setTitle(String title)
+   {
+      this.title = title;
+   }
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   private void setId(Integer id)
+   {
+      this.id = id;
+   }
+   
+   /* Luca Stancapiano start - I add accessors to manage ForumInstance field 
+       so Category is tied to the Forum Instance. Now each category belong to a
+       Forum Instance so that we can to get different instances of forums with different
+       categories and different sub objects
+   */
+   public ForumInstance getForumInstance()
+   {
+      return forumInstance;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    */
+   public void setForumInstance(ForumInstance forumInstance)
+   {
+      this.forumInstance = forumInstance;
+   }
+   // Luca Stancapiano end
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,421 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.hibernate.Query;
+
+import org.hibernate.Session;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.search.annotations.Store;
+
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+
+/**
+ * Category of forums.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * @version $Revision: 1124 $
+ */
+ at Indexed(index="forums")
+public class ForumImpl
+   implements Serializable,
+   Forum
+{
+   /**
+    * Creates a new {@link ForumImpl} object.
+    */
+   public ForumImpl()
+   {
+      setTopics(new ArrayList());
+   }
+
+   @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.CategoryImpl.class)
+   private Category category;
+   private String description;
+   
+   @DocumentId
+   private Integer id;
+   //private Post       lastPost;
+   
+   @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+   private String name;
+   private int order;
+   private int        topicCount;
+   private int        postCount;
+   //private boolean pruneEnable;
+   //private int pruneNext;
+   private int status;
+   private List topics;
+   private Collection watch;
+   //private int        type;
+   private List watches;
+   private static ForumsModule fm;
+    
+
+   private static void initializeForumsModule () {
+      try {
+        fm = (ForumsModule)new InitialContext().lookup("java:portal/ForumsModule");
+      } catch (NamingException e) {
+          e.printStackTrace();
+      }
+   }
+    
+    
+   /**
+    */
+   public Category getCategory()
+   {
+      return category;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param category DOCUMENT_ME
+    */
+   public void setCategory(Category category)
+   {
+      this.category = category;
+   }
+
+   /**
+    */
+   public String getDescription()
+   {
+      return description;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param description DOCUMENT_ME
+    */
+   public void setDescription(String description)
+   {
+      this.description = description;
+   }
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   private void setId(Integer id)
+   {
+      this.id = id;
+   }
+   
+
+    //TODO: This method can be optimized by adding lastPost column in table
+    /**
+    * _ at _hibernate.many-to-one
+    * _cascade_="all"
+    * _column_="jbp_last_post_id"
+    * _class_="org.jboss.portlet.forums.impl.PostImpl"
+    */
+    /*public Post getLastPost()
+    {
+                //"select post from ForumImpl as forum" +
+                //"join forum.topics as topic" +
+                //"join topic.posts as post +
+                //"order by topic.lastPostDate");       
+                
+                //"select topic from ForumImpl as forum" +
+                //"join forum.topics as topic" +
+                //"where topic.lastPostDate=(select MIN(t.lastPostDate) from forum.topics t)"
+       Session session = singleton.getCurrentSession();
+                 Query query = session.createQuery(            
+                "select post from ForumImpl as forum " +
+                "join forum.topics as topic " +
+                "join topic.posts as post " +
+                "where forum.id=:forumId " +
+                "AND post.date=(select MIN(t.lastPostDate) from forum.topics t)");
+      
+          query.setString("forumId",getId().toString());
+       Post post2 = (Post)query.uniqueResult();
+      Post post = null; 
+      for (Iterator i = getTopics().iterator(); i.hasNext();)
+      {
+         post = ((Topic)i.next()).getLastPost();
+      }      
+      return post;
+    }*/
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param lastPost DOCUMENT_ME
+    */
+   public void setLastPost(Post lastPost)
+   {
+      //this.lastPost = lastPost;
+   }
+
+   /**
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    */
+   public int getOrder()
+   {
+      return order;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param order DOCUMENT_ME
+    */
+   public void setOrder(int order)
+   {
+      this.order = order;
+   }
+
+   /**
+    */
+   public int getTopicCount()
+   {
+      return topicCount;
+      //return getTopics().size();
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param size DOCUMENT_ME
+    */
+   public void setTopicCount(int size)
+   {
+      this.topicCount = size;
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   public void addTopicSize()
+   {
+      setTopicCount(topicCount + 1);
+   }
+
+   /**
+    */
+   public int getPostCount()
+   {
+      //int sum = 0;
+      //for (Iterator i = getTopics().iterator(); i.hasNext();)
+      //{
+      //   Topic topic = (Topic)i.next();
+      //   sum += topic.getPosts().size();
+      //}
+      //return sum;
+      return postCount;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param size DOCUMENT_ME
+    */
+   public void setPostCount(int size)
+   {
+      this.postCount = size;
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   public void addPostSize()
+   {
+      setPostCount(postCount + 1);
+   }
+
+   /**
+    * _ at ___ hibernate.property column="jbp_prune_enable"
+    * unique="false"
+    * update="true"
+    */
+   public boolean getPruneEnable()
+   {
+      //return pruneEnable;
+      return false;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param enable DOCUMENT_ME
+    */
+   public void setPruneEnable(boolean enable)
+   {
+      //this.pruneEnable = enable;
+   }
+
+   /**
+    * _ at ___ hibernate.property column="jbp_prune_next"
+    * unique="false"
+    * update="true"
+    */
+   public int getPruneNext()
+   {
+      //return pruneNext;
+      return 0;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param next DOCUMENT_ME
+    */
+   public void setPruneNext(int next)
+   {
+      //this.pruneNext = next;
+   }
+
+   /**
+    */
+   public int getStatus()
+   {
+      return status;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param status DOCUMENT_ME
+    */
+   public void setStatus(int status)
+   {
+      this.status = status;
+   }
+
+   /**
+    */
+   public List getTopics()
+   {
+      return topics;
+
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   public void setTopics(List value)
+   {
+      topics = value;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   public void addTopic(Topic value)
+   {
+      value.setForum(this);
+      topics.add(value);
+   }
+
+   /**
+    */
+   public Collection getForumWatch()
+   {
+      return watch;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param watch DOCUMENT_ME
+    */
+   public void setForumWatch(Collection watch)
+   {
+      this.watch = watch;
+   }
+
+   /**
+    */
+   /*public int getType()
+   {
+      return type;
+   }*/
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param type DOCUMENT_ME
+    */
+   /*public void setType(int type)
+   {
+      this.type = type;
+   }*/
+
+   /**
+    */
+   public List getWatches()
+   {
+      return watches;
+   }
+
+   public void setWatches(List watches)
+   {
+      this.watches = watches;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumInstanceImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumInstanceImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumInstanceImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,93 @@
+/*****************************************
+ *                                       *
+ *  JBoss Portal: The OpenSource Portal  *
+ *                                       *
+ *       Forums JBoss Portlet            *
+ *                                       *
+ *   Distributable under LGPL license.    *
+ *   See terms of license at gnu.org.    *
+ *                                       *
+ *****************************************/
+package org.jboss.portlet.forums.impl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.ForumInstance;
+
+/**
+ * Instance of forums.
+ * 
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano </a>
+ */
+public class ForumInstanceImpl implements Serializable, ForumInstance {
+
+	private Integer id;
+
+	private String name;
+
+	private List categories;
+
+	/**
+	 * Creates a new {@link ForumInstanceImpl} object.
+	 */
+	public ForumInstanceImpl() {
+		setCategories(new ArrayList());
+	}
+
+	/**
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param name
+	 *            DOCUMENT_ME
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 */
+	public List getCategories() {
+		return categories;
+
+	}
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param value
+	 *            DOCUMENT_ME
+	 */
+	public void setCategories(List value) {
+		categories = value;
+	}
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param value
+	 *            DOCUMENT_ME
+	 */
+	public void addCategory(Category value) {
+		value.setForumInstance(this);
+		categories.add(value);
+	}
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumWatchImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumWatchImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumWatchImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+
+import org.jboss.portal.identity.User;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.ForumWatch;
+import org.jboss.portlet.forums.model.Poster;
+
+/**
+ * Watchers of forums.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @version $Revision: 2066 $
+ */
+public class ForumWatchImpl
+   extends WatchImpl
+   implements Serializable,
+   ForumWatch
+{
+   private Forum forum;
+   //private int     mode;
+
+   /**
+    * Creates a new {@link ForumWatchImpl} object.
+    */
+   public ForumWatchImpl()
+   {
+   }
+
+   /**
+    */
+   public Forum getForum()
+   {
+      return forum;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    */
+   public void setForum(Forum forum)
+   {
+      this.forum = forum;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumWatchImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,2160 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.jboss.portal.core.modules.AbstractModule;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Attachment;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+// Luca Stancapiano -- import
+import org.jboss.portlet.forums.model.ForumInstance;
+import org.jboss.portlet.forums.model.ForumWatch;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.TopicWatch;
+import org.jboss.portlet.forums.model.Watch;
+import org.jboss.portlet.forums.util.NotificationEngine;
+
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * @version $Revision: 3217 $
+ * @jmx.mbean
+ * @jboss.xmbean
+ */
+public class ForumsModuleImpl
+   extends AbstractModule
+   implements ForumsModule
+{
+
+   private final Logger log = Logger.getLogger(getClass());
+
+   private HibernateProvider hibernate;
+   private SessionFactory factory;
+   private UserProfileModule userProfileModule;
+
+   private NotificationEngine notificationEngine;
+   
+   private int floodInterval;
+
+   private String guestUserName;
+
+   private String fromAddress;
+
+// private final ResourceCacheInvalidatorInterceptor resourceInterceptor;
+// private final IndexInterceptor indexInterceptor;
+//   private CompositeFilter compositeInterceptor;
+// private NotificationInterceptor notificationInterceptor;
+//   private FloodControlInterceptor floodControlInterceptor;
+//   private ExecuteFilter executeInterceptor;
+//   private CommandFilter chain;
+
+   protected void startService() throws Exception
+   {
+      super.startService();
+
+      factory = hibernate.getSessionFactory();
+      userProfileModule = (UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");
+      notificationEngine = new NotificationEngine(this);
+      notificationEngine.setFrom(fromAddress);      
+      // Define the chain of interceptors
+//      chain = compositeInterceptor = new CompositeFilter();
+//    resourceInterceptor = new ResourceCacheInvalidatorInterceptor();
+//    indexInterceptor = new IndexInterceptor();
+//      floodControlInterceptor = new FloodControlInterceptor();
+//      floodControlInterceptor.setFloodInterval(floodInterval);
+//      executeInterceptor = new ExecuteFilter();
+
+      // Assemble the chain
+//    compositeInterceptor.setNext(resourceInterceptor);
+//    resourceInterceptor.setNext(indexInterceptor);
+//    indexInterceptor.setNext(notificationInterceptor);
+
+//      compositeInterceptor.setNext(executeInterceptor);
+//    notificationInterceptor.setNext(floodControlInterceptor);
+//      floodControlInterceptor.setNext(executeInterceptor);
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public HibernateProvider getHibernate()
+   {
+      return hibernate;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public void setHibernate(HibernateProvider hibernate)
+   {
+      this.hibernate = hibernate;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public int getFloodInterval()
+   {
+      return floodInterval;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public void setFloodInterval(int floodInterval)
+   {
+      this.floodInterval = floodInterval;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public String getGuestUserName()
+   {
+       return guestUserName;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public void setGuestUserName(String guestUserName)
+   {
+       this.guestUserName = guestUserName;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public String getFromAddress()
+   {
+      return fromAddress;
+   }
+
+   /**
+    * @jmx.managed-attribute
+    */
+   public void setFromAddress(String fromAddress)
+   {
+      this.fromAddress = fromAddress;
+   }
+
+   public Forum findForumById(Integer id)
+      throws ModuleException
+   {
+      if (id != null)
+      {
+         try
+         {
+            Session session = getSession();
+            ForumImpl forum = (ForumImpl)session.get(ForumImpl.class, id);
+            if (forum == null)
+            {
+               throw new ModuleException("No forum found for " + id);
+            }
+
+            return forum;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find forum by id " + id;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+   }
+   
+    public Forum findForumByIdFetchTopics(Integer id)
+       throws ModuleException
+    {
+       if (id != null)
+       {
+          try
+          {
+             Session session = getSession();
+             Query query = session.getNamedQuery("findForumByIdFetchTopics");
+             query.setParameter("forumId",id);
+             List forumList = query.list();
+             if (forumList == null)
+             {
+                throw new ModuleException("No forum found for " + id);
+             }
+             
+             if (forumList.size()>0) {
+                 return (Forum)forumList.get(0);
+             } else {
+                 return null;
+             }
+          }
+          catch (HibernateException e)
+          {
+             String message = "Cannot find forum by id " + id;
+             log.error(message, e);
+             throw new ModuleException(message, e);
+          }
+       }
+       else
+       {
+          throw new IllegalArgumentException("id cannot be null");
+       }
+    }
+
+   public Category findCategoryById(Integer id)
+      throws ModuleException
+   {
+      if (id != null)
+      {
+         try
+         {
+            Session session = getSession();
+            CategoryImpl category = (CategoryImpl)session.get(CategoryImpl.class, id);
+            if (category == null)
+            {
+               throw new ModuleException("No category found for " + id);
+            }
+
+            return category;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find category by id " + id;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+   }
+
+    public Category findCategoryByIdFetchForums(Integer id)
+       throws ModuleException
+    {
+       if (id != null)
+       {
+          try
+          {
+             Session session = getSession();
+             Query query = session.getNamedQuery("findCategoryByIdFetchForums");
+             query.setParameter("categoryId",id);
+             Category category = (Category)query.uniqueResult();
+             if (category == null)
+             {
+                throw new ModuleException("No category found for " + id);
+             }
+
+             return category;
+          }
+          catch (HibernateException e)
+          {
+             String message = "Cannot find category by id " + id;
+             log.error(message, e);
+             throw new ModuleException(message, e);
+          }
+       }
+       else
+       {
+          throw new IllegalArgumentException("id cannot be null");
+       }
+    }
+
+
+   public Poster findPosterByUserId(String userId)
+      throws ModuleException
+   {
+      if (userId != null)
+      {
+         try
+         {
+            Session session = getSession();
+            Query query = session.getNamedQuery("findPosterByUserId");
+            query.setString("userId", userId);
+            PosterImpl user = (PosterImpl)query.uniqueResult();
+            return user;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find poster by name " + userId;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("user name cannot be null");
+      }
+   }
+
+   public Poster createPoster(String userId)
+      throws ModuleException
+   {
+      if (userId != null)
+      {
+         try
+         {
+            Session session = getSession();
+            PosterImpl user = new PosterImpl();
+            user.setUserId(userId);
+            session.save(user);
+            session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+            return user;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot create Poster";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("user name cannot be null");
+      }
+   }
+
+
+   /* Luca Stancapiano start - findCategories, findCategoriesFetchForums,
+     findForums methods need to a forumInstanceId argument 
+     to take only objects of a specific forum instance 
+   */
+
+	public List findCategories(Integer indexInstance) throws ModuleException {
+		try {
+			Session session = getSession();
+			Query query = session
+					.getNamedQuery("findCategories");
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find categories";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+	
+	public List findCategoriesFetchForums(Integer indexInstance)
+			throws ModuleException {
+		try {
+			Session session = getSession();
+			Query query = session.getNamedQuery("findCategoriesFetchForums");
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			List categoriesWithDuplicates = query.list();
+			Iterator it = categoriesWithDuplicates.iterator();
+			List categories = new LinkedList();
+			while (it.hasNext()) {
+				Category category = (Category) it.next();
+				if (!categories.contains(category)) {
+					categories.add(category);
+				}
+			}
+			return categories;
+		} catch (HibernateException e) {
+			String message = "Cannot find categories";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+
+	public List findForums(Integer indexInstance) throws ModuleException {
+		try {
+			Session session = getSession();
+			Query query = session
+					.getNamedQuery("findForums");
+			
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find forums";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+
+	// Luca Stancapiano end
+
+   public List findForumsByCategoryId(Integer categoryId)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findForumsByCategoryId");
+         query.setString("categoryId",
+            categoryId.toString());
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forums";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+
+   public List findAnnouncements(Forum forum)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findAnnouncements");
+         query.setString("forumid", "" + forum.getId());
+         query.setString("type", "" + ForumsConstants.POST_ANNOUNCE);
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forums";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+
+   /* Luca Stancapiano - findTopics
+      method need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+   public List findTopics(Integer indexInstance) throws ModuleException {
+		try {
+			Session session = getSession();
+			Query query = session.getNamedQuery("findTopics"
+			);
+			
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find topics";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+
+	}
+
+	// Luca Stancapiano end
+
+    /**
+     *
+     * @param forum
+     * @param type
+     * @param start
+     * @param perPage
+     * @param order
+     * @return
+     * @throws ModuleException
+     */
+     private List findTopics(Forum forum,
+                             int type,
+                             int start,
+                             int perPage,
+                             String order)
+        throws ModuleException
+     {
+        try
+        {
+           Session session = getSession();
+           Query query =
+              session.getNamedQuery("findTopicsType"+order);
+           query.setFirstResult(start);
+           query.setMaxResults(perPage);
+           query.setString("forumid", "" + forum.getId());
+           query.setString("type", "" + type);
+           List list = query.list();
+           return list;
+        }
+        catch (HibernateException e)
+        {
+           String message = "Cannot find topics";
+           throw new ModuleException(message, e);
+        } catch (Exception e) {
+            String message = "Error while using ForumsModule.";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+        }
+     }
+
+
+     /**
+     *
+     * @param forum
+     * @param start
+     * @param perPage
+     * @param order
+     * @return
+     * @throws ModuleException
+     */
+     private List findTopics(Forum forum,
+                             int start,
+                             int perPage,
+                             String order)
+        throws ModuleException
+     {
+        try
+        {
+           Session session = getSession();
+           Query query =
+              session.getNamedQuery("findTopicsForum"+order);
+           query.setFirstResult(start);
+           query.setMaxResults(perPage);
+           query.setString("forumid", "" + forum.getId());
+           List list = query.list();
+           return list;
+        }
+        catch (HibernateException e)
+        {
+           String message = "Cannot find topics";
+           throw new ModuleException(message, e);
+        } catch (Exception e) {
+            String message = "Error while using ForumsModule.";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+        }
+     }
+
+   public List findTopicsAsc(Forum forum,
+                             int type,
+                             int start,
+                             int perPage)
+      throws ModuleException
+   {
+      return findTopics(forum, type, start, perPage, "asc");
+   }
+
+
+   public List findTopicsDesc(Forum forum,
+                              int type,
+                              int start,
+                              int perPage)
+      throws ModuleException
+   {
+      return findTopics(forum, type, start, perPage, "desc");
+   }
+   
+   public List findTopicsAsc(Forum forum,
+           int start,
+           int perPage)
+       throws ModuleException
+   {
+        return findTopics(forum, start, perPage, "asc");
+   }
+
+
+    public List findTopicsDesc(Forum forum,
+            int start,
+            int perPage)
+        throws ModuleException
+    {
+        return findTopics(forum, start, perPage, "desc");
+    }
+
+   public List findTopicsBefore(Forum forum,
+                                int type,
+                                int start,
+                                int perPage,
+                                Date date)
+      throws ModuleException
+   {
+      return null;
+   }
+
+
+
+   /* Luca Stancapiano start - findTopicsHot, findTopicsByLatestPosts, findTopicsHottest,
+      findTopicsMostViewed methods need to a forumInstanceId argument 
+      to take only topics of a specific forum instance 
+   */
+
+	public List findTopicsHot(int replies, int limit, Integer indexInstance) throws ModuleException {
+		try {
+           //"SELECT OBJECT(t) FROM topic AS t WHERE t.replies > ?1 ORDER BY t.creationDate DESC LIMIT ?2"
+			Session session = getSession();
+			Query query = session
+					.getNamedQuery("findTopicsHot");
+			query.setMaxResults(limit);
+			query.setInteger("replies", replies);		
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find topics";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+	
+	public List findTopicsByLatestPosts(int limit, Integer indexInstance)
+			throws ModuleException {
+		try {
+			//SELECT DISTINCT OBJECT(t) FROM topic AS t ORDER BY t.lastPostDate DESC LIMIT ?1"
+
+			Session session = getSession();
+			Query query =
+			// Luca Stancapiano
+			session
+					.getNamedQuery("findTopicsByLatestPosts");
+			query.setMaxResults(limit);
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find topics";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+
+	public List findTopicsHottest(Date after, int limit, Integer indexInstance) throws ModuleException {
+		try {
+			//"SELECT OBJECT(t) FROM topic AS t WHERE t.lastPostDate > ?1 ORDER BY t.replies DESC LIMIT ?2"
+			Session session = getSession();
+			Query query = session
+					.getNamedQuery("findTopicsHottest");
+			query.setMaxResults(limit);
+			query.setDate("after", after);
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find topics";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+
+	public List findTopicsMostViewed(Date after, int limit, Integer indexInstance)
+			throws ModuleException {
+		try {
+			//"SELECT OBJECT(t) FROM topic AS t WHERE t.lastPostDate > ?1 ORDER BY t.views DESC LIMIT ?2"
+			Session session = getSession();
+			Query query = session
+					.getNamedQuery("findTopicsMostViewed");
+			query.setMaxResults(limit);
+			query.setDate("after", after);
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find topics";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+
+	// Luca Stancapiano end
+
+
+   public Post createTopic(Forum forum,
+                           Message message,
+                           Date creationDate,
+                           Poster poster,
+                           Poll poll,
+                           List attachments,
+                           int type)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+
+         session.save(poster);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         session.save(poll);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+
+         
+
+         PostImpl post = new PostImpl();
+         post.setMessage(message);
+         post.setCreateDate(creationDate);
+         post.setPoster(poster);
+         //post.setAttachments(attachments);
+         for (Iterator i = attachments.iterator(); i.hasNext();)
+         {
+            Attachment a = (Attachment)i.next();
+            session.save(a);
+            session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+            post.addAttachment(a);
+         }
+
+         TopicImpl topic = new TopicImpl();
+         topic.setSubject(message.getSubject());
+         //topic.setForum(forum);
+         forum.addTopic(topic);
+         topic.setPoster(poster);
+         //topic.setFirstPost(post);
+         //topic.setLastPost(post);
+         topic.addPost(post);
+         //post.setTopic(topic);
+         topic.setLastPostDate(creationDate);
+         topic.setType(type);
+         topic.setStatus(ForumsConstants.TOPIC_UNLOCKED);
+         topic.setPoll(poll);
+
+
+         session.save(topic);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+
+         forum.addTopicSize();
+         forum.addPostSize();
+
+         post.setTopic(topic);                 
+         session.save(post);
+         notificationEngine.scheduleForNotification(post.getId(), NotificationEngine.MODE_POST);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         return post;
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create topic";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public Topic createTopic(Forum forum,
+                            String userId,
+                            String subject,
+                            int type)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+
+         Poster poster = findPosterByUserId(userId);
+
+         if (poster == null)
+         {
+            poster = createPoster(userId);
+         }
+         session.save(poster);
+
+         TopicImpl topic = new TopicImpl();
+         topic.setSubject(subject);
+         //topic.setForum(forum);
+         forum.addTopic(topic);
+         topic.setPoster(poster);
+         //topic.setFirstPost(post);
+         //topic.setLastPost(post);
+         //topic.addPost(post);
+         //post.setTopic(topic);
+         //topic.setLastPostDate(creationDate);
+         topic.setType(type);
+
+         topic.setPoll(null);
+
+
+         session.save(topic);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         //forum.addTopicSize();
+         //forum.addPostSize();
+
+
+         return topic;
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create topic";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+
+   public Post createPost(Topic topic,
+                          Forum forum,
+                          Message message,
+                          Date creationDate,
+                          Poster poster,
+                          List attachments)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         session.save(poster);
+
+
+         PostImpl post = new PostImpl();
+         post.setMessage(message);
+         post.setCreateDate(creationDate);
+         post.setPoster(poster);
+         //post.setAttachments(attachments);
+         for (Iterator i = attachments.iterator(); i.hasNext();)
+         {
+            Attachment a = (Attachment)i.next();
+            session.save(a);
+            post.addAttachment(a);
+         }
+
+
+         session.save(post);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+
+         topic.addPost(post);
+         //post.setTopic(topic);
+
+         //topic.setLastPost(post);
+         topic.setLastPostDate(post.getCreateDate());
+         topic.setReplies(topic.getReplies() + 1);
+         session.save(topic);
+         //forum.setLastPost(post);
+         forum.addPostSize();
+         notificationEngine.scheduleForNotification(post.getId(), NotificationEngine.MODE_REPLY);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         return post;
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create topic";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public Poll addPollToTopic(Topic topic,
+                              Poll poll)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Poll oldpoll = topic.getPoll();
+         if (oldpoll != null)
+         {
+            session.delete(oldpoll);
+         }
+         session.save(poll);
+         topic.setPoll(poll);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         return poll;
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot add poll to topic";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+
+
+   /* Luca Stancapiano start - getLastCategoryOrder and createCategory
+      methods need to a forumInstanceId argument 
+      to take only categories of a specific forum instance 
+   */
+	private int getLastCategoryOrder(Integer indexInstance) {
+		try {
+			Session session = getSession();
+			// Luca Stancapiano start
+			Query query = session
+					.getNamedQuery("getLastCategoryOrder");
+			query.setParameter("forumInstanceId", indexInstance);
+			// Luca Stancapiano end
+			Integer lastCategoryOrder = (Integer) query.uniqueResult();
+			return (lastCategoryOrder != null) ? lastCategoryOrder.intValue()
+					: 0;
+		} catch (HibernateException e) {
+			return 0;
+		}
+	}
+
+	public Category createCategory(String name, ForumInstance forumInstance)
+			throws ModuleException {
+		try {
+			Session session = getSession();
+
+			CategoryImpl category = new CategoryImpl();
+			category.setTitle(name);
+			category.setOrder(getLastCategoryOrder(forumInstance.getId()) + 10);
+			// Luca Stancapiano
+			category.setForumInstance(forumInstance);
+			session.save(category);
+			session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+			return category;
+		} catch (HibernateException e) {
+			String errorMessage = "Cannot create topic";
+			log.error(errorMessage, e);
+			throw new ModuleException(errorMessage, e);
+		}
+	}
+	// Luca Stancapiano end
+
+   public void removeCategory(Category category)
+      throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         //session.flush();
+         session.delete(category);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         //session.flush();
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete category";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public void removeForum(Forum forum)
+      throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         //session.delete(forum);
+         if (forum.getCategory() != null)
+         {
+            forum.getCategory().getForums().remove(forum);
+            forum.setCategory(null);
+         }
+         else
+         {
+            session.delete(forum);
+         }
+
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         //session.flush();
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete forum";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public void removePost(Post post)
+      throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         //session.flush();
+         //session.delete(post);
+         if (post.getTopic() != null)
+         {
+            post.getTopic().getPosts().remove(post);
+            post.setTopic(null);
+         }
+         else
+         {
+            session.delete(post);
+         }
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete post";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public void removePollInTopic(Topic topic)
+      throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         //session.flush();
+         Poll poll = topic.getPoll();
+         topic.setPoll(null);
+         session.delete(poll);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete poll";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public void removeTopic(Topic topic)
+      throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         //session.flush();
+         //session.delete(topic);
+         Forum forum = topic.getForum();
+         if (forum != null)
+         {
+            forum.getTopics().remove(topic);
+            topic.setForum(null);
+            forum.setPostCount(forum.getPostCount()-topic.getReplies()-1);
+            forum.setTopicCount(forum.getTopicCount()-1);
+            //session.delete(topic);
+         }
+         else
+         {
+            session.delete(topic);
+         }
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         //session.flush();
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete topic";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   private int getLastForumOrder(Category category)
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("getLastForumOrder");
+         query.setString("categoryId", "" + category.getId());
+         Integer lastForumOrder = (Integer)query.uniqueResult();
+         return (lastForumOrder != null) ? lastForumOrder.intValue() : 0;
+      }
+      catch (HibernateException e)
+      {
+         return 0;
+      }
+   }
+
+   public Forum createForum(Category category,
+                            String name,
+                            String description)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+
+         ForumImpl forum = new ForumImpl();
+         //forum.setCategory(category);
+         category.addForum(forum);
+         forum.setName(name);
+         forum.setDescription(description);
+         forum.setOrder(getLastForumOrder(category) + 10);
+         session.save(forum);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         return forum;
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create forum";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public Topic findTopicById(Integer id)
+      throws ModuleException
+   {
+      if (id != null)
+      {
+         try
+         {
+            Session session = getSession();
+            TopicImpl topic = (TopicImpl)session.get(TopicImpl.class, id);
+            if (topic == null)
+            {
+               throw new ModuleException("No topic found for " + id);
+            }
+
+            return topic;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find forum by id " + id;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+   }
+
+   public List findTopics(Forum forum)
+      throws ModuleException
+   {
+      if (forum != null)
+      {
+         try
+         {
+            Session session = getSession();
+            Query query =
+               session.getNamedQuery("findTopicsForumNoOrder");
+            query.setString("forumid", "" + forum.getId());
+            return query.list();
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find topics";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("forum cannot be null");
+      }
+   }
+
+
+
+   /* Luca Stancapiano start - findPosts
+      method need to a forumInstanceId argument 
+      to take only posts of a specific forum instance 
+    */
+	public List findPosts(Integer indexInstance) throws ModuleException {
+		try {
+			Session session = getSession();
+			Query query = session.getNamedQuery("findPosts"
+			);	
+			// Luca Stancapiano
+			query.setParameter("forumInstanceId", indexInstance);
+			return query.list();
+		} catch (HibernateException e) {
+			String message = "Cannot find posts";
+			log.error(message, e);
+			throw new ModuleException(message, e);
+		}
+	}
+	// Luca Stancapiano end
+
+   public Post findPostById(Integer id)
+      throws ModuleException
+   {
+      if (id != null)
+      {
+         try
+         {
+            Session session = getSession();
+            PostImpl post = (PostImpl)session.get(PostImpl.class, id);
+            if (post == null)
+            {
+               throw new ModuleException("No post found for " + id);
+            }
+
+            return post;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find post by id " + id;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+   }
+
+   public Attachment findFindAttachmentById(Integer attachID)
+      throws ModuleException
+   {
+      if (attachID != null)
+      {
+         try
+         {
+            Session session = getSession();
+            Attachment attach = (Attachment)session.get(AttachmentImpl.class, attachID);
+            if (attach == null)
+            {
+               throw new ModuleException("No attachment found for " + attachID);
+            }
+
+            return attach;
+         }
+         catch (HibernateException e)
+         {
+            String message = "Cannot find attachment by id " + attachID;
+            log.error(message, e);
+            throw new ModuleException(message, e);
+         }
+      }
+      else
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+   }
+
+   private List findPostsByTopicId(Integer topicId,
+                                   int start,
+                                   int limit,
+                                   String order)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findPostsByTopicId"+order);
+         query.setString("topicId",
+            topicId.toString());
+         query.setFirstResult(start);
+         if (limit != 0)
+         {
+            query.setMaxResults(limit);
+         }
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find posts";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+
+    private List findPostsByIdsFetchAttachmentsAndPosters(Collection postIds ,
+                                    String order)
+       throws ModuleException
+    {
+        
+       if (postIds==null || postIds.size()==0) {
+           return new LinkedList();
+       }
+        
+       try
+       {
+          Session session = getSession();
+          Query query =
+             session.getNamedQuery("findPostsByIdsFetchAttachmentsAndPosters"+order);
+          query.setParameterList("postIds",postIds);
+          Iterator it = query.list().iterator();
+          List list = new LinkedList();
+          while (it.hasNext()) {
+              Post post = (Post)it.next();
+              if (!list.contains(post)) {
+                list.add(post);
+              }
+          }
+          return list;
+       }
+       catch (HibernateException e)
+       {
+          String message = "Cannot find posts";
+          log.error(message, e);
+          throw new ModuleException(message, e);
+       }
+    }
+    
+    public List findPostsByIdsAscFetchAttachmentsAndPosters(Collection postIds)
+       throws ModuleException
+    {
+       return findPostsByIdsFetchAttachmentsAndPosters( postIds , "asc");
+    }
+
+    public List findPostsByIdsDescFetchAttachmentsAndPosters(Collection postIds)
+       throws ModuleException
+    {
+       return findPostsByIdsFetchAttachmentsAndPosters( postIds , "desc");
+    }
+
+    private List findPostIds(Integer topicId,
+                                    int start,
+                                    int limit,
+                                    String order)
+       throws ModuleException
+    {
+       try
+       {
+          Session session = getSession();
+          Query query =
+             session.getNamedQuery("findPostIds"+order);
+          query.setString("topicId", topicId.toString());
+          query.setFirstResult(start);
+          if (limit != 0)
+          {
+             query.setMaxResults(limit);
+          }
+          return query.list();
+       }
+       catch (HibernateException e)
+       {
+          String message = "Cannot find post ids";
+          log.error(message, e);
+          throw new ModuleException(message, e);
+       }
+    }
+    
+    public List findPostIdsAsc(Integer topicId,
+                                      int start,
+                                      int limit)
+       throws ModuleException
+    {
+       return findPostIds(topicId, start, limit, "asc");
+    }
+
+    public List findPostIdsDesc(Integer topicId,
+                                       int start,
+                                       int limit)
+       throws ModuleException
+    {
+       return findPostIds(topicId, start, limit, "desc");
+    }
+
+   public List findPostsByTopicId(Integer topicId)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findPostsByTopicIdNoOrder");
+         query.setString("topicId",
+            topicId.toString());
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find posts";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+
+
+   public void addAllForums(Category source,
+                            Category target)
+        throws ModuleException
+   {
+      List sourceForums = this.findForumsByCategoryId(source.getId());
+      List targetForums = this.findForumsByCategoryId(target.getId());
+      targetForums.addAll(sourceForums);   
+      Iterator iterator = targetForums.iterator();
+      while (iterator.hasNext())
+      {
+         Forum forum = (Forum)iterator.next();
+         forum.setCategory(target);
+      }
+      source.setForums(new ArrayList());
+   }
+
+   public List findPostsByTopicIdAsc(Integer topicId,
+                                     int start,
+                                     int limit)
+      throws ModuleException
+   {
+      return findPostsByTopicId(topicId, start, limit, "asc");
+   }
+
+   public List findPostsByTopicIdDesc(Integer topicId,
+                                      int start,
+                                      int limit)
+      throws ModuleException
+   {
+      return findPostsByTopicId(topicId, start, limit, "desc");
+   }
+
+   public Date findLastPostDateForUser(User user)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findLastPostDateForUser");
+         query.setString("userId", "" + user.getId().toString());
+         Date lastPostDate = (Date)query.uniqueResult();
+         return lastPostDate;
+      }
+      catch (HibernateException e)
+      {
+         e.printStackTrace();
+         return null;
+      }
+   }
+
+    public Post findLastPost(Forum forum)
+       throws ModuleException
+        {
+           try
+           {
+              Session session = getSession();
+              Query query =
+                 
+                 // This is old query, considered as less efficient
+                 //session.getNamedQuery("from PostImpl as p where p.topic.forum  = :forumId order by p.createDate desc");
+                 
+                 session.getNamedQuery("findLastPost" );
+              query.setString("forumId", "" + forum.getId());
+              query.setFirstResult(0);
+              query.setMaxResults(1);
+              Post lastPost = (Post)query.uniqueResult();
+              return lastPost;
+           }
+           catch (HibernateException e)
+           {
+              e.printStackTrace();
+              return null;
+           }
+        }
+
+   public Post findFirstPost(Topic topic)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            // Old query considered as inefficient
+            //session.getNamedQuery("from PostImpl as p where p.topic  = :topicId order by p.createDate desc");
+            
+             session.getNamedQuery("findFirstPost");
+         query.setDate("lastPostDate", topic.getLastPostDate());
+         query.setString("topicId", "" + topic.getId());
+         query.setFirstResult(0);
+         query.setMaxResults(1);
+         Post firstPost = (Post)query.uniqueResult();
+         return firstPost;
+      }
+      catch (HibernateException e)
+      {
+         e.printStackTrace();
+         return null;
+      }
+   }
+
+   public Post findLastPost(Topic topic)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query =
+            session.getNamedQuery("findLastPostOrder");
+         query.setString("topicId", "" + topic.getId());
+         query.setFirstResult(0);
+         query.setMaxResults(1);
+         Post lastPost = (Post)query.uniqueResult();
+         return lastPost;
+      }
+      catch (HibernateException e)
+      {
+         e.printStackTrace();
+         return null;
+      }
+   }
+   
+    public Map findLastPostsOfTopics(Collection topics)
+       throws ModuleException
+    {
+       try
+       {
+          Session session = getSession();
+          //Query query =
+             // Old query considered as inefficient
+             //session.getNamedQuery("from PostImpl as p where p.topic  = :topicId order by p.createDate desc");           
+            session.getNamedQuery("findLastPostsOfTopics");
+          Iterator it = topics.iterator();
+          List lastPostDates = new ArrayList(topics.size());
+          List dates = new LinkedList();
+          while(it.hasNext()) {
+              Topic tmpTopic = (Topic)it.next();
+              dates.add(tmpTopic.getLastPostDate());
+              lastPostDates.add(new Object[]{tmpTopic.getLastPostDate(),tmpTopic.getId()});
+          }
+          
+          // if there are no createDates then we return an empty map
+          if (dates.size()==0) {
+              return new HashMap(0);
+          }
+          
+          Query query = session.getNamedQuery("findLastPostsOfTopicsCreateDate");
+          query.setParameterList("dates",dates);
+          List posts = query.list();
+          Map forumPostMap = new HashMap(dates.size());
+          Iterator iterator = lastPostDates.iterator();
+          while (iterator.hasNext()) {
+              Object[] dateTopic = (Object[])iterator.next();
+              int index = Collections.binarySearch(posts,
+                                                         dateTopic,
+                                                         new Comparator() {
+                            public int compare(Object o1, Object o2) {
+                                Object[] datePostPair1 = (Object[])o1;
+                                Object[] datePostPair2 = (Object[])o2;
+                                Date postDate1 = (Date)datePostPair1[0];
+                                Date postDate2 = (Date)datePostPair2[0];
+                                return postDate1.compareTo(postDate2);
+                            }
+                        });
+              if (index<0) {
+                continue;
+              }
+              Object[] datePostPair = (Object[])posts.get(index);
+              forumPostMap.put(dateTopic[1],datePostPair[1]);
+          }         
+          return forumPostMap;
+       }
+       catch (HibernateException e)
+       {
+          e.printStackTrace();
+          return null;
+       }
+    }
+
+    /* Luca Stancapiano start - findLastPostsOfForums, findForumWatchByUser,
+       findForumWatchedByUser, findTopicWatchedByUser and findTopicWatches  
+       methods need to a forumInstanceId argument 
+       to take only objects of a specific forum instance 
+    */
+    public Map findLastPostsOfForums(Integer indexInstance)
+       throws ModuleException
+    {
+       try
+       {
+          Session session = getSession();
+          Query query =             
+              session.getNamedQuery("findLastPostsOfForums");
+		  // Luca Stancapiano
+		  query.setParameter("forumInstanceId", indexInstance);
+          List createDates = query.list();
+          Iterator it = createDates.iterator();
+          List dates = new LinkedList();
+          while(it.hasNext()) {
+              dates.add(((Object[])it.next())[0]);
+          }
+          
+          // if there are no posts in all forums then return empty map
+          if (dates.size()==0) {
+              return new HashMap(0);
+          }
+          
+          query = session.getNamedQuery("findLastPostsOfForumsCreateDate");
+          query.setParameterList("dates",dates);
+          List posts = query.list();
+          Map forumPostMap = new HashMap(createDates.size());
+          Iterator iterator = createDates.iterator();
+          while (iterator.hasNext()) {
+              Object[] dateForum = (Object[])iterator.next();
+              int index = Collections.binarySearch(posts,
+                                                         dateForum,
+                                                         new Comparator() {
+                            public int compare(Object o1, Object o2) {
+                                Object[] datePostPair1 = (Object[])o1;
+                                Object[] datePostPair2 = (Object[])o2;
+                                Date postDate1 = (Date)datePostPair1[0];
+                                Date postDate2 = (Date)datePostPair2[0];
+                                return postDate1.compareTo(postDate2);
+                            }
+                        });
+              if (index<0) {
+                continue;
+              }
+              Object[] datePostPair = (Object[])posts.get(index);
+              forumPostMap.put(dateForum[1],datePostPair[1]);
+          }         
+          return forumPostMap;
+       }
+       catch (HibernateException e)
+       {
+          e.printStackTrace();
+          return null;
+       }
+    }
+
+   public List findForumWatchByUser(User user, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+	     Query query = session
+			.getNamedQuery("findForumWatchByUser"
+			);
+	     query.setString("userId", user.getId().toString());
+         // Luca Stancapiano
+	     query.setParameter("forumInstanceId", indexInstance);
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watch";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   public List findForumWatchedByUser(User user, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+		 Query query = session.getNamedQuery("findForumWatchedByUser");
+		query.setString("userId", user.getId().toString());
+        // Luca Stancapiano
+	    query.setParameter("forumInstanceId", indexInstance);
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watched";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   public List findTopicWatchedByUser(User user, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+		 Query query = session.getNamedQuery("findTopicWatchedByUser");
+		 query.setString("userId", user.getId().toString());
+         // Luca Stancapiano
+	     query.setParameter("forumInstanceId", indexInstance);
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find topic watched";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   public List findTopicWatchedByUser(User user,Date datePoint, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+		 Query query = session.getNamedQuery("findTopicWatchedByUserCreateDate");
+		 query.setString("userId", user.getId().toString());
+		 query.setTimestamp("datePoint", datePoint);
+         // Luca Stancapiano
+	     query.setParameter("forumInstanceId", indexInstance);
+         return query.list();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find topic watched";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   /**
+    * 
+    * This method returns Map<Integer,TopicWatch> pairs where Integer
+    * key is watched topic id.
+    * 
+    * @param user
+    * @return 
+    * @throws ModuleException
+    */
+   public Map findTopicWatches(User user, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+		 Query query = session.getNamedQuery("findTopicWatches"
+		 );
+		 query.setString("userId", user.getId().toString());
+         // Luca Stancapiano
+		 query.setParameter("forumInstanceId", indexInstance);
+         List results = query.list();
+         HashMap map = new HashMap(results.size());
+         Iterator it = results.iterator();
+         while (it.hasNext())
+         {
+            Object[] element = (Object[]) it.next();
+            map.put(element[0], element[1]);
+         }
+         return map;
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find topic watches";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   // Luca Stancapiano end
+
+    private List findPostsFromForum(Forum forum, int limit, String order)
+            throws ModuleException
+    {
+        try
+        {
+            Session session = getSession();
+            Query query = session
+            .getNamedQuery("findPostsFromForum"+order);
+
+            query.setString("forumId", forum.getId().toString());
+
+            query.setFirstResult(0);
+
+            if (limit != 0)
+            {
+                query.setMaxResults(limit);
+            }
+            return query.list();
+        } catch (HibernateException e)
+        {
+            String message = "Cannot find posts";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+        }
+    }
+
+    public List findPostsFromForumAsc(Forum forum, int limit)
+            throws ModuleException
+    {
+        return findPostsFromForum(forum, limit, "asc");
+    }
+
+    public List findPostsFromForumDesc(Forum forum, int limit)
+            throws ModuleException
+    {
+        return findPostsFromForum(forum, limit, "desc");
+    }
+
+    private List findPostsFromCategory(Category category, int limit,
+            String order) throws ModuleException
+            {
+        try
+        {
+            Session session = getSession();
+            Query query = session
+            .getNamedQuery("findPostsFromCategory"+order);
+
+            query.setString("categoryId", category.getId().toString());
+
+            query.setFirstResult(0);
+
+            if (limit != 0)
+            {
+                query.setMaxResults(limit);
+            }
+            return query.list();
+        } catch (HibernateException e)
+        {
+            String message = "Cannot find posts";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+        }
+            }
+
+    public List findPostsFromCategoryAsc(Category category, int limit)
+            throws ModuleException
+    {
+        return findPostsFromCategory(category, limit, "asc");
+    }
+
+    public List findPostsFromCategoryDesc(Category category, int limit)
+            throws ModuleException
+    {
+        return findPostsFromCategory(category, limit, "desc");
+    }
+
+    private List findPosts(int limit, String order) throws ModuleException
+    {
+        try
+        {
+            Session session = getSession();
+            Query query = session
+            .getNamedQuery("findPostsOrder"+order);
+            query.setFirstResult(0);
+
+            if (limit != 0)
+            {
+                query.setMaxResults(limit);
+            }
+            return query.list();
+        } catch (HibernateException e)
+        {
+            String message = "Cannot find posts";
+            log.error(message, e);
+            throw new ModuleException(message, e);
+        }
+    }
+
+    public List findPostsAsc(int limit) throws ModuleException
+    {
+        return findPosts(limit, "asc");
+    }
+
+    public List findPostsDesc(int limit) throws ModuleException
+    {
+        return findPosts(limit, "desc");
+    }
+
+   public void createWatch(Poster poster, Forum forum, int mode) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+
+         if (poster == null)
+         {
+            throw new ModuleException("poster must not be null");
+         }
+
+         if (forum == null)
+         {
+            throw new ModuleException("forum must not be null");
+         }
+
+         session.save(poster);
+         
+         ForumWatch forumWatch = new ForumWatchImpl();
+         forumWatch.setPoster(poster);
+         forumWatch.setForum(forum);
+         forumWatch.setMode(mode);
+         session.save(forumWatch);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create forum watch";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public void removeWatch(Watch watch) throws ModuleException
+   {
+      Session session = getSession();
+      try
+      {
+         session.delete(watch);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot delete watch";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public ForumWatch findForumWatchById(Integer forumWatchId)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.getNamedQuery("findForumWatchById");
+         query.setString("forumWatchId",
+            forumWatchId.toString());
+         return (ForumWatch)query.uniqueResult();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watch";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   /**
+    * 
+    * This method returns Map<Integer,ForumWatch> pairs where Integer
+    * key is watched forum id.
+    * 
+    * @param user
+    * @return 
+    * @throws ModuleException
+    */
+   /* Luca Stancapiano start - findForumWatches method need to a forumInstanceId argument 
+      to take only forums of a specific forum instance 
+   */
+   public Map findForumWatches(User user, Integer indexInstance) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.getNamedQuery("findForumWatches");
+         query.setString("userId", user.getId().toString());
+         // Luca Stancapiano
+		 query.setParameter("forumInstanceId", indexInstance);
+         List results = query.list();
+         HashMap map = new HashMap(results.size());
+         Iterator it = results.iterator();
+         while (it.hasNext())
+         {
+            Object[] element = (Object[]) it.next();
+            map.put(element[0], element[1]);
+         }
+         return map;
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watches";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   // Luca Stancapiano end
+   
+   public ForumWatch findForumWatchByUserAndForum(User user,int forumId) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.getNamedQuery("findForumWatchByUserAndForum");
+         query.setString("userId", user.getId().toString());
+         query.setInteger("forumId", forumId );
+         Object obj = query.uniqueResult();
+         if (obj==null) {
+             return null;
+         } else {
+             return (ForumWatch)obj;
+         }
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watch";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   public TopicWatch findTopicWatchByUserAndTopic(User user,int topicId) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.getNamedQuery("findTopicWatchByUserAndTopic");
+         query.setString("userId", user.getId().toString());
+         query.setInteger("topicId", topicId );
+         Object obj = query.uniqueResult();
+         if (obj==null) {
+             return null;
+         } else {
+             return (TopicWatch)obj;
+         }
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find topic watch";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+
+   public void createWatch(Poster poster, Topic topic,int mode)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+
+         if (poster == null)
+         {
+            throw new ModuleException("poster must not be null");
+         }
+
+         if (topic == null)
+         {
+            throw new ModuleException("topic must not be null");
+         }
+
+         session.save(poster);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+         
+         TopicWatch topicWatch = new TopicWatchImpl();
+         topicWatch.setPoster(poster);
+         topicWatch.setTopic(topic);
+         topicWatch.setMode(mode);
+         session.save(topicWatch);
+         session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+      }
+      catch (HibernateException e)
+      {
+         String errorMessage = "Cannot create topic watch";
+         log.error(errorMessage, e);
+         throw new ModuleException(errorMessage, e);
+      }
+   }
+
+   public TopicWatch findTopicWatchById(Integer topicWatchId)
+      throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.getNamedQuery("findTopicWatchById");
+         query.setString("topicWatchId",
+            topicWatchId.toString());
+         return (TopicWatch)query.uniqueResult();
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find topic watch";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
+   public void processNotifications (Integer postId, int watchType , String postUrl , String replyUrl ) {
+       notificationEngine.schedule(postId, watchType, postUrl , replyUrl );
+   }
+   
+   public UserProfileModule getUserProfileModule() {
+       return this.userProfileModule;
+   }
+   
+   protected Session getSession () {
+       Session session = factory.getCurrentSession();
+	   /*System.out.println ("CATEGORY");
+	   Map cacheEntries = null;
+	   org.hibernate.stat.SecondLevelCacheStatistics stats = factory.getStatistics()
+        .getSecondLevelCacheStatistics("org.jboss.portlet.forums.impl.CategoryImpl");
+       if ( stats !=null) {
+		  cacheEntries = stats.getEntries();
+          Iterator it = cacheEntries.keySet().iterator();
+	      while (it.hasNext()) {
+	         Object ob = it.next();
+		     System.out.println ("KEY: "+ob+" VALUE: "+cacheEntries.get(ob));
+	      }
+	   }
+	   System.out.println ("FORUM");
+	   stats = factory.getStatistics()
+        .getSecondLevelCacheStatistics("org.jboss.portlet.forums.impl.ForumImpl");
+       if ( stats !=null) {
+		  cacheEntries = stats.getEntries();
+          Iterator it = cacheEntries.keySet().iterator();
+	      while (it.hasNext()) {
+	         Object ob = it.next();
+		     System.out.println ("KEY: "+ob+" VALUE: "+cacheEntries.get(ob));
+	      }
+	   }
+	   System.out.println ("CATEGORY.FORUMS");
+	   stats = factory.getStatistics()
+        .getSecondLevelCacheStatistics("org.jboss.portlet.forums.impl.CategoryImpl.forums");
+       if ( stats !=null) {
+		  cacheEntries = stats.getEntries();
+          Iterator it = cacheEntries.keySet().iterator();
+	      while (it.hasNext()) {
+	         Object ob = it.next();
+		     System.out.println ("KEY: "+ob+" VALUE: "+cacheEntries.get(ob));
+	      }
+	   }*/
+	   return session;
+   }
+
+	/* Luca Stancapiano start - I add createForumInstance, removeForumInstance
+      and findForumInstanceById methods to manage ForumInstance object
+   */
+	public ForumInstance createForumInstance(Integer indexInstance, String name)
+			throws ModuleException {
+		try {
+			Session session = getSession();
+
+			ForumInstanceImpl forumInstance = new ForumInstanceImpl();
+			forumInstance.setId(indexInstance);
+			forumInstance.setName(name);
+			session.save(forumInstance);
+			session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+			return forumInstance;
+		} catch (HibernateException e) {
+			String errorMessage = "Cannot create forum Instance";
+			log.error(errorMessage, e);
+			throw new ModuleException(errorMessage, e);
+		}
+	}
+
+	public void removeForumInstance(ForumInstance forumInstance)
+			throws ModuleException {
+		Session session = getSession();
+		try {
+			// session.flush();
+			session.delete(forumInstance);
+			session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
+			// session.flush();
+		} catch (HibernateException e) {
+			String errorMessage = "Cannot delete forum Instance";
+			log.error(errorMessage, e);
+			throw new ModuleException(errorMessage, e);
+		}
+	}
+
+	public ForumInstance findForumInstanceById(Integer id)
+			throws ModuleException {
+		if (id != null) {
+			try {
+				Session session = getSession();
+				ForumInstanceImpl forumInstance = (ForumInstanceImpl) session
+						.get(ForumInstanceImpl.class, id);
+				return forumInstance;
+			} catch (HibernateException e) {
+				String message = "Cannot find forum instance by id " + id;
+				log.error(message, e);
+				throw new ModuleException(message, e);
+			}
+		} else {
+			throw new IllegalArgumentException("id cannot be null");
+		}
+	}
+
+	// Luca Stancapiano end
+}
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.jboss.portlet.forums.model.Message;
+
+/**
+ * A DVC object that groups the message informations for a post.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+public class MessageImpl
+   implements Message,
+   Serializable,
+   Cloneable
+{
+   private String subject = "";
+   
+   @Field(index=Index.TOKENIZED)
+   private String text = "";
+   private boolean BBCodeEnabled = true;
+   private boolean HTMLEnabled = true;
+   private boolean smiliesEnabled = false;
+   private boolean signatureEnabled = true;
+
+   /**
+    */
+   public String getSubject()
+   {
+      return subject;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param subject DOCUMENT_ME
+    */
+   public void setSubject(String subject)
+   {
+      this.subject = subject;
+   }
+
+   /**
+    */
+   public String getText()
+   {
+      return text;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param text DOCUMENT_ME
+    */
+   public void setText(String text)
+   {
+      this.text = text;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getBBCodeEnabled()
+   {
+      return BBCodeEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param BBCodeEnabled DOCUMENT_ME
+    */
+   public void setBBCodeEnabled(boolean BBCodeEnabled)
+   {
+      this.BBCodeEnabled = BBCodeEnabled;
+   }
+
+   public boolean getHTMLEnabled()
+   {
+      return HTMLEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param HTMLEnabled DOCUMENT_ME
+    */
+   public void setHTMLEnabled(boolean HTMLEnabled)
+   {
+      this.HTMLEnabled = HTMLEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getSmiliesEnabled()
+   {
+      return smiliesEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param smiliesEnabled DOCUMENT_ME
+    */
+   public void setSmiliesEnabled(boolean smiliesEnabled)
+   {
+      this.smiliesEnabled = smiliesEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getSignatureEnabled()
+   {
+      return signatureEnabled;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param signatureEnabled DOCUMENT_ME
+    */
+   public void setSignatureEnabled(boolean signatureEnabled)
+   {
+      this.signatureEnabled = signatureEnabled;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+import java.util.*;
+
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+public class PollImpl
+   implements Serializable,
+   Poll
+{
+   /**
+    * Creates a new {@link PollImpl} object.
+    */
+   public PollImpl()
+   {
+      setOptions(new LinkedList());
+      setVoted(new HashSet());
+   }
+
+   private Integer id;
+   private String title;
+   private List options;
+   private int length;
+   /*private boolean isEnded = false;*/
+   private Set voted;
+   private Date creationDate;
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   private void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.portlet.forums.model.Poll#setTitle(java.lang.String)
+    */
+   public void setTitle(String string)
+   {
+      this.title = string;
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.portlet.forums.model.Poll#setLength(int)
+    */
+   public void setLength(int i)
+   {
+      this.length = i;
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.portlet.forums.model.Poll#setOptions(java.util.LinkedList)
+    */
+   public void setOptions(List list)
+   {
+      this.options = list;
+   }
+
+   /**
+    */
+   public List getOptions()
+   {
+      return this.options;
+      //class="org.jboss.portlet.forums.impl.PollOptionImpl"
+      /*type="string"
+    *    column="jbp_poll_option_question"
+    *    not-null="true"*/
+   }
+
+   /**
+    */
+   public String getTitle()
+   {
+      return this.title;
+   }
+
+   /**
+    */
+   public int getLength()
+   {
+      return this.length;
+   }
+
+   /**
+    * _ at _ hibernate.property
+    *    column="jbp_ended"
+    *    unique="false"
+    *    update="true"
+    */
+   /*public boolean getIsEnded()
+   {
+      return isEnded;
+   }*/
+
+   /*public void setIsEnded(boolean ended)
+   {
+      isEnded = ended;
+   }*/
+
+   /**
+    */
+   public Set getVoted()
+   {
+      return voted;
+   }
+
+   public void setVoted(Set voted)
+   {
+      this.voted = voted;
+   }
+
+    //TODO: Can be optimized
+   public int getVotesSum()
+   {
+      int sum = 0;
+      for (Iterator i = getOptions().iterator(); i.hasNext();)
+      {
+         sum += ((PollOption)i.next()).getVotes();
+      }
+      return sum;
+   }
+
+   /**
+    */
+   public Date getCreationDate()
+   {
+      return creationDate;
+   }
+
+   public void setCreationDate(Date creationDate)
+   {
+      this.creationDate = creationDate;
+   }
+
+
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Poll;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+
+public class PollOptionImpl
+   implements PollOption, Serializable
+{
+   private String question;
+   private int votes = 0;
+
+
+   public PollOptionImpl()
+   {
+   }
+
+   public PollOptionImpl(String question)
+   {
+      setQuestion(question);
+   }
+
+   /**
+    */
+   public int getVotes()
+   {
+      return votes;
+   }
+
+   public void setVotes(int votes)
+   {
+      this.votes = votes;
+   }
+
+   /**
+    */
+   public String getQuestion()
+   {
+      return question;
+   }
+
+   public void setQuestion(String question)
+   {
+      this.question = question;
+   }
+
+   public void incVotes()
+   {
+      votes++;
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,246 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import java.util.LinkedList;
+
+import org.hibernate.search.annotations.DateBridge;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.FieldBridge;
+import org.hibernate.search.annotations.Fields;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.search.annotations.Resolution;
+import org.hibernate.search.annotations.Store;
+import org.jboss.portal.identity.User;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Attachment;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2066 $
+ */
+ at Indexed(index="posts")
+public class PostImpl
+   implements Serializable,
+   Post
+{
+
+   @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.TopicImpl.class)
+   private Topic topic;
+   private User user;
+   private int count;
+   private Date date;
+
+   @DocumentId
+   private Integer id;
+   
+   @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+   @DateBridge(resolution=Resolution.MINUTE)
+   private Date createDate;
+
+   @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.MessageImpl.class)
+   private Message message;
+   
+   @Field(name="userName", index=Index.UN_TOKENIZED, store=Store.YES, 
+           bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.UserNameTextBridge.class))
+   private Poster poster;
+   private List attachments;
+
+   /**
+    * Creates a new {@link PostImpl} object.
+    */
+   public PostImpl()
+   {
+      attachments = new LinkedList();
+   }
+
+   /**
+    */
+   public Topic getTopic()
+   {
+      return topic;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic DOCUMENT_ME
+    */
+   public void setTopic(Topic topic)
+   {
+      this.topic = topic;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public User getUser()
+   {
+      return user;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param user DOCUMENT_ME
+    */
+   public void setUser(User user)
+   {
+      this.user = user;
+   }
+
+   /**
+    */
+   public int getEditCount()
+   {
+      return count;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param count DOCUMENT_ME
+    */
+   public void setEditCount(int count)
+   {
+      this.count = count;
+   }
+
+   /**
+    */
+   public Date getEditDate()
+   {
+      return date;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param date DOCUMENT_ME
+    */
+   public void setEditDate(Date date)
+   {
+      this.date = date;
+   }
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param id DOCUMENT_ME
+    */
+   public void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /**
+    */
+   public Date getCreateDate()
+   {
+      return createDate;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param createDate DOCUMENT_ME
+    */
+   public void setCreateDate(Date createDate)
+   {
+      this.createDate = createDate;
+   }
+
+   /**
+    */
+   public Message getMessage()
+   {
+      return message;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param message DOCUMENT_ME
+    */
+   public void setMessage(Message message)
+   {
+      this.message = message;
+   }
+
+   /**
+    */
+   public Poster getPoster()
+   {
+      return poster;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param poster DOCUMENT_ME
+    */
+   public void setPoster(Poster poster)
+   {
+      this.poster = poster;
+   }
+
+
+   //TODO:BD - order it by something... is name ok?
+   /**
+    */
+   public List getAttachments()
+   {
+      return attachments;
+   }
+
+   public void setAttachments(List attachments)
+   {
+      this.attachments = attachments;
+   }
+
+   public void addAttachment(Attachment attachment)
+   {
+      attachment.setPost(this);
+      attachments.add(attachment);
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,162 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.FieldBridge;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.Store;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.core.modules.ModuleConstants;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 2811 $
+ */
+//@Indexed(index="posters")
+public class PosterImpl
+   implements Poster
+{
+   //@DocumentId
+   private Integer id;
+   private String userId;
+   //private String  userName;
+   
+   //@Field(name="userName", index=Index.UN_TOKENIZED, store=Store.YES, 
+   //        bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.UserNameTextBridge.class))
+   private User user;
+   private int nbPosts = 0;
+
+   /**
+    * Creates a new {@link PosterImpl} object.
+    */
+   public PosterImpl()
+   {
+   }
+
+   public PosterImpl(String userId)
+   {
+      setUserId(userId);
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public User getUser()
+   {
+      if (user == null)
+      {
+         try
+         {                                
+            UserModule userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
+            user = userModule.findUserById(userId);
+         }
+         catch (NamingException e)
+         {
+            return null;
+         }
+         catch (IllegalArgumentException e)
+         {
+            e.printStackTrace();
+            return null;
+         }
+         catch (NoSuchUserException e) {
+             return PortalUtil.getUserNA();
+         }
+         catch (IdentityException e)
+         {
+            e.printStackTrace();
+            return null;
+         }
+      }
+      return user;
+   }
+
+   /**
+    * @return Returns the id.
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   /**
+    * @param id The id to set.
+    */
+   public void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /**
+    * This column has the unique constraints as it reflects the user id.
+    *
+    * @return Returns the id.
+    */
+   public String getUserId()
+   {
+      return userId;
+   }
+
+   /**
+    * @param userId The id to set.
+    */
+   public void setUserId(String userId)
+   {
+      this.userId = userId;
+   }
+
+   /**
+    */
+   public int getPostCount()
+   {
+      return nbPosts;
+   }
+
+   private void setPostCount(int nbPosts)
+   {
+      this.nbPosts = nbPosts;
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   public void incrementPostCount()
+   {
+      setPostCount(nbPosts + 1);
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,419 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+import java.util.*;
+
+import javax.persistence.OneToMany;
+
+import org.hibernate.search.annotations.ContainedIn;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Fields;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.search.annotations.Store;
+import org.jboss.portlet.forums.model.*;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+ at Indexed(index="topics")
+public class TopicImpl
+   implements Serializable,
+   Comparable,
+   Topic
+{
+
+   @DocumentId
+   private Integer id;
+   private List posts;
+   
+   @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.ForumImpl.class)
+   private Forum forum;
+   private int viewCount;
+   //private Date       date;
+   private int        replies;
+   //private Post       firstPost;
+   //private Post       lastPost;
+   //this field is cached but was left as it's easier to sort topics with HQL having such column
+   private Date lastPostDate;
+   //private Date       editDate;
+   private Poster poster;
+   private int type;
+   private int status;
+   //private Topic      target;
+   
+   @Fields( {
+       @Field(index=Index.TOKENIZED),
+       @Field(name="subject_forSort", index=Index.UN_TOKENIZED, store=Store.YES)
+   } )
+   private String subject;
+   private List watches;
+   private Poll poll;
+
+   /**
+    * Creates a new {@link TopicImpl} object.
+    */
+   public TopicImpl()
+   {
+      setPosts(new ArrayList());
+   }
+
+
+   //we are implementing comparable to be able to sort topics by last post date without to have
+   //a column in db.
+   public int compareTo(Object comp)
+   {
+      Date thisDate = getLastPostDate();
+      Date thatDate = ((Topic)comp).getLastPostDate();
+      if (thisDate != null && (thatDate != null))
+      {
+         return thisDate.compareTo(thatDate);
+      }
+      else if (thisDate == null && (thatDate != null))
+      {
+         return -1;
+      }
+      else if (thisDate != null && (thatDate == null))
+      {
+         return 1;
+      }
+      else
+      {
+         return 0;
+      }
+   }
+
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param id DOCUMENT_ME
+    */
+   public void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /*
+    * __ at hibernate.collection-many-to-one
+    * __class="org.jboss.portlet.forums.impl.PostImpl"
+    */
+
+   /**
+    */
+   public List getPosts()
+   {
+      //Hibernate.initialize(posts);
+      return posts;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   public void setPosts(List value)
+   {
+      posts = value;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param post DOCUMENT_ME
+    */
+   public void addPost(Post post)
+   {
+      post.setTopic(this);
+      posts.add(post);
+   }
+
+   /**
+    */
+   public Forum getForum()
+   {
+      return forum;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    */
+   public void setForum(Forum forum)
+   {
+      this.forum = forum;
+   }
+
+   /**
+    */
+   public int getViewCount()
+   {
+      return viewCount;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param viewCount DOCUMENT_ME
+    */
+   public void setViewCount(int viewCount)
+   {
+      this.viewCount = viewCount;
+   }
+
+   /**
+    */
+   public int getReplies()
+   {
+
+      //return getPosts().size() - 1;
+      return replies;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param replies DOCUMENT_ME
+    */
+   public void setReplies(int replies)
+   {
+      this.replies = replies;
+   }
+
+       //TODO: Can be optimized
+   /**
+    * _ at _hibernate.many-to-one
+    * _column_="jbp_first_post_id"
+    * _class_="org.jboss.portlet.forums.impl.PostImpl"
+    */
+   public Post getFirstPost()
+   {
+       //return firstPost;
+       //Hibernate.initialize(posts);
+       if (posts == null || (posts.size() == 0))
+       {
+          return null;
+       }
+       return (Post)posts.get(0);
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param post DOCUMENT_ME
+    */
+   public void setFirstPost(Post post)
+   {
+      if (post != null)
+      {
+         posts.add(post);
+      }
+      //this.firstPost = post;
+   }
+
+   /**
+    * _ at _hibernate.many-to-one
+    * _column_="jbp_last_post_id"
+    * _class_="org.jboss.portlet.forums.impl.PostImpl"
+    */
+   public Post getLastPost()
+   {
+      //return lastPost;
+      //Hibernate.initialize(posts);
+      if (posts == null || (posts.size() == 0))
+      {
+         return null;
+      }
+      return (Post)posts.get(posts.size() - 1);
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param post DOCUMENT_ME
+    */
+   public void setLastPost(Post post)
+   {
+      if (post != null)
+      {
+         posts.add(post);
+      }
+      //forum.setLastPost(post);
+      //this.lastPost = post;
+   }
+
+   /**
+    */
+   public Date getLastPostDate()
+   {
+      return lastPostDate;
+      /*Post post = getLastPost();
+      if(post!=null)
+      {
+         return post.getCreateDate();
+      }
+      else
+      {
+         return null;
+      }
+*/
+
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param lastPostDate DOCUMENT_ME
+    */
+   public void setLastPostDate(Date lastPostDate)
+   {
+      this.lastPostDate = lastPostDate;
+   }
+
+   /**
+    */
+   public Poster getPoster()
+   {
+      return poster;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param poster DOCUMENT_ME
+    */
+   public void setPoster(Poster poster)
+   {
+      this.poster = poster;
+   }
+
+   /**
+    */
+   public int getType()
+   {
+      return type;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param type DOCUMENT_ME
+    */
+   public void setType(int type)
+   {
+      this.type = type;
+   }
+
+   /**
+    */
+   public int getStatus()
+   {
+      return status;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param status DOCUMENT_ME
+    */
+   public void setStatus(int status)
+   {
+      this.status = status;
+   }
+
+   /**
+    * _ at hibernate.one-to-one
+    *    _column="jbp_target"
+    *    _class="org.jboss.portlet.forums.impl.TopicImpl"
+    */
+   /*public Topic getTarget()
+   {
+      return target;
+   }*/
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param target DOCUMENT_ME
+    */
+   /*public void setTarget(Topic target)
+   {
+      this.target = target;
+   }*/
+
+   /**
+    */
+   public String getSubject()
+   {
+      return subject;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param subject DOCUMENT_ME
+    */
+   public void setSubject(String subject)
+   {
+      this.subject = subject;
+   }
+
+   /**
+    */
+   public List getWatches()
+   {
+      return watches;
+   }
+
+   public void setWatches(List watches)
+   {
+      this.watches = watches;
+   }
+
+   /**
+    */
+   public Poll getPoll()
+   {
+      return poll;
+   }
+
+   public void setPoll(Poll poll)
+   {
+      this.poll = poll;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicWatchImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicWatchImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicWatchImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import java.io.Serializable;
+
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.TopicWatch;
+import org.jboss.portlet.forums.model.Poster;
+
+/**
+ * Watchers of topics.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @version $Revision: 878 $
+ */
+public class TopicWatchImpl
+   extends WatchImpl
+   implements Serializable,
+   TopicWatch
+{
+
+   private Topic topic;
+
+   /**
+    * Creates a new {@link TopicWatchImpl} object.
+    */
+   public TopicWatchImpl()
+   {
+   }
+
+   /**
+    */
+   public Topic getTopic()
+   {
+      return topic;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic DOCUMENT_ME
+    */
+   public void setTopic(Topic topic)
+   {
+      this.topic = topic;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/TopicWatchImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/UploadedFileImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/UploadedFileImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/UploadedFileImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,157 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import org.jboss.portlet.forums.model.UploadedFile;
+import org.hibernate.Hibernate;
+
+import java.sql.Blob;
+import java.sql.SQLException;
+import java.io.Serializable;
+
+/**
+ * An uploaded file.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1018 $
+ */
+public class UploadedFileImpl implements UploadedFile, Serializable
+{
+
+   private String contentType;
+   private byte[] byteContent;
+   private Blob content;
+   private long size;
+   private String name;
+
+   /**
+    * @param contentType the file content type
+    * @param content the file chunk of bytes
+   * @param name the file name
+   * @param size the size of the file
+    */
+   public UploadedFileImpl(String contentType, byte[] content, String name, long size)
+   {
+      if (contentType == null)
+      {
+         throw new NullPointerException("Content type cannot be null");
+      }
+      if (content == null)
+      {
+         throw new NullPointerException("Content cannot be null");
+      }
+      this.contentType = contentType;
+      this.setByteContent(content);
+      this.content = Hibernate.createBlob(content);
+      this.size = size;
+      this.name = name;
+   }
+
+   /*public UploadedFileImpl(String contentType, Blob content, String name, long size)
+   {
+      if (contentType == null)
+      {
+         throw new NullPointerException("Content type cannot be null");
+      }
+      if (content == null)
+      {
+         throw new NullPointerException("Content cannot be null");
+      }
+      this.contentType = contentType;
+      try
+      {
+         this.setByteContent(content.getBytes(1,(int)content.length()));
+      }
+      catch (SQLException e)
+      {
+         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+      }
+      this.content = content;
+      this.size = size;
+      this.name = name;
+   }*/
+
+   public UploadedFileImpl()
+   {
+
+   }
+   /**
+    */
+   public String getContentType()
+   {
+      return contentType;
+   }
+
+   public void setContentType(String type)
+   {
+      this.contentType = type;
+   }
+
+   /**
+    */
+   public long getSize()
+   {
+        return size;
+   }
+
+   public void setSize(long size)
+   {
+      this.size = size;
+   }
+
+   /**
+    */
+   public String getName()
+   {
+        return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public byte[] getByteContent()
+   {
+      return byteContent;
+   }
+
+   public void setByteContent(byte[] byteContent)
+   {
+      this.byteContent = byteContent;
+   }
+
+   /**
+    */
+   public Blob getContent()
+   {
+      return content;
+   }
+
+   public void setContent(Blob content)
+   {
+      this.content = content;
+   }
+}
+


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/UploadedFileImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/WatchImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/WatchImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/WatchImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.impl;
+
+import org.jboss.portlet.forums.model.Watch;
+import org.jboss.portlet.forums.model.Poster;
+
+import java.io.Serializable;
+
+/**
+ * Watchers for email notifications.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 916 $
+ */
+public class WatchImpl implements Serializable, Watch
+{
+
+   /**
+    * .
+    */
+   private Integer id;
+
+   /**
+    * .
+    */
+   private int mode;
+
+   /**
+    * .
+    */
+   private Poster poster;
+
+   /**
+    */
+   public Integer getId()
+   {
+      return id;
+   }
+
+   /**
+    * Called by hibernate only.
+    */
+   private void setId(Integer id)
+   {
+      this.id = id;
+   }
+
+   /**
+    */
+   public Poster getPoster()
+   {
+      return poster;
+   }
+
+   public void setPoster(Poster poster)
+   {
+      this.poster = poster;
+   }
+
+   /**
+    */
+   public int getMode()
+   {
+      return mode;
+   }
+
+   public void setMode(int mode)
+   {
+      this.mode = mode;
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/impl/WatchImpl.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Attachment.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Attachment.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Attachment.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+
+/**
+ * An Attachment.
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1018 $
+ */
+public interface Attachment
+{
+   String getComment();
+
+   void setComment(String comment);
+
+   UploadedFile getFile();
+
+   void setFile(UploadedFile file);
+
+   public Integer getId();
+
+   void setPost(Post post);
+
+   Post getPost();
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Attachment.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/AuthType.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/AuthType.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/AuthType.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 878 $
+ */
+public class AuthType
+{
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int VIEW = 0;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int READ = 1;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int POST = 2;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int REPLY = 3;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int EDIT = 4;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int DELETE = 5;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int ANNOUNCE = 6;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int STICKY = 7;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int POLL = 8;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int VOTE = 9;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public static final int ATTACH = 10;
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/AuthType.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Category.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Category.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Category.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+public interface Category
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   List getForums();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   void setForums(List value);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   void addForum(Forum value);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getOrder();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param order DOCUMENT_ME
+    */
+   void setOrder(int order);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   String getTitle();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param title DOCUMENT_ME
+    */
+   void setTitle(String title);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Integer getId();
+   
+	/* Luca Stancapiano start - I add accessors to manage ForumInstance field 
+      so Category is tied to the Forum Instance. Now each category belong to a
+      Forum Instance so that we can to get different instances of forums with different
+      categories and different sub objects
+	*/
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @return DOCUMENT_ME
+	 */
+	ForumInstance getForumInstance();
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param category
+	 *            DOCUMENT_ME
+	 */
+	void setForumInstance(ForumInstance forumInstance);
+
+	// Luca Stancapiano end
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Category.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Forum.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Forum.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Forum.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,235 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * @version $Revision: 916 $
+ */
+public interface Forum
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Category getCategory();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param category DOCUMENT_ME
+    */
+   void setCategory(Category category);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   String getDescription();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param description DOCUMENT_ME
+    */
+   void setDescription(String description);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Integer getId();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   //Post getLastPost();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param lastpost DOCUMENT_ME
+    */
+   void setLastPost(Post lastpost);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   String getName();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    */
+   void setName(String name);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getOrder();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param order DOCUMENT_ME
+    */
+   void setOrder(int order);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getTopicCount();
+
+   /**
+    * DOCUMENT_ME
+    */
+   void addTopicSize();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param size DOCUMENT_ME
+    */
+   void setTopicCount(int size);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getPostCount();
+
+   /**
+    * DOCUMENT_ME
+    */
+   void addPostSize();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param size DOCUMENT_ME
+    */
+   void setPostCount(int size);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   boolean getPruneEnable();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param enable DOCUMENT_ME
+    */
+   void setPruneEnable(boolean enable);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getPruneNext();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param next DOCUMENT_ME
+    */
+   void setPruneNext(int next);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getStatus();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param status DOCUMENT_ME
+    */
+   void setStatus(int status);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   void setTopics(List value);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   List getTopics();
+
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   void addTopic(Topic value);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   //int getType();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param type DOCUMENT_ME
+    */
+   //void setType(int type);
+
+   /**
+    * @return DOCUMENT_ME
+    */
+   List getWatches();
+
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Forum.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumInstance.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumInstance.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumInstance.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
+ */
+public interface ForumInstance {
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @return DOCUMENT_ME
+	 */
+	Integer getId();
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @return DOCUMENT_ME
+	 */
+	String getName();
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param name
+	 *            DOCUMENT_ME
+	 */
+	void setName(String name);
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @return DOCUMENT_ME
+	 */
+	List getCategories();
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param value
+	 *            DOCUMENT_ME
+	 */
+	void setCategories(List value);
+
+	/**
+	 * DOCUMENT_ME
+	 * 
+	 * @param value
+	 *            DOCUMENT_ME
+	 */
+	void addCategory(Category value);
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumWatch.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumWatch.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumWatch.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 412 $
+ */
+public interface ForumWatch extends Watch
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Forum getForum();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    */
+   void setForum(Forum forum);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/ForumWatch.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Message.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Message.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Message.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+
+/**
+ * An object that groups the message informations for a post.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 412 $
+ */
+public interface Message
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getSubject();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param subject DOCUMENT_ME
+    */
+   public void setSubject(String subject);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getText();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param text DOCUMENT_ME
+    */
+   public void setText(String text);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getBBCodeEnabled();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param BBCodeEnabled DOCUMENT_ME
+    */
+   public void setBBCodeEnabled(boolean BBCodeEnabled);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getHTMLEnabled();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param HTMLEnabled DOCUMENT_ME
+    */
+   public void setHTMLEnabled(boolean HTMLEnabled);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getSmiliesEnabled();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param smiliesEnabled DOCUMENT_ME
+    */
+   public void setSmiliesEnabled(boolean smiliesEnabled);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean getSignatureEnabled();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param signatureEnabled DOCUMENT_ME
+    */
+   public void setSignatureEnabled(boolean signatureEnabled);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Message.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poll.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poll.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poll.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.*;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+public interface Poll
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Integer getId();
+
+   /**
+    * @param string
+    */
+   void setTitle(String string);
+
+   /**
+    * @param i
+    */
+   void setLength(int i);
+
+   /**
+    * @param list
+    */
+   void setOptions(List list);
+
+   /**
+    * @param set
+    */
+   void setVoted(Set set);
+
+   /**
+    * @param isEnded
+    */
+   /*void setIsEnded(boolean isEnded);*/
+
+   /**
+    * @param date
+    */
+   void setCreationDate(Date date);
+
+   /**
+    * @return
+    */
+   List getOptions();
+
+   /**
+    * @return
+    */
+   Set getVoted();
+
+   /**
+    * @return
+    */
+   String getTitle();
+
+   /**
+    * @return
+    */
+   int getLength();
+
+   /**
+    * @return
+    */
+   /*boolean getIsEnded();*/
+
+   /**
+    * @return
+    */
+   public int getVotesSum();
+
+   /**
+    * @return
+    */
+   public Date getCreationDate();
+
+
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poll.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/PollOption.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/PollOption.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/PollOption.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+public interface PollOption
+{
+   /**
+    * @param string
+    */
+   void setQuestion(String string);
+
+   /**
+    * @param i
+    */
+   void setVotes(int i);
+
+   /**
+    * @param
+    */
+   void incVotes();
+
+   /**
+    * @return
+    */
+   String getQuestion();
+
+   /**
+    * @return
+    */
+   int getVotes();
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/PollOption.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Post.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Post.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Post.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,128 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 1018 $
+ */
+public interface Post
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Topic getTopic();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic DOCUMENT_ME
+    */
+   void setTopic(Topic topic);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Poster getPoster();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param user DOCUMENT_ME
+    */
+   void setPoster(Poster user);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Message getMessage();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param message DOCUMENT_ME
+    */
+   void setMessage(Message message);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getEditCount();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param count DOCUMENT_ME
+    */
+   void setEditCount(int count);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Date getEditDate();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param date DOCUMENT_ME
+    */
+   void setEditDate(Date date);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Integer getId();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Date getCreateDate();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param createDate DOCUMENT_ME
+    */
+   void setCreateDate(Date createDate);
+
+   List getAttachments();
+
+   void addAttachment(Attachment attachment);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Post.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poster.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poster.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poster.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2066 $
+ */
+public interface Poster
+{
+   /**
+    * @return Returns the id of the user.
+    */
+   Integer getId();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   User getUser();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   String getUserId();
+
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getPostCount();
+
+   /**
+    * DOCUMENT_ME
+    */
+   void incrementPostCount();
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Poster.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Topic.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Topic.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Topic.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,265 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 916 $
+ */
+public interface Topic
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Integer getId();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param value DOCUMENT_ME
+    */
+   void setPosts(List value);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   List getPosts();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   void addPost(Post post);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Forum getForum();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param forum DOCUMENT_ME
+    */
+   void setForum(Forum forum);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getViewCount();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param views DOCUMENT_ME
+    */
+   void setViewCount(int views);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getReplies();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param replies DOCUMENT_ME
+    */
+   void setReplies(int replies);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Post getFirstPost();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param post DOCUMENT_ME
+    */
+   void setFirstPost(Post post);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Post getLastPost();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param id DOCUMENT_ME
+    */
+   void setLastPost(Post id);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Date getLastPostDate();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param lastPostDate DOCUMENT_ME
+    */
+   void setLastPostDate(Date lastPostDate);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+//   Date getCreateDate();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param date DOCUMENT_ME
+    */
+//   void setCreateDate(Date date);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+//   Date getEditDate();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param editDate DOCUMENT_ME
+    */
+//   void setEditDate(Date editDate);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Poster getPoster();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param poster DOCUMENT_ME
+    */
+   void setPoster(Poster poster);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getType();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param type DOCUMENT_ME
+    */
+   void setType(int type);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   int getStatus();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param status DOCUMENT_ME
+    */
+   void setStatus(int status);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   //Topic getTarget();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param target DOCUMENT_ME
+    */
+   //void setTarget(Topic target);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   String getSubject();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param subject DOCUMENT_ME
+    */
+   void setSubject(String subject);
+
+   /**
+    * @return
+    */
+   List getWatches();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Poll getPoll();
+
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param poll DOCUMENT_ME
+    */
+   void setPoll(Poll poll);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Topic.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/TopicWatch.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/TopicWatch.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/TopicWatch.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 412 $
+ */
+public interface TopicWatch extends Watch
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   Topic getTopic();
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topic DOCUMENT_ME
+    */
+   void setTopic(Topic topic);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/TopicWatch.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/UploadedFile.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/UploadedFile.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/UploadedFile.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+import java.sql.Blob;
+
+/**
+ * An uploaded file.
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1018 $
+ */
+public interface UploadedFile
+{
+   String getContentType();
+
+   void setContentType(String type);
+
+   byte[] getByteContent();
+
+   void setByteContent(byte[] bytes);
+
+   Blob getContent();
+
+   void setContent(Blob blob);
+
+   long getSize();
+
+   void setSize(long size);
+
+   String getName();
+
+   void setName(String name);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/UploadedFile.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Watch.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Watch.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Watch.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.model;
+
+/**
+ * An abstraction concept of watch which denotes a relationship between a poster and an item.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 916 $
+ */
+public interface Watch
+{
+
+   /**
+    * Return the watch ID.
+    */
+   Integer getId();
+
+   /**
+    * Return the poster.
+    */
+   Poster getPoster();
+
+   /**
+    * Set the poster.
+    */
+   void setPoster(Poster poster);
+
+   /**
+    * Return the mode.
+    */
+   int getMode();
+
+   /**
+    * Set the mode.
+    */
+   void setMode(int mode);
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/model/Watch.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/TCCLXProperties.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/TCCLXProperties.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/TCCLXProperties.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,124 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.properties;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portal.common.util.Tools;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 878 $
+ */
+public class TCCLXProperties
+   extends XProperties
+{
+   private Map props = new HashMap();
+   private Map urls = new HashMap();
+
+   /**
+    * Creates a new {@link TCCLXProperties} object.
+    *
+    * @param base DOCUMENT_ME
+    * @param name DOCUMENT_ME
+    * @throws IOException DOCUMENT_ME
+    */
+   public TCCLXProperties(String base,
+                          String name)
+      throws IOException
+   {
+      this(Thread.currentThread().getContextClassLoader(), base, name);
+   }
+
+   /**
+    * Creates a new {@link TCCLXProperties} object.
+    *
+    * @param loader DOCUMENT_ME
+    * @param base   DOCUMENT_ME
+    * @param name   DOCUMENT_ME
+    * @throws IOException DOCUMENT_ME
+    */
+   public TCCLXProperties(ClassLoader loader,
+                          String base,
+                          String name)
+      throws IOException
+   {
+      InputStream in = null;
+      try
+      {
+         // load the data
+         in = loader.getResourceAsStream(base + "/" + name);
+
+         // feed the properties
+         Properties temp = new Properties();
+         temp.load(in);
+         props.putAll(temp);
+
+         // feed the URLs
+         //         String resourceBase = base.substring("org.jboss.portlet/forums/".length()) + "/";
+         //         String resourceBase = base + "/";
+         for (Iterator i = props.entrySet().iterator(); i.hasNext();)
+         {
+            Map.Entry entry = (Map.Entry)i.next();
+
+            urls.put(entry.getKey(),
+            		JSFUtil.getContextPath() + "/" + ForumsConstants.THEMENAME + "/" + entry.getValue());
+         }
+      }
+      finally
+      {
+         in.close();
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public String getProperty(String name)
+   {
+      Object value = props.get(name);
+      return (value != null) ? (String)value : "";
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public String getResourceURL(String name)
+   {
+      Object value = urls.get(name);
+      return (value != null) ? (String)value : "";
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/TCCLXProperties.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/XProperties.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/XProperties.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/XProperties.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.properties;
+
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 878 $
+ */
+public abstract class XProperties
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public abstract String getResourceURL(String name);
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public abstract String getProperty(String name);
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/properties/XProperties.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/DisplayAs.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/DisplayAs.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/DisplayAs.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+package org.jboss.portlet.forums.search;
+
+public enum DisplayAs {
+
+    TOPICS, POSTS;
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,313 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import org.apache.log4j.Logger;
+import org.apache.lucene.index.IndexReader;
+import org.hibernate.CacheMode;
+import org.hibernate.FetchMode;
+import org.hibernate.FlushMode;
+import org.hibernate.HibernateException;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.system.ServiceMBeanSupport;
+
+public class ForumsIndexBuilder extends ServiceMBeanSupport 
+    implements ForumsIndexBuilderMBean {
+
+    private final Logger log = Logger.getLogger(getClass());
+
+    private HibernateProvider hibernate;
+    
+    private SessionFactory sessionFactory;
+
+    private String indexBase;
+    
+    private int batchSize;
+    
+    /**
+     * @jmx.managed-attribute
+     */
+    public HibernateProvider getHibernate()
+    {
+        return hibernate;
+    }
+
+    /**
+     * @jmx.managed-attribute
+     */
+    public void setHibernate(HibernateProvider hibernate)
+    {
+        this.hibernate = hibernate;
+    }
+
+    @Override
+    protected void startService() throws Exception
+    {
+        sessionFactory = hibernate.getSessionFactory();
+        
+        Configuration configuration = hibernate.getConfig();
+        
+        indexBase = configuration.getProperty("hibernate.search.default.indexBase");
+        if (indexBase == null) {
+            throw new Exception("The config hibernate.search.default.indexBase has not been set");
+        }
+        
+        String batchSize = configuration.getProperty("org.hibernate.worker.batch_size");
+        if (batchSize == null) {
+            throw new Exception("The config org.hibernate.worker.batch_size has not been set");
+        } else {
+            this.batchSize = Integer.valueOf(batchSize);
+        }
+        
+    }
+
+    public void deleteIndex()
+    {
+        Session session = getSession();
+        FullTextSession fullTextSession = Search.createFullTextSession(session);
+            
+        if (IndexReader.indexExists(indexBase + "/posts")) {
+
+            fullTextSession.purgeAll(PostImpl.class);
+            
+            fullTextSession.getSearchFactory().optimize();
+            
+        } else {
+            new RuntimeException("Index directory " + indexBase + "/posts" + "does not exist");
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void rebuildIndexForAllForums()
+    {
+        Transaction transaction = null;
+
+        try {
+            Session session = getSession();
+            FullTextSession fullTextSession = Search.createFullTextSession(session);
+            
+            transaction = fullTextSession.beginTransaction();
+
+            if (IndexReader.indexExists(indexBase + "/posts")) {
+
+                fullTextSession.purgeAll(PostImpl.class);
+                
+                fullTextSession.getSearchFactory().optimize(PostImpl.class);
+    
+                transaction.commit();
+    
+                log.debug("indexing documents in batches of: " + batchSize);
+    
+                fullTextSession.setFlushMode(FlushMode.MANUAL);
+                fullTextSession.setCacheMode(CacheMode.IGNORE);
+
+                transaction = fullTextSession.beginTransaction();
+                
+                ScrollableResults results = fullTextSession.createCriteria(PostImpl.class).
+                    setFetchMode("topic", FetchMode.JOIN).
+                    setFetchMode("topic.forum", FetchMode.JOIN).
+                    setFetchMode("topic.forum.category", FetchMode.JOIN).
+                    setFetchMode("poster", FetchMode.JOIN).
+                    scroll(ScrollMode.FORWARD_ONLY);
+                
+                int index = 0;
+                while(results.next()) {
+                    index++;
+                    fullTextSession.index(results.get(0));
+                    if (index % batchSize == 0) 
+                        session.clear();
+                }
+                
+                results.close();
+                transaction.commit();
+    
+                log.debug("indexing completed");
+            } else {
+                new RuntimeException("Index directory " + indexBase + "/posts" + "does not exist");
+            }
+        } catch (HibernateException e) {
+            try {
+                if (transaction != null) 
+                    transaction.rollback();
+            } catch (Exception re) {
+                log.error(e.getMessage(), e);
+            }
+            
+            log.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void buildIndexForGivenForum(Integer forumId)
+    {
+        if (forumId != null) {
+            Transaction transaction = null;
+    
+            try {
+                if (IndexReader.indexExists(indexBase + "/posts")) {
+                    Session session = getSession();
+                    FullTextSession fullTextSession = Search.createFullTextSession(session);
+                    
+                    log.debug("indexing documents in batches of: " + batchSize);
+                    fullTextSession.setFlushMode(FlushMode.MANUAL);
+                    fullTextSession.setCacheMode(CacheMode.IGNORE);
+    
+                    transaction = fullTextSession.beginTransaction();
+                    
+                    ScrollableResults results = fullTextSession.createCriteria(PostImpl.class).
+                        setFetchMode("topic.forum.category", FetchMode.JOIN).
+                        setFetchMode("poster", FetchMode.JOIN).
+                        createCriteria("topic").
+                        createAlias("forum", "f").
+                        add(Restrictions.eq("f.id", forumId)).
+                        scroll(ScrollMode.FORWARD_ONLY);
+                    
+                    int index = 0;
+                    while(results.next()) {
+                        index++;
+                        fullTextSession.index(results.get(0));
+                        if (index % batchSize == 0) 
+                            session.clear();
+                    }
+                    
+                    results.close();
+                    transaction.commit();
+                    
+                    log.debug("indexing completed");
+                } else {
+                    new RuntimeException("Index directory " + indexBase + "/posts" + "does not exist");
+                }
+            } catch (HibernateException e) {
+                try {
+                    if (transaction != null) 
+                        transaction.rollback();
+                } catch (Exception re) {
+                    log.error(e.getMessage(), e);
+                }
+                
+                log.error(e.getMessage(), e);
+                throw new RuntimeException(e);
+            }
+        } else {
+            new RuntimeException("Forum id has not been given");
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void buildIndexForGivenTopic(Integer topicId)
+    {
+        if (topicId != null) {
+            Transaction transaction = null;
+    
+            try {
+                Session session = getSession();
+                FullTextSession fullTextSession = Search.createFullTextSession(session);
+                
+                transaction = fullTextSession.beginTransaction();
+    
+                if (IndexReader.indexExists(indexBase + "/posts")) {
+    
+                    fullTextSession.purgeAll(PostImpl.class);
+                    
+                    fullTextSession.getSearchFactory().optimize(PostImpl.class);
+        
+                    transaction.commit();
+        
+                    log.debug("indexing documents in batches of: " + batchSize);
+        
+                    fullTextSession.setFlushMode(FlushMode.MANUAL);
+                    fullTextSession.setCacheMode(CacheMode.IGNORE);
+    
+                    transaction = fullTextSession.beginTransaction();
+                    
+                    ScrollableResults results = fullTextSession.createCriteria(PostImpl.class).
+                        setFetchMode("topic.forum.category", FetchMode.JOIN).
+                        setFetchMode("poster", FetchMode.JOIN).
+                        createAlias("topic", "t").
+                        add(Restrictions.eq("t.id", topicId)).
+                        scroll(ScrollMode.FORWARD_ONLY);
+                    
+                    int index = 0;
+                    while(results.next()) {
+                        index++;
+                        fullTextSession.index(results.get(0));
+                        if (index % batchSize == 0) 
+                            session.clear();
+                    }
+                    
+                    results.close();
+                    transaction.commit();
+        
+                    log.debug("indexing completed");
+                } else {
+                    new RuntimeException("Index directory " + indexBase + "/posts" + "does not exist");
+                }
+            } catch (HibernateException e) {
+                try {
+                    if (transaction != null) 
+                        transaction.rollback();
+                } catch (Exception re) {
+                    log.error(e.getMessage(), e);
+                }
+                
+                log.error(e.getMessage(), e);
+                throw new RuntimeException(e);
+            }
+        } else {
+            new RuntimeException("Topic id has not been given");
+        }
+    }
+    
+    public void optimizeIndex()
+    {
+        Session session = getSession();
+        FullTextSession fullTextSession = Search.createFullTextSession(session);
+            
+        if (IndexReader.indexExists(indexBase + "/posts")) {
+                
+            fullTextSession.getSearchFactory().optimize();
+                
+        } else {
+            new RuntimeException("Index directory " + indexBase + "/posts" + "does not exist");
+        }
+    }
+    
+    protected Session getSession()
+    {
+        Session session = sessionFactory.openSession();
+        
+        return session;
+    }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilderMBean.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilderMBean.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilderMBean.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.system.ServiceMBean;
+
+public interface ForumsIndexBuilderMBean extends ServiceMBean {
+
+    public HibernateProvider getHibernate();
+    
+    public void setHibernate(HibernateProvider hibernate);
+    
+    public void deleteIndex();
+    
+    public void rebuildIndexForAllForums();
+    
+    public void buildIndexForGivenForum(Integer forumId);
+    
+    public void buildIndexForGivenTopic(Integer topicId);
+    
+    public void optimizeIndex();
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModule.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModule.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModule.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+
+public interface ForumsSearchModule {
+
+	public HibernateProvider getHibernate();
+	
+	public ResultPage<Post> findPosts(SearchCriteria criteria) throws ModuleException;
+	
+	public ResultPage<Topic> findTopics(SearchCriteria criteria) throws ModuleException;
+	
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,355 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.DateTools;
+import org.apache.lucene.document.DateTools.Resolution;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.MultiFieldQueryParser;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.WildcardQuery;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.search.FullTextQuery;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.jboss.portal.core.modules.AbstractModule;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.jems.hibernate.HibernateProvider;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+
+public class ForumsSearchModuleImpl extends AbstractModule implements ForumsSearchModule {
+
+    private final Logger log = Logger.getLogger(getClass());
+
+    private HibernateProvider hibernate;
+
+    private SessionFactory factory;
+
+    protected void startService() throws Exception {
+        super.startService();
+
+        factory = hibernate.getSessionFactory();
+    }
+
+    /**
+     * @jmx.managed-attribute
+     */
+    public HibernateProvider getHibernate() {
+        return hibernate;
+    }
+
+    /**
+     * @jmx.managed-attribute
+     */
+    public void setHibernate(HibernateProvider hibernate)
+    {
+        this.hibernate = hibernate;
+    }
+	
+    @SuppressWarnings("unchecked")
+    public ResultPage<Post> findPosts(SearchCriteria criteria) throws ModuleException {
+        if (criteria != null) {
+            try {
+                Session session = getSession();
+                FullTextSession fullTextSession = Search.createFullTextSession(session);
+		  
+                BooleanQuery query = new BooleanQuery();
+                
+                String keywords = criteria.getKeywords();
+                if (keywords != null && keywords.length() != 0) {
+                    String[] fields = null;
+                    
+                    Searching searching = Searching.valueOf(criteria.getSearching());
+                    switch(searching) {
+                        case TITLE_MSG:
+                            fields = new String[] { "message.text", "topic.subject" };
+                            
+                            break;
+                        case MSG:
+                            fields = new String[] { "message.text" };
+                            
+                            break;
+                    }
+                    
+                    MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
+                    query.add(parser.parse(keywords), Occur.MUST);
+                }
+                
+                String forumId = criteria.getForum();
+                if (forumId != null && forumId.length() != 0) {
+                    query.add(new TermQuery(new Term("topic.forum.id", forumId)), Occur.MUST);
+                }
+                
+                String categoryId = criteria.getCategory();
+                if (categoryId != null && categoryId.length() != 0) {
+                    query.add(new TermQuery(new Term("topic.forum.category.id", categoryId)), Occur.MUST);
+                }
+                
+                String userName = criteria.getAuthor();
+                if (userName != null && userName.length() != 0) {
+                    query.add(new WildcardQuery(new Term("userName", userName)), Occur.MUST);
+                }
+                
+                String timePeriod = criteria.getTimePeriod();
+                if (timePeriod != null && timePeriod.length() != 0) {
+                    addPostTimeQuery(query, TimePeriod.valueOf(timePeriod));
+                }
+                
+                FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(query, PostImpl.class);
+
+                SortOrder sortOrder = SortOrder.valueOf(criteria.getSortOrder());
+                SortBy sortBy = SortBy.valueOf(criteria.getSortBy());
+                fullTextQuery.setSort(getSort(sortBy, sortOrder));
+                
+                fullTextQuery.setFirstResult(criteria.getPageSize() * criteria.getPageNumber());
+                fullTextQuery.setMaxResults(criteria.getPageSize());
+                
+                ResultPage<Post> resultPage = new ResultPage<Post>();
+                resultPage.setPage(fullTextQuery.list());
+                resultPage.setResultSize(fullTextQuery.getResultSize());
+                
+                return resultPage;
+            } catch (ParseException e) {
+                
+                return null;
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                throw new ModuleException(e.getMessage(), e);
+            }
+        } else {
+            throw new IllegalArgumentException("criteria cannot be null");
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    public ResultPage<Topic> findTopics(SearchCriteria criteria) throws ModuleException {
+        if (criteria != null) {
+            try {
+                Session session = getSession();
+                FullTextSession fullTextSession = Search.createFullTextSession(session);
+          
+                BooleanQuery query = new BooleanQuery();
+                
+                String keywords = criteria.getKeywords();
+                if (keywords != null && keywords.length() != 0) {
+                    String[] fields = null;
+                    
+                    Searching searching = Searching.valueOf(criteria.getSearching());
+                    switch(searching) {
+                        case TITLE_MSG:
+                            fields = new String[] { "message.text", "topic.subject" };
+                            
+                            break;
+                        case MSG:
+                            fields = new String[] { "message.text" };
+                            
+                            break;
+                    }
+                    
+                    MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
+                    query.add(parser.parse(keywords), Occur.MUST);
+                }
+                
+                String forumId = criteria.getForum();
+                if (forumId != null && forumId.length() != 0) {
+                    query.add(new TermQuery(new Term("topic.forum.id", forumId)), Occur.MUST);
+                }
+                
+                String categoryId = criteria.getCategory();
+                if (categoryId != null && categoryId.length() != 0) {
+                    query.add(new TermQuery(new Term("topic.forum.category.id", categoryId)), Occur.MUST);
+                }
+                
+                String userName = criteria.getAuthor();
+                if (userName != null && userName.length() != 0) {
+                    query.add(new WildcardQuery(new Term("userName", userName)), Occur.MUST);
+                }
+                
+                String timePeriod = criteria.getTimePeriod();
+                if (timePeriod != null && timePeriod.length() != 0) {
+                    addPostTimeQuery(query, TimePeriod.valueOf(timePeriod));
+                }
+                
+                FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(query, PostImpl.class);
+                
+                SortOrder sortOrder = SortOrder.valueOf(criteria.getSortOrder());
+                SortBy sortBy = SortBy.valueOf(criteria.getSortBy());
+                fullTextQuery.setSort(getSort(sortBy, sortOrder));
+
+                fullTextQuery.setProjection("topic.id");
+                
+                LinkedHashSet<Integer> topicIds = new LinkedHashSet<Integer>();
+                LinkedHashSet<Integer> topicToDispIds = new LinkedHashSet<Integer>();
+                
+                int start = criteria.getPageSize() * criteria.getPageNumber();
+                int end = start + criteria.getPageSize();
+                int index = 0;
+                for (Object o : fullTextQuery.list()) {
+                    Integer id = (Integer) ((Object[]) o)[0];
+                    
+                    if (topicIds.add(id)) {
+                        
+                        if (index >= start && index < end) {
+                            topicToDispIds.add(id);
+                        }                        
+                        
+                        index++;
+                    }
+                }
+               
+                Query q = session.createQuery("from TopicImpl as t join fetch t.poster where t.id IN ( :topicIds )");
+                q.setParameterList("topicIds", topicToDispIds);
+                
+                List<Topic> results = q.list();
+                
+                List<Topic> topics = new LinkedList<Topic>();
+                for (Integer id : topicToDispIds) {
+                    for (Topic topic : results) {
+                        if (id.equals(topic.getId())) {
+                            topics.add(topic);
+                            break;
+                        }
+                    }
+                }
+                
+                ResultPage<Topic> resultPage = new ResultPage<Topic>();
+                resultPage.setPage(topics);
+                resultPage.setResultSize(topicIds.size());
+                
+                return resultPage;
+            } catch (ParseException e) {
+                
+                return null;
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                throw new ModuleException(e.getMessage(), e);
+            }
+        } else {
+            throw new IllegalArgumentException("criteria cannot be null");
+        }
+    }
+	
+    protected org.apache.lucene.search.Sort getSort(SortBy sortBy, SortOrder sortOrder) {
+        
+        String fieldName = null;
+        
+        if (sortBy != null) {
+            fieldName = sortBy.getFieldName();
+        }
+        
+        if (fieldName == null) {
+            fieldName = SortBy.POST_TIME.getFieldName();
+        }
+        
+        boolean reverse = false;
+        
+        if (sortOrder == SortOrder.DESC) {
+            reverse = true;
+        }
+        
+        org.apache.lucene.search.Sort sort = new org.apache.lucene.search.Sort(new SortField(fieldName, reverse));
+        
+        return sort;
+    }
+    
+    protected void addPostTimeQuery(BooleanQuery query, TimePeriod period) {
+        
+        if (period != TimePeriod.ALL) {
+            Calendar calendar = Calendar.getInstance();
+
+            Date startDate = null;
+            Date endDate = calendar.getTime();
+            
+            switch(period) {
+                case DAY:
+                    calendar.add(Calendar.DATE, -1);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case SEVEN_DAYS:
+                    calendar.add(Calendar.DATE, -7);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case TWO_WEEKS:
+                    calendar.add(Calendar.DATE, -14);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case MONTH:
+                    calendar.add(Calendar.MONTH, -1);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case THREE_MONTHS:
+                    calendar.add(Calendar.MONTH, -3);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case SIX_MONTHS:
+                    calendar.add(Calendar.MONTH, -6);
+                    startDate = calendar.getTime();
+                    
+                    break;
+                case YEAR:
+                    calendar.add(Calendar.YEAR, -1);
+                    startDate = calendar.getTime();
+                    
+                    break;
+            }
+            
+            if (startDate != null) {
+                Term start = new Term("createDate", DateTools.dateToString(startDate, 
+                        Resolution.MINUTE));
+                Term end = new Term("createDate", DateTools.dateToString(endDate, 
+                        Resolution.MINUTE));
+                
+                query.add(new RangeQuery(start, end, true), Occur.MUST);
+            }
+        }
+    }
+    
+    protected Session getSession() {
+    	Session session = factory.getCurrentSession();
+    	
+    	return session;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ResultPage.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ResultPage.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/ResultPage.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ResultPage<T> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    
+    private List<T> page;
+
+    private int resultSize;
+
+    public List<T> getPage() {
+        return page;
+    }
+
+    public void setPage(List<T> page) {
+        this.page = page;
+    }
+
+    public int getResultSize() {
+        return resultSize;
+    }
+
+    public void setResultSize(int resultSize) {
+        this.resultSize = resultSize;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SearchCriteria.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SearchCriteria.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SearchCriteria.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+import java.io.Serializable;
+
+public class SearchCriteria implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    
+	private String keywords;
+	
+	private String author;
+	
+	private String category;
+	
+	private String forum;
+	
+	private String timePeriod;
+	
+	private String searching;
+	
+	private String sortBy;
+	
+	private String sortOrder;
+	
+	private int pageSize;
+	
+	private int pageNumber;
+
+	private String displayAs;
+	
+	public String getKeywords() {
+		return keywords;
+	}
+
+	public void setKeywords(String keywords) {
+		this.keywords = keywords;
+	}
+
+	public String getAuthor() {
+		return author;
+	}
+
+	public void setAuthor(String author) {
+		this.author = author;
+	}
+
+	public String getCategory() {
+		return category;
+	}
+
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	public String getForum() {
+		return forum;
+	}
+
+	public void setForum(String forum) {
+		this.forum = forum;
+	}
+
+	public String getTimePeriod() {
+		return timePeriod;
+	}
+
+	public void setTimePeriod(String timePeriod) {
+		this.timePeriod = timePeriod;
+	}
+
+	public String getSearching() {
+		if (searching == null || searching.length() == 0)
+			searching = Searching.TITLE_MSG.name();
+		
+		return searching;
+	}
+
+	public void setSearching(String searching) {
+		this.searching = searching;
+	}
+
+	public String getSortBy() {
+		return sortBy;
+	}
+
+	public void setSortBy(String sortBy) {
+		this.sortBy = sortBy;
+	}
+
+	public String getSortOrder() {
+		if (sortOrder == null || sortOrder.length() == 0)
+			sortOrder = SortOrder.ASC.name();
+		
+		return sortOrder;
+	}
+
+	public void setSortOrder(String sortOrder) {
+		this.sortOrder = sortOrder;
+	}
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public int getPageNumber() {
+        return pageNumber;
+    }
+
+    public void setPageNumber(int pageNumber) {
+        this.pageNumber = pageNumber;
+    }
+
+    public String getDisplayAs() {
+        if (displayAs == null || displayAs.length() == 0)
+            displayAs = DisplayAs.POSTS.name();
+        
+        return displayAs;
+    }
+
+    public void setDisplayAs(String displayAs) {
+        this.displayAs = displayAs;
+    }
+    
+}
+   
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/Searching.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/Searching.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/Searching.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+public enum Searching {
+
+    TITLE_MSG("titlemessage"), MSG("message");
+    
+    private String name;
+    
+    private Searching(String name) {
+        this.name = name;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+public enum SortBy {
+
+	POST_TIME("createDate"),
+	POST_SUBJECT("topic.subject_forSort"), 
+	AUTHOR("userName"), 
+	FORUM("topic.forum.id");
+	
+	private String fieldName;
+	
+	private SortBy(String fieldName) {
+		this.fieldName = fieldName;
+	}
+	
+	public String getFieldName() {
+		return fieldName;
+	}
+	
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortOrder.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortOrder.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/SortOrder.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+public enum SortOrder {
+    
+    ASC, DESC;
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/TimePeriod.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/TimePeriod.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/TimePeriod.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search;
+
+public enum TimePeriod {
+
+	ALL, DAY, SEVEN_DAYS, TWO_WEEKS, MONTH, THREE_MONTHS, SIX_MONTHS, YEAR;
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.search.bridge;
+
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+import org.hibernate.search.bridge.builtin.StringBridge;
+import org.jboss.portal.core.modules.ModuleConstants;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+public class UserNameTextBridge extends StringBridge {
+
+    private final Logger log = Logger.getLogger(getClass());
+    
+	@Override
+	public String objectToString(Object object) {
+
+	    if (object != null) {	            
+	        Poster poster = (Poster) object; 
+		
+    		try {
+    		    String id = poster.getUserId();
+
+    		    UserModule userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
+    		    User user = userModule.findUserById(id);
+    		    
+  		        if (user != null) {
+   		            return user.getUserName();
+   		        }
+    		} catch (Throwable t) {
+    		    log.error(t.getMessage(), t);
+            }
+	    }
+		
+		return PortalUtil.getUserNA().getUserName();
+		
+		/*User user = (User) object;
+		
+		return user.getUserName();*/
+	}
+
+}
+ 
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/FolderType.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/FolderType.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/FolderType.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.theme;
+
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 878 $
+ */
+public class FolderType
+{
+   /**
+    * DOCUMENT_ME
+    */
+   public final String folder;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public final String folderNew;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public final String type;
+
+   /**
+    * Creates a new {@link FolderType} object.
+    *
+    * @param folder    DOCUMENT_ME
+    * @param folderNew DOCUMENT_ME
+    * @param type      DOCUMENT_ME
+    */
+   public FolderType(String folder,
+                     String folderNew,
+                     String type)
+   {
+      this.folder = folder;
+      this.folderNew = folderNew;
+      this.type = type;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/FolderType.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,585 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.theme;
+
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.properties.XProperties;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:julien at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ForumsTheme
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param type   DOCUMENT_ME
+    * @param status DOCUMENT_ME
+    * @param hot    DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public FolderType getFolderType(int type,
+                                   int status,
+                                   boolean hot)
+   {
+       switch (type)
+       {
+           case ForumsConstants.POST_ANNOUNCE:
+               if (status == ForumsConstants.TOPIC_LOCKED)
+               {
+                  return FOLDER_ANNOUNCE_LOCKED;
+               }
+               else
+               {
+                   return FOLDER_ANNOUNCE;
+               }
+           
+           case ForumsConstants.POST_STICKY:
+               if (status == ForumsConstants.TOPIC_LOCKED)
+               {
+                  return FOLDER_STICKY_LOCKED;
+               }
+               else
+               {
+                   return FOLDER_STICKY;
+               }
+           
+           default:
+           {
+               if (status == ForumsConstants.TOPIC_LOCKED)
+               {
+                  return FOLDER_NORMAL_LOCKED;
+               }
+               else
+               {
+                   if (hot)
+                   {
+                      return FOLDER_HOT;
+                   }
+                   else
+                   {
+                      return FOLDER_NORMAL;
+                   }
+               }
+           }
+       }
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_ANNOUNCE;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_STICKY;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_ANNOUNCE_LOCKED;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_STICKY_LOCKED;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_NORMAL_LOCKED;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_NORMAL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public FolderType FOLDER_HOT;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceForumURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceForumNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceForumNewBigURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceForumLockedURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconLatestReplyURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconNewestReplyURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconGotopostURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconFeedURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderAnnounceURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderAnnounceNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderStickyURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderStickyNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderLockedURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderLockedNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderHotURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceFolderHotNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourcePostLockedURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourcePollVotingBar;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourcePollVotingLBar;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourcePollVotingRBar;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourcePostNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModeDeleteURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModeDeleteDisaURL;   
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModMoveURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModLockURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModUnlockURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicModSplitURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminNewCategoryURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminNewForumURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminArrowUpURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminArrowUpDisaURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminArrowDownURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceAdminArrowDownDisaURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicUnWatchURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceTopicWatchURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceReplyNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceReplyLockedURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconProfileURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconPMURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconEmailURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconWWWURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconICQURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconAIMURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconMSNMURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconSkypeURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconYIMURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconQuoteURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconSearchURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconEditURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconRepostURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconIPURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconDelpostURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconMinipostURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconMinipostNewURL;
+
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconSpacerURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconSubscribeURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconUnSubscribeURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconLockURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconUnlockURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconDialogWarningURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconDialogErrorURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconDialogQuestionURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconModerateURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceIconForumsLogoURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceSpacerURL;
+   
+   /**
+    * DOCUMENT_ME
+    */
+   public String resourceHeadStylesheetURL;
+   private XProperties xprops;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param xprops DOCUMENT_ME
+    */
+   public void setExtendedProperties(XProperties xprops)
+   {
+      this.xprops = xprops;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public String getProperty(String name)
+   {
+      return xprops.getProperty(name);
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    * @return DOCUMENT_ME
+    */
+   public String getResourceURL(String name)
+   {
+      return xprops.getResourceURL(name);
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @throws Exception DOCUMENT_ME
+    */
+   public void start()
+      throws Exception
+   {
+      resourceForumURL = xprops.getResourceURL("forum");
+      resourceForumNewURL = xprops.getResourceURL("forum_new");
+      resourceForumNewBigURL = xprops.getResourceURL("forum_new_big");
+      resourceForumLockedURL = xprops.getResourceURL("forum_locked");
+      resourceIconLatestReplyURL = xprops.getResourceURL("icon_latest_reply");
+      resourceIconNewestReplyURL = xprops.getResourceURL("icon_newest_reply");
+      resourceIconGotopostURL = xprops.getResourceURL("icon_gotopost");
+      resourceIconFeedURL = xprops.getResourceURL("icon_feed");
+      resourceFolderURL = xprops.getResourceURL("folder");
+      resourceFolderNewURL = xprops.getResourceURL("folder_new");
+      resourceFolderAnnounceURL = xprops.getResourceURL("folder_announce");
+      resourceFolderAnnounceNewURL = xprops.getResourceURL("folder_announce_new");
+      resourceFolderStickyURL = xprops.getResourceURL("folder_sticky");
+      resourceFolderStickyNewURL = xprops.getResourceURL("folder_sticky_new");
+      resourceFolderLockedURL = xprops.getResourceURL("folder_locked");
+      resourceFolderLockedNewURL = xprops.getResourceURL("folder_locked_new");
+      resourceFolderHotURL = xprops.getResourceURL("folder_hot");
+      resourceFolderHotNewURL = xprops.getResourceURL("folder_hot_new");
+      resourcePollVotingBar = xprops.getResourceURL("voting_graphic_0");
+      resourcePollVotingLBar = xprops.getResourceURL("vote_lcap");
+      resourcePollVotingRBar = xprops.getResourceURL("vote_rcap");
+      resourcePostLockedURL = xprops.getResourceURL("post_locked");
+      resourcePostNewURL = xprops.getResourceURL("post_new");
+      resourceTopicModeDeleteURL = xprops.getResourceURL("topic_mod_delete");
+      resourceTopicModeDeleteDisaURL = xprops.getResourceURL("topic_mod_delete_disa");
+      resourceTopicModMoveURL = xprops.getResourceURL("topic_mod_move");
+      resourceTopicModLockURL = xprops.getResourceURL("topic_mod_lock");
+      resourceTopicModUnlockURL = xprops.getResourceURL("topic_mod_unlock");
+      resourceTopicModSplitURL = xprops.getResourceURL("topic_mod_split");
+      resourceAdminNewCategoryURL = xprops.getResourceURL("admin_newcategory");
+      resourceAdminNewForumURL = xprops.getResourceURL("admin_newforum");
+      resourceAdminArrowUpURL = xprops.getResourceURL("admin_arrowup");
+      resourceAdminArrowUpDisaURL = xprops.getResourceURL("admin_arrowup_disa");
+      resourceAdminArrowDownURL = xprops.getResourceURL("admin_arrowdown");
+      resourceAdminArrowDownDisaURL = xprops.getResourceURL("admin_arrowdown_disa");
+      resourceTopicUnWatchURL = xprops.getResourceURL("topic_un_watch");
+      resourceTopicWatchURL = xprops.getResourceURL("topic_watch");
+      resourceReplyNewURL = xprops.getResourceURL("reply_new");
+      resourceReplyLockedURL = xprops.getResourceURL("reply_locked");
+      resourceIconProfileURL = xprops.getResourceURL("icon_profile");
+      resourceIconPMURL = xprops.getResourceURL("icon_pm");
+      resourceIconEmailURL = xprops.getResourceURL("icon_email");
+      resourceIconWWWURL = xprops.getResourceURL("icon_www");
+      resourceIconICQURL = xprops.getResourceURL("icon_icq");
+      resourceIconAIMURL = xprops.getResourceURL("icon_aim");
+      resourceIconMSNMURL = xprops.getResourceURL("icon_msnm");
+      resourceIconSkypeURL = xprops.getResourceURL("icon_skype");
+      resourceIconYIMURL = xprops.getResourceURL("icon_yim");
+      resourceIconQuoteURL = xprops.getResourceURL("icon_quote");
+      resourceIconSearchURL = xprops.getResourceURL("icon_search");
+      resourceIconEditURL = xprops.getResourceURL("icon_edit");
+      resourceIconRepostURL = xprops.getResourceURL("icon_repost");
+      resourceIconIPURL = xprops.getResourceURL("icon_ip");
+      resourceIconDelpostURL = xprops.getResourceURL("icon_delpost");
+      resourceIconMinipostURL = xprops.getResourceURL("icon_minipost");
+      resourceIconMinipostNewURL = xprops.getResourceURL("icon_minipost_new");
+      resourceIconSubscribeURL = xprops.getResourceURL("forum_subscribe");
+      resourceIconUnSubscribeURL = xprops.getResourceURL("forum_unsubscribe");
+      resourceIconUnlockURL = xprops.getResourceURL("unlock");
+      resourceIconLockURL = xprops.getResourceURL("lock");
+      resourceIconModerateURL = xprops.getResourceURL("moderate");
+      resourceIconForumsLogoURL = xprops.getResourceURL("forums_logo");
+      resourceIconDialogWarningURL = xprops.getResourceURL("icon_dialog_warning");
+      resourceIconDialogQuestionURL = xprops.getResourceURL("icon_dialog_question");
+      resourceIconDialogErrorURL = xprops.getResourceURL("icon_dialog_error");
+      resourceSpacerURL = xprops.getResourceURL("spacer");
+      resourceHeadStylesheetURL = xprops.getResourceURL("head_stylesheet");
+      resourceIconSpacerURL = xprops.getResourceURL("spacer");
+
+      //
+      FOLDER_ANNOUNCE =
+         new FolderType(resourceFolderAnnounceURL, resourceFolderAnnounceNewURL, "Topic_Announcement");
+      FOLDER_STICKY = new FolderType(resourceFolderStickyURL, resourceFolderStickyNewURL, "Topic_Sticky");
+      FOLDER_ANNOUNCE_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "Topic_Announcement");
+      FOLDER_STICKY_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "Topic_Sticky");
+      FOLDER_NORMAL_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "");
+      FOLDER_HOT = new FolderType(resourceFolderHotURL, resourceFolderHotNewURL, "");
+      FOLDER_NORMAL = new FolderType(resourceFolderURL, resourceForumNewURL, "");
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/BaseController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/BaseController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/BaseController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,123 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+
+//jsf 
+
+//jboss portal
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.search.ForumsSearchModule;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ */
+public abstract class BaseController implements Serializable,Constants
+{
+    private static ForumsModule singleton = null;    
+    
+    private static ForumsSearchModule searchModule = null;
+    
+    private String mainPageName = ""; //bean=level configuration supplied by the forums-config.xml
+    private Map links = null;
+    
+    /**
+     * 
+     * @return
+     */
+    public String getMainPageName()
+    {
+        return this.mainPageName;
+    }
+    
+    /**
+     * 
+     * @param mainPageName
+     */
+    public void setMainPageName(String mainPageName)
+    {
+        this.mainPageName = mainPageName;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public Map getLinks()
+    {
+        return this.links;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void setLinks(Map links)
+    {
+        this.links = links;
+    }
+    
+    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public BaseController()
+    {
+    }         
+        
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public boolean isAnonymous()
+    {
+        return JSFUtil.isAnonymous();
+    }    
+    //------utility method to grab the forums module------------------------------------------------------------------------------------------
+    public static ForumsModule getForumsModule() throws Exception
+    {
+        if(BaseController.singleton==null)
+        {
+            BaseController.singleton = (ForumsModule)new InitialContext().lookup("java:portal/ForumsModule");
+        }
+        return BaseController.singleton;
+    }
+    
+    public static ForumsSearchModule getSearchModule() throws Exception
+    {
+    	if (BaseController.searchModule == null)
+    	{
+    		BaseController.searchModule = (ForumsSearchModule) new InitialContext().lookup("java:portal/ForumsSearchModule");
+    	}
+    	
+    	return BaseController.searchModule;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Constants.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Constants.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Constants.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,160 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public interface Constants 
+{    
+    //---navigation state constants...these values map to actual xhtml facelet files. The mapping is specified in the forums-config.xml file--------------------------------------------------------------------------------------------------    
+    public static final String ERROR = "error"; 
+    public static final String START = "start";
+    public static final String CANCEL = "cancel";
+    public static final String SUCCESS = "success";
+    public static final String START_REPLY = "startReply";
+    public static final String START_NEW_TOPIC = "startNewTopic";
+    public static final String START_EDIT_POST = "startEditPost";
+    public static final String TOPIC_DELETED = "topicDeleted";
+    public static final String FEEDBACK = "feedback";
+    public static final String EDIT_CATEGORY = "editCategory";
+    public static final String EDIT_FORUM = "editForum";
+    public static final String ADD_CATEGORY = "addCategory";
+    public static final String ADD_FORUM = "addForum";
+    public static final String EDIT_WATCH = "editWatch";
+    public static final String DELETE_CATEGORY = "deleteCategory";
+    public static final String DELETE_FORUM = "deleteForum";
+    //---------parameter constants--------------------------------------------------------------------------------------------------
+    public static final String p_categoryId = "c";
+    public static final String p_forumId = "f";
+    public static final String p_topicId = "t";
+    public static final String p_postId = "p";
+    public static final String p_userId = "uid";
+    public static final String p_option = "o";
+    public static final String p_forum_to_id="forum_to_id";
+    public static final String p_poll_title = "POLL_TITLE";
+    public static final String p_poll_delete = "POLL_DELETE";
+    public static final String p_attachment = "ATTACHMENT";
+    public static final String p_vote = "vote";
+    public static final String p_results = "results";
+    public static final String p_page = "page";
+    public static final String p_watchId = "w";
+    public static final String p_viewId = "v";
+    public static final String p_notified_post_id = "notified_post_id";
+    public static final String p_notified_watch_type = "notified_watch_type";
+    //other constants------------------------------------------------------------------------------------------------------------------------------- 
+    public static final String QUOTE = "quote";
+    // Luca Stancapiano - FORUM_INSTANCE_ID is used most of all  to search forum instances
+    public static final String FORUM_INSTANCE_ID = "foruminstanceid";
+    public static final String NOTIFY_REPLY_KEY = "notifyreply";
+    public static final String ALLOW_HTML_KEY = "allowhtml";
+    public static final String POST_ORDER_KEY = "postorder";
+    public static final String DATE_FORMAT_KEY = "dateformat";
+    public static final String ALWAYS_SIG_KEY = "alwaysaddsignature";
+    public static final String SIG_KEY = "signature";
+    public static final String SUMMARY_MODE_KEY = "summarymode";
+    public static final String SUMMARY_LIMIT_KEY = "summarytopiclimit";
+    public static final String SUMMARY_DAYS_KEY = "summarytopicdays";
+    public static final String SUMMARY_REPLIES_KEY = "summarytopicreplies";
+    public static final String TOPICS_FORUM_KEY = "topicsperforum";
+    public static final String POSTS_TOPIC_KEY = "postspertopic";
+    public static final String TOPIC_LOCKED_ERR_KEY = "topiclockederr";
+    public static final String BUNDLE_NAME = "ResourceJSF";
+    //---------------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * When a notification message is sent, send a link to the message.
+     */
+    public static final int WATCH_MODE_LINKED = 0;
+
+    /**
+     * When a notification message is sent, send the message content.
+     */
+    public static final int WATCH_MODE_EMBEDED = 1;
+    
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int BLOCK_TOPICS_MODE_LATEST_POSTS = 0;
+
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int BLOCK_TOPICS_MODE_HOT_TOPICS = 1;
+
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int BLOCK_TOPICS_MODE_HOTTEST_TOPICS = 2;
+
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int BLOCK_TOPICS_MODE_MOST_VIEWED = 3;
+    
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int FORUM_LOCKED = 1;
+    
+    /**
+     * DOCUMENT_ME
+     */
+    public static final int FORUM_UNLOCKED = 0; 
+        
+    /**
+     * DOCUMENT_ME
+     */
+    int TOPIC_UNLOCKED = 0;
+
+    /**
+     * DOCUMENT_ME
+     */
+    int TOPIC_LOCKED = 1;
+    
+    
+    /**
+     * DOCUMENT_ME
+     */
+    int POST_NORMAL = 0;
+
+    /**
+     * DOCUMENT_ME
+     */
+    int POST_STICKY = 1;
+
+    /**
+     * DOCUMENT_ME
+     */
+    int POST_ANNOUNCE = 2;
+
+    /**
+     * DOCUMENT_ME
+     */
+    int POST_GLOBAL_ANNONCE = 3;
+    
+    /**
+     * DOCUMENT_ME
+     */
+    int TOPIC_MOVED = 2;
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ConstantsHelper.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ConstantsHelper.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ConstantsHelper.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ */
+public class ConstantsHelper implements Constants
+{
+    /**
+     * 
+     */
+    private static ConstantsHelper singleton = null;
+    
+    /**
+     * 
+     *
+     */
+    private ConstantsHelper()
+    {
+        
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    private static ConstantsHelper getInstance()
+    {
+        if(ConstantsHelper.singleton==null)
+        {
+            ConstantsHelper.singleton = new ConstantsHelper();
+        }
+        return ConstantsHelper.singleton;
+    }
+    
+    /**
+     * 
+     * @param constantName
+     * @return
+     * @throws Exception
+     */
+    public static String getConstantStr(String constantName) throws Exception
+    {
+        String constantValue = null;
+        
+        //use reflection to resolve the value of the specified constants
+        constantValue = (String)ConstantsHelper.getInstance().getClass().getField(constantName).get(ConstantsHelper.getInstance());
+        
+        return constantValue;
+    }
+    
+    /**
+     * 
+     * @param constantName
+     * @return
+     * @throws Exception
+     */
+    public static int getConstantInt(String constantName) throws Exception
+    {
+        int constantValue = -1;
+        
+        //use reflection to resolve the value of the specified constants
+        constantValue = ConstantsHelper.getInstance().getClass().getField(constantName).getInt(ConstantsHelper.getInstance());
+        
+        return constantValue;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/DownloadFilter.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/DownloadFilter.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/DownloadFilter.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.portlet.forums.model.Attachment;
+
+import javax.naming.InitialContext;
+import javax.transaction.UserTransaction;
+
+
+/**
+ * @author sohil shah
+ */
+public class DownloadFilter implements Filter 
+{
+    /**
+     * 
+     */
+    private final static String WRONG_REQ_RESP  = "Error accessing the requested resource.";
+    
+    private InitialContext ctx = null;
+    
+    
+    /**
+     * 
+     */
+    public void init(FilterConfig conf) 
+    {
+        try{this.ctx = new InitialContext();}catch(Exception e){e.printStackTrace();this.destroy();}
+    }
+
+    /**
+     * 
+     */
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException 
+    { 
+    	try
+    	{
+	        if ((request instanceof HttpServletRequest)
+	                && (response instanceof HttpServletResponse)) 
+	        {
+	            HttpServletResponse httpResponse = (HttpServletResponse) response;
+	            HttpServletRequest httpRequest = (HttpServletRequest)request;	            
+	            UserTransaction transaction = null;
+	            try
+	            {
+	                transaction = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
+	                transaction.begin();
+	                
+	                //get this attachment data
+	                int attachmentId = Integer.parseInt(request.getParameter("id"));
+	                Attachment attachment = BaseController.getForumsModule().findFindAttachmentById(new Integer(attachmentId));
+	 	       	 	       
+		 	       //set the attachment headers
+		           httpResponse.setContentLength((int)attachment.getFile().getSize());
+		           httpResponse.setContentType(attachment.getFile().getContentType());
+		           httpResponse.setHeader("Content-Disposition", "attachment; filename=" + attachment.getFile().getName());
+		 	       
+		 	       //now send the actual content down
+		 	       InputStream is = attachment.getFile().getContent().getBinaryStream();
+		 	       OutputStream os = httpResponse.getOutputStream();
+		 	       Util.transferBytes(is,os);
+		 	       os.flush();
+		 	       
+		 	       //cleanup
+		 	       if(is!=null)
+		 	       {
+		 	           is.close();
+		 	       }
+	            }
+	            finally
+	            {
+	                if(transaction!=null)
+	                {
+	                    transaction.rollback(); //since this is only a read-only operation..nothing to committ here
+	                }
+	            }
+	        } 
+	        else 
+	        {
+	            response.setContentType("text/html");
+	            response.getWriter().write(WRONG_REQ_RESP);
+	        }
+    	}    	
+    	catch(Exception e)
+    	{            
+    		e.printStackTrace();
+    	}
+    }
+
+    /**
+     * 
+     */
+    public void destroy() 
+    {
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/EmptyController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/EmptyController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/EmptyController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ */
+public class EmptyController extends BaseController 
+{
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public EmptyController()
+    {
+        
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,207 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.text.DecimalFormat;
+import java.util.Date;
+import java.util.Collection;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import javax.portlet.ActionRequest;
+// Luca Stancapiano - import
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portal.format.render.bbcodehtml.ToHTMLConfig;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ForumUtil 
+{    
+    /**
+     * 
+     * @param param
+     * @return
+     */
+    public static String getParameter(String param)
+    {
+        String parameter = null;
+        
+        parameter = JSFUtil.getRequestParameter(param);
+        
+        return parameter;
+    }
+    
+    /**
+     * 
+     * @param request
+     * @param param
+     * @return
+     */
+    public static String getParameter(ActionRequest request,String param)
+    {
+        String parameter = null;
+        
+        parameter = request.getParameter(param);
+        
+        return parameter;
+    }   
+    
+    /**
+     * 
+     *
+     */
+    public static String getPercentStr(double input)
+    {
+        String percent = "";
+                        
+        DecimalFormat decimalFormat = new DecimalFormat("##.##%");
+        percent = decimalFormat.format(input);
+        
+        
+        return percent;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static String getDateStr(Date date)
+    {
+        String dateStr = "";
+                        
+        if(date!=null)
+        {
+            dateStr = PortalUtil.getSDF().format(date);
+        }
+        
+        
+        return dateStr;
+    }
+    
+    public static String subString( String string , int length )
+    {
+        if (string==null || length<0)
+        {
+            return "";
+        }
+        
+        if (string.length()<=length)
+        {
+            return string;
+        }
+        
+        return string.substring(0,length-1);
+    }
+    
+    public static boolean isLongerThan( String string , int length )
+    {
+        if (string == null || length<0 )
+        {
+            return false;
+        }
+        
+        return string.length()>length;
+    }
+    
+    public static String nullIfEmptyString( String string )
+    {
+        if (string==null || string.trim().length()==0)
+        {
+            return null;
+        }
+        return string.trim();
+    }
+    
+    public static int collectionSize( Collection collection )
+    {
+        if (collection==null)
+        {
+            return -1;
+        }
+        return collection.size();
+    }
+    
+    public static Post getLastPost(ForumsModule fm, Forum forum)
+    {
+        try
+        {
+            return fm.findLastPost(forum);    
+        } catch (ModuleException e)
+        {
+            return null;
+        }
+    }
+    
+    /* Luca Stancapiano start - This method is taken from getPreference
+       method of PortalUtil. The only difference is that this method has
+       to be used also for anonymous users because a preference can to be imported also
+       for a portlet when you are not logged. For example foruminstanceid custom preference
+       must to be seen by an anonymous user to get the right forum instance, otherwise
+       an anonymous user has permission to see an only forum instance
+    */
+    /**
+     * 
+     * @param preferenceKey
+     * @return
+     */
+    public static String getPreference(String preferenceKey)
+    {
+        String preference = null;
+
+        Object o = FacesContext.getCurrentInstance().getExternalContext()
+                .getRequest();
+        if (o instanceof PortletRequest)
+        {
+            PortletRequest request = (PortletRequest) o;
+            PortletPreferences pp = request.getPreferences();
+            preference = pp.getValue(preferenceKey, "");
+        }
+
+        return preference;
+    }
+    // Luca Stancapiano end
+    
+    public static boolean isFeedsConfigured()
+    {
+        ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
+        String urlParam = ctx.getInitParameter("org.jboss.forums.feeds.URL");
+        String urlType = ctx.getInitParameter("org.jboss.forums.feeds.URL_TYPE");
+        if (urlParam==null || urlParam.trim().length()==0
+                || urlType==null || urlType.trim().length()==0)
+        {
+            return false;
+        }
+        return true;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,699 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.portlet.PortletFileUpload;
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.SortedMap;
+
+// JSF
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ExternalContext;
+
+//myfaces
+import org.apache.myfaces.portlet.MyFacesGenericPortlet;
+import org.apache.myfaces.config.FacesConfigurator;
+import org.apache.myfaces.context.ReleaseableExternalContext;
+import org.apache.myfaces.webapp.webxml.WebXml;
+
+//portlet api
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletMode;
+
+//jboss portal
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.forums.helper.TempFileBinding;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * 
+ */
+public class ForumsJSFPortlet extends MyFacesGenericPortlet 
+{
+    
+    private static Logger log = Logger.getLogger(ForumsJSFPortlet.class);
+
+    /**
+     * PortletRequest parameter for JBoss Forums Portlet for replacing
+     * standard parameter of MyFacesGenericPortlet
+     */
+    public static final String VIEW = "v";
+    
+    /**
+     * This Map contains sorted pairs of view name and view id.
+     */
+    public static final Map VIEW_NAME_TO_ID;
+    
+    /**
+     * This Map contains sorted pairs of view id and view name.
+     */
+    public static final Map VIEW_ID_TO_NAME;
+    
+    
+    /**
+     * Static class initializer will fill VIEW_ID_TO_NAME and VIEW_ID_TO_NAME maps.
+     */
+    static {
+        
+        SortedMap TEMP_VIEW_ID_TO_NAME = new TreeMap();
+        SortedMap TEMP_VIEW_NAME_TO_ID = new TreeMap();
+        
+        // Root views
+        TEMP_VIEW_ID_TO_NAME.put("i","/views/index.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/index.jsf","i");
+        
+        TEMP_VIEW_ID_TO_NAME.put("j","/views/jumpbox.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/jumpbox.jsf","j");
+        
+        TEMP_VIEW_ID_TO_NAME.put("m","/views/portal_index.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/portal_index.jsf","m");
+        
+        // admin views
+        TEMP_VIEW_ID_TO_NAME.put("a","/views/admin/index.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/admin/index.jsf","a");
+        
+        TEMP_VIEW_ID_TO_NAME.put("h","/views/admin/editCategory.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/admin/editCategory.jsf","h");
+        
+        TEMP_VIEW_ID_TO_NAME.put("k","/views/admin/editForum.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/admin/editForum.jsf","k");
+        
+        TEMP_VIEW_ID_TO_NAME.put("l","/views/admin/deleteCategory.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/admin/deleteCategory.jsf","l");
+        
+        TEMP_VIEW_ID_TO_NAME.put("d","/views/admin/deleteForum.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/admin/deleteForum.jsf","d");
+        
+        // category views
+        TEMP_VIEW_ID_TO_NAME.put("c","/views/category/viewcategory_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/category/viewcategory_body.jsf","c");
+         
+        // common views
+        TEMP_VIEW_ID_TO_NAME.put("b","/views/common/common.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/common/common.jsf","b");
+        
+        TEMP_VIEW_ID_TO_NAME.put("n","/views/common/common_noMenu.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/common/common_noMenu.jsf","n");
+        
+        // errors views
+        TEMP_VIEW_ID_TO_NAME.put("e","/views/errors/error_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/errors/error_body.jsf","e");        
+        
+        // forums views
+        TEMP_VIEW_ID_TO_NAME.put("f","/views/forums/viewforum_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/forums/viewforum_body.jsf","f");
+
+        // moderator views
+        TEMP_VIEW_ID_TO_NAME.put("m","/views/moderator/modcp_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/moderator/modcp_body.jsf","m");
+
+        TEMP_VIEW_ID_TO_NAME.put("v","/views/moderator/delete_topic.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/moderator/delete_topic.jsf","v");
+        
+        TEMP_VIEW_ID_TO_NAME.put("vs","/views/moderator/delete_topics.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/moderator/delete_topics.jsf","vs");
+        
+        TEMP_VIEW_ID_TO_NAME.put("q","/views/moderator/modcp_move.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/moderator/modcp_move.jsf","q");
+        
+        TEMP_VIEW_ID_TO_NAME.put("o","/views/moderator/modcp_split.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/moderator/modcp_split.jsf","o");
+        
+        // preferences views
+        TEMP_VIEW_ID_TO_NAME.put("r","/views/pref/index.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/pref/index.jsf","r");
+        
+        // profile views
+        TEMP_VIEW_ID_TO_NAME.put("u","/views/profile/viewprofile_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/profile/viewprofile_body.jsf","u");
+        
+        TEMP_VIEW_ID_TO_NAME.put("ue","/views/profile/usermessage_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/profile/usermessage_body.jsf","ue");
+        
+        // summary views
+        TEMP_VIEW_ID_TO_NAME.put("s","/views/summary/viewsummary_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/summary/viewsummary_body.jsf","s");
+        
+        // topic views
+        TEMP_VIEW_ID_TO_NAME.put("t","/views/topics/viewtopic_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/viewtopic_body.jsf","t");
+        
+        TEMP_VIEW_ID_TO_NAME.put("p","/views/topics/posting_new_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_new_body.jsf","p");
+        
+        TEMP_VIEW_ID_TO_NAME.put("g","/views/topics/posting_edit_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_edit_body.jsf","g");
+        
+        TEMP_VIEW_ID_TO_NAME.put("z","/views/topics/posting_reply_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_reply_body.jsf","z");
+        
+        TEMP_VIEW_ID_TO_NAME.put("y","/views/topics/delete_poll.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/delete_poll.jsf","y");
+        
+        TEMP_VIEW_ID_TO_NAME.put("x","/views/topics/delete_post.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/delete_post.jsf","x");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pa","/views/topics/attachmentsview.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/attachmentsview.jsf","pa");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pe","/views/topics/posting_edit_preview.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_edit_preview.jsf","pe");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pi","/views/topics/posting_new_preview.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_new_preview.jsf","pi");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pr","/views/topics/posting_reply_preview.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/posting_reply_preview.jsf","pr");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pc","/views/topics/viewtopic_poll_ballot.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/viewtopic_poll_ballot.jsf","pc");
+        
+        TEMP_VIEW_ID_TO_NAME.put("pk","/views/topics/viewtopic_poll_result.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/topics/viewtopic_poll_result.jsf","pk");
+        
+        // watches views
+        TEMP_VIEW_ID_TO_NAME.put("w","/views/watches/forumWatch.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/watches/forumWatch.jsf","w");
+        TEMP_VIEW_ID_TO_NAME.put("wt","/views/watches/topicWatch.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/watches/topicWatch.jsf","wt");
+        
+        // MyForums views
+        TEMP_VIEW_ID_TO_NAME.put("my","/views/myforums/myforums_main.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/myforums/myforums_main.jsf","my");
+        
+        TEMP_VIEW_ID_TO_NAME.put("ma","/views/myforums/myforums_viewall.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/myforums/myforums_viewall.jsf","ma");
+        
+        TEMP_VIEW_ID_TO_NAME.put("me","/views/myforums/myforums_editforums.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/myforums/myforums_editforums.jsf","me");
+        
+        // Search views
+        TEMP_VIEW_ID_TO_NAME.put("se","/views/search/viewsearch_body.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/search/viewsearch_body.jsf","se");
+        
+        TEMP_VIEW_ID_TO_NAME.put("sr","/views/search/viewsearch_results.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/search/viewsearch_results.jsf","sr");
+        
+        //TEMP_VIEW_ID_TO_NAME.put("sr","/views/search/myforums_viewall.jsf");
+        //TEMP_VIEW_NAME_TO_ID.put("/views/search/myforums_viewall.jsf","sa");
+        
+        VIEW_ID_TO_NAME = Collections.unmodifiableSortedMap(TEMP_VIEW_ID_TO_NAME);
+        VIEW_NAME_TO_ID = Collections.unmodifiableSortedMap(TEMP_VIEW_NAME_TO_ID);
+
+    }
+
+    protected void initMyFaces()
+    {
+        try
+        {
+            Boolean b = (Boolean)portletContext.getAttribute(FACES_INIT_DONE);
+
+            if (b == null || b.booleanValue() == false)
+            {
+                log.info("Initializing MyFaces");
+                //Load the configuration
+                ExternalContext externalContext = new ForumsPortletExternalContextImpl(portletContext, null, null);
+
+                //And configure everything
+                new FacesConfigurator(externalContext).configure();
+
+                // parse web.xml - not sure if this is needed for portlet
+                WebXml.init(externalContext);
+
+                portletContext.setAttribute(FACES_INIT_DONE, Boolean.TRUE);
+            }
+            else
+            {
+                log.info("MyFaces already initialized");
+            }
+        }
+        catch (Exception ex)
+        {
+            log.error("Error initializing MyFacesGenericPortlet", ex);
+            JSFUtil.handleException(ex);
+        }
+
+        log.info("PortletContext '" + portletContext.getRealPath("/") + "' initialized.");
+    }
+    
+    protected ReleaseableExternalContext makeExternalContext(PortletRequest request, PortletResponse response)
+    {
+        return (ReleaseableExternalContext)new ForumsPortletExternalContextImpl(portletContext, request, response);
+    }
+
+    /**
+     * Called by the portlet container to allow the portlet to process an action request.
+     */
+    public void processAction(ActionRequest request, ActionResponse response) throws PortletException,IOException {
+    
+        /* DEBUG CODE
+        Map map = request.getParameterMap();
+        Iterator it = map.keySet().iterator();
+        while (it.hasNext()) {
+            String key = (String)it.next();
+            System.out.println("KEY: "+key+" VALUE: "+((String[])map.get(key))[0]);
+        }
+        */
+        
+        try
+        {
+            setPortletRequestFlag(request);
+            
+            if (sessionTimedOut(request)) {
+                return;
+            }
+            
+            setPortletRequestFlag(request);
+            
+            this.setupRenderParameters(request,response);   
+        
+            //parse and setup any attachments if they are sent in
+            if ((request.getContentType() != null) && request.getContentType().startsWith("multipart/form-data"))
+            {
+                this.processAttachments(request,response);
+            }
+            
+            FacesContext fc = facesContext(request, response);
+            
+            Map map = request.getParameterMap();
+            Map newParams = new HashMap();
+            newParams.putAll(map);
+
+            if (map.get(VIEW)!=null) {
+                String viewName = ((String[])newParams.get(VIEW))[0];
+                newParams.put(MyFacesGenericPortlet.VIEW_ID,new String[]{getNameForId(viewName)});
+                if (fc.getViewRoot() != null) {
+                    fc.getViewRoot().setViewId(getNameForId(viewName));
+                } else {
+                    fc.setViewRoot(new UIViewRoot());
+                    fc.getViewRoot().setViewId(getNameForId(viewName));
+                }
+            }
+
+            Class requestClass = PortletRequestImpl.class;
+            Field field = requestClass.getDeclaredField("parameters");
+            field.setAccessible(true);
+            field.set(request, new PortletParameters(newParams));
+            field.setAccessible(false);
+            
+            
+            lifecycle.execute(fc);
+            if (fc.getResponseComplete()==false)
+            {
+                if (request.getParameterValues(VIEW)!=null) {
+                
+                    String viewId = request.getParameterValues(VIEW)[0];
+                    response.setRenderParameter(VIEW, request.getParameterValues(VIEW) );
+                    fc.getViewRoot().setViewId(getNameForId(viewId));
+                    
+                } else if (fc.getViewRoot().getViewId()!=null) {
+                
+                    String viewName = fc.getViewRoot().getViewId();
+                    if (viewName.endsWith("xhtml")) {
+                        viewName = viewName.replaceAll("xhtml","jsf");
+                    }
+                    response.setRenderParameter(VIEW, new String[]{getIdForName(viewName)} );
+                } 
+            }
+            request.getPortletSession().setAttribute(CURRENT_FACES_CONTEXT, fc);
+        }
+        catch(Throwable t)
+        {
+            throw new PortletException(t);            
+        }
+    }
+    
+    /**
+     * Called by the portlet container to allow the portlet to render its view
+     */
+    public void doView(RenderRequest request,RenderResponse response) throws PortletException,IOException
+    {
+        FacesContext fc = facesContext(request, response);
+        if (request.getPortletSession().getAttribute(CURRENT_FACES_CONTEXT) == null) { 
+            request.getPortletSession().setAttribute(CURRENT_FACES_CONTEXT,fc);
+        }
+        
+        try
+        {
+            FacesContext facesContext = facesContext(request,response);
+            
+            //make sure this is not a mode change from Edit
+            boolean modeChanged = ((Boolean)request.getAttribute("isPortletModeChanged")).booleanValue();
+            if(modeChanged)
+            {
+                setPortletRequestFlag(request);
+                nonFacesRequest(request,response,"/views/index.jsf");
+                return;
+            }
+            
+            Map map = request.getParameterMap();
+            Map newParams = new HashMap();  
+            newParams.putAll(map);
+            
+            if (facesContext.getViewRoot()==null) {
+                facesContext.setViewRoot(new UIViewRoot());
+            }
+            
+            PortalUtil.executeNotifications();
+            
+            // Removing notification parameters from RenderRequest
+            newParams.remove(Constants.p_notified_post_id);
+            newParams.remove(Constants.p_notified_watch_type);
+            
+            if (map.get(VIEW)!=null) {
+                String viewName = ((String[])newParams.get(VIEW))[0];
+                newParams.put(MyFacesGenericPortlet.VIEW_ID,new String[]{getNameForId(viewName)});
+                facesContext.getViewRoot().setViewId(getNameForId(viewName));
+            } else if (map.get(MyFacesGenericPortlet.VIEW_ID)!=null ) {
+                String viewId = ((String[])newParams.get(MyFacesGenericPortlet.VIEW_ID))[0];
+                newParams.put(MyFacesGenericPortlet.VIEW_ID,new String[]{viewId});
+                facesContext.getViewRoot().setViewId(getNameForId(viewId));
+            } else {
+                setPortletRequestFlag(request);
+                nonFacesRequest(request,response,"/views/index.jsf");
+                return;
+            }
+
+            Class requestClass = PortletRequestImpl.class;
+            Field field = requestClass.getDeclaredField("parameters");
+            field.setAccessible(true);
+            field.set(request, new PortletParameters(newParams));
+            field.setAccessible(false);
+            
+            if (fc.getViewRoot()==null) {
+                if (fc.getViewRoot()==null && newParams.get(VIEW)!=null) {
+                    fc.setViewRoot(new UIViewRoot());
+                    String viewName = ((String[])newParams.get(VIEW))[0];
+                    fc.getViewRoot().setViewId(getNameForId(viewName));
+                }
+                setPortletRequestFlag(request);                
+                
+                lifecycle.execute(fc);
+            }
+            
+            super.doView(request,response);
+        }
+        catch(Throwable t)
+        {
+            throw new PortletException(t);            
+        }
+    }
+    
+    //override the render() method from GenericPortlet to detect a 
+    //  mode change
+    /**
+     * 
+     */
+    public void render(RenderRequest request, RenderResponse response) 
+    throws PortletException, IOException 
+    {
+	    PortletSession session = request.getPortletSession();
+	    PortletMode mode = (PortletMode)session.getAttribute("CurrentPortletMode");
+	
+	    if (mode == null) 
+	    {
+	       mode = request.getPortletMode();       
+	    }
+	
+	    if (!mode.equals(request.getPortletMode())) 
+	    {
+	       request.setAttribute("isPortletModeChanged", Boolean.TRUE);
+	    } 
+	    else 
+	    {
+	       request.setAttribute("isPortletModeChanged", Boolean.FALSE);
+	    }
+	
+	    session.setAttribute("CurrentPortletMode", request.getPortletMode());
+	    super.render(request, response);
+    }
+    //integrating handling Edit Mode for handling preferences-----------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public void doEdit(RenderRequest request, RenderResponse response)
+    throws PortletException, IOException 
+    {        
+        setPortletRequestFlag(request);
+        nonFacesRequest(request,response,"/views/pref/index.jsf");
+    }     
+    //----------------------------------------------------------------------------------------------------------------
+    
+     /**
+      * This method translates standard view file path into short view id parameter.
+      */
+     public static String getIdForName(String name) {
+         if (name==null) {
+             return null;
+         }
+         return (String)VIEW_NAME_TO_ID.get(name);
+     }
+     
+     /**
+      * This method translates short id view parameter into standard view file path.
+      */
+     public static String getNameForId(String id) {
+         if (id==null) {
+             return null;
+         }
+         return (String)VIEW_ID_TO_NAME.get(id);
+     }
+    
+    /**
+     * Not sure why this needs to be done...
+     * This method tends to propagate the request parameters over to the JSF layer
+     * this is a workaround for a bug in either portal or MyFacesGenericPortlet...
+     * @author sshah
+     *
+     */
+    private void setupRenderParameters(ActionRequest request,ActionResponse response) throws PortletException,IOException
+    {
+        String categoryId = ForumUtil.getParameter(request,Constants.p_categoryId);
+        String forumId = ForumUtil.getParameter(request,Constants.p_forumId);
+        String pollTitle = ForumUtil.getParameter(request,Constants.p_poll_title);
+        String option = ForumUtil.getParameter(request,Constants.p_option);
+        String pollDelete = ForumUtil.getParameter(request,Constants.p_poll_delete);
+        String attachment = ForumUtil.getParameter(request,Constants.p_attachment);
+        String topicId = ForumUtil.getParameter(request,Constants.p_topicId);
+        String postId = ForumUtil.getParameter(request,Constants.p_postId);
+        String userId = ForumUtil.getParameter(request,Constants.p_userId); 
+        String vote = ForumUtil.getParameter(request,Constants.p_vote);
+        String results = ForumUtil.getParameter(request,Constants.p_results);
+        String page = ForumUtil.getParameter(request,Constants.p_page);
+        String watchId = ForumUtil.getParameter(request,Constants.p_watchId);
+        String viewId = ForumUtil.getParameter(request,Constants.p_viewId);
+        String adminEditCatMode = ForumUtil.getParameter(request,Constants.EDIT_CATEGORY);
+        String adminEditForMode = ForumUtil.getParameter(request,Constants.EDIT_FORUM);
+        String adminAddCatMode = ForumUtil.getParameter(request,Constants.ADD_CATEGORY);
+        String adminAddForMode = ForumUtil.getParameter(request,Constants.ADD_FORUM);
+        String editWatch = ForumUtil.getParameter(request,Constants.EDIT_WATCH);
+        if(categoryId!=null && categoryId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_categoryId,categoryId);
+        }
+        if(forumId!=null && forumId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_forumId,forumId);
+        }
+        if(pollTitle!=null && pollTitle.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_poll_title,pollTitle);
+        }
+        if(option!=null && option.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_option,option);
+        }
+        if(pollDelete!=null && pollDelete.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_poll_delete,pollDelete);
+        }
+        if(attachment!=null && attachment.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_attachment,attachment);
+        }
+        if(topicId!=null && topicId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_topicId,topicId);
+        }
+        if(userId!=null && userId.trim().length()>0) 
+        {
+            response.setRenderParameter(Constants.p_userId,userId);
+        }
+        if(postId!=null && postId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_postId,postId);
+        }
+        if(vote!=null && vote.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_vote,vote);
+        }
+        if(results!=null && results.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_results,results);
+        }
+        if(page!=null && page.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_page,page);
+        }
+        if(watchId!=null && watchId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_watchId,watchId);
+        }
+        if(viewId!=null && viewId.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.p_viewId,viewId);
+        }
+        if(adminEditCatMode!=null && adminEditCatMode.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.EDIT_CATEGORY,adminEditCatMode);
+        }
+        if(adminEditForMode!=null && adminEditForMode.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.EDIT_FORUM,adminEditForMode);
+        }
+        if(adminAddCatMode!=null && adminAddCatMode.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.ADD_CATEGORY,adminAddCatMode);
+        }
+        if(adminAddForMode!=null && adminAddForMode.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.ADD_FORUM,adminAddForMode);
+        }
+        if(editWatch!=null && editWatch.trim().length()>0)
+        {
+            response.setRenderParameter(Constants.EDIT_WATCH,editWatch);
+        }
+    }
+    
+    /**
+     * 
+     *
+     */
+    private void processAttachments(ActionRequest req,ActionResponse response) throws Exception
+    {
+        //We need to have new map to which we collect request parameters from multipart - we'll inject it little later
+        Map newParams = new HashMap();
+        newParams.putAll(req.getParameterMap());
+    
+        DiskFileItemFactory factory = new DiskFileItemFactory();
+        PortletFileUpload upload = new PortletFileUpload(factory);
+        
+        //Merge with upload fields
+        for (Iterator i = upload.parseRequest(req).iterator(); i.hasNext();)
+        {
+           FileItem item = (FileItem)i.next();  
+           if (item.isFormField())
+           {
+              //if it's form field just add it to request params map
+              //TODO:Be aware that this adds single value as we won't have multiply values in new topic form for now...
+              newParams.put(item.getFieldName(), new String[]{item.getString(req.getCharacterEncoding())});
+              
+              //setup the render parameters properly to propagate to the JSF layer
+              String parameter = item.getFieldName();
+              String value = item.getString(req.getCharacterEncoding());
+              if(value!=null && value.trim().length()>0)
+              {
+	              if(parameter.equals(Constants.p_forumId))
+	              {
+	                  response.setRenderParameter(Constants.p_forumId,value);
+	              }
+	              else if(parameter.equals(Constants.p_topicId))
+	              {
+	                  response.setRenderParameter(Constants.p_topicId,value);
+	              }
+	              else if(parameter.equals(Constants.p_page))
+	              {
+	                  response.setRenderParameter(Constants.p_page,value);
+	              }
+	              else if(parameter.equals(Constants.p_postId))
+	              {
+	                  response.setRenderParameter(Constants.p_postId,value);
+	              }
+              }
+              
+           }
+           else
+           {
+               //create the proper attachment file for the managed bean and put it as a ThreadLocal value
+               //the managed bean should pick this up from the thread
+               TempFileBinding file = new TempFileBinding(
+	                    item.getContentType(),
+	                    item.get(),
+	                    item.getName(),
+	            String.valueOf(System.currentTimeMillis()) + "_" + item.getSize() //unique fileId for this collection of files
+	            );
+               
+               //place it as a ThreadLocal variable
+               PortalUtil.setUploadedAttachment(file);
+           }
+        } 
+        //we need to hack the request class and inject newly created Parameters map using reflection as this are
+        //protected fields
+        try
+        {
+           Class requestClass = PortletRequestImpl.class;
+           Field field = requestClass.getDeclaredField("parameters");
+           field.setAccessible(true);
+           field.set(req, new PortletParameters(newParams));
+
+
+           // TODO: This workaround is not best possible because we are using here JBossActionRequest.
+           //the second dummy field need to be set to null to force lazy initialization
+           requestClass = JBossActionRequest.class;
+           field = requestClass.getDeclaredField("blah");
+           field.setAccessible(true);
+           field.set(req, null);
+        }
+        catch (NoSuchFieldException e)
+        {
+           e.printStackTrace();
+        }
+        catch (IllegalAccessException e)
+        {
+           e.printStackTrace();
+        }
+    }        
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsPortletExternalContextImpl.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsPortletExternalContextImpl.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsPortletExternalContextImpl.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+
+import org.apache.myfaces.context.portlet.PortletExternalContextImpl;
+
+/**
+ * The class changes encodeNamespace method to reduce the size of generated pages.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class ForumsPortletExternalContextImpl extends
+        PortletExternalContextImpl
+{
+
+    public ForumsPortletExternalContextImpl(PortletContext portletContext, PortletRequest portletRequest, PortletResponse portletResponse)
+    {
+        super(portletContext, portletRequest, portletResponse);
+        // TODO Auto-generated constructor stub
+    }
+
+    public String encodeNamespace(String name)
+    {
+        String orginalName = super.encodeNamespace(name);
+        String initParam = this.getInitParameter("org.jboss.forums.UNIQUE_ID");
+        if (initParam==null)
+        {
+            return orginalName;
+        }
+        return initParam+name;
+    }    
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/JSFUtil.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,314 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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;
+
+//core java classes
+import java.util.Locale;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
+
+//logging related
+import org.apache.log4j.Logger;
+
+//servlet import
+import javax.servlet.http.HttpServletRequest;
+
+//portal import
+import javax.portlet.PortletRequest;
+
+//jsf imports
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.*;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ * 
+ */
+public class JSFUtil 
+{
+    private static Logger log = Logger.getLogger(JSFUtil.class);
+        
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public static String getRequestParameter(String name)
+    {
+        String parameter = null;
+        
+        Map requestParameterMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+        if(requestParameterMap!=null)
+        {
+            parameter = (String)requestParameterMap.get(name);
+        }
+        
+        return parameter;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static boolean isRunningInPortal()
+    {
+        boolean isRunningInPortal = false;
+        
+        Object request = FacesContext.getCurrentInstance().getExternalContext().getRequest();
+        if(request instanceof PortletRequest)
+        {
+            isRunningInPortal = true;
+        }
+        
+        return isRunningInPortal;
+    }
+        
+    /**
+     * 
+     * 
+     */
+    public static String getContextPath()
+    {
+        String contextPath = "";
+        
+        contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
+        
+        return contextPath;
+    } 
+    
+    /**
+     * 
+     * @return
+     */
+    public static boolean isAnonymous()
+    {
+        boolean anonymous = true;
+        
+        String remoteUser = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
+        if(remoteUser!=null && remoteUser.trim().length()>0)
+        {
+            anonymous = false;
+        }
+        
+        return anonymous;
+    }
+    
+    /**
+     * 
+     * @author sshah
+     *
+     * 
+     */
+    public static String getComponentValue(String componentId)
+    {
+        String value = null;
+        
+        UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
+        UIComponent component = root.findComponent(componentId);
+        
+        if(component!=null)
+        {
+            Object o = component.getValueBinding("value").getValue(FacesContext.getCurrentInstance());
+            value = (String)o;
+        }
+                
+        
+        return value;
+    }
+    
+    /**
+     * 
+     * @author sshah
+     *
+     * 
+     */
+    public static void removeComponent(String componentId)
+    {                
+        UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
+        UIComponent component = root.findComponent(componentId);
+        
+        if(component!=null)
+        {
+            UIComponent parent = component.getParent();
+            parent.getChildren().remove(component);            
+        }                                
+    }
+    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public static String handleException(Exception e)
+    {
+        String genericNavState = Constants.ERROR;
+        String msg = e.toString();
+        FacesMessage message = new FacesMessage(
+          FacesMessage.SEVERITY_ERROR,//severity
+          msg,//summary
+          msg//detail
+        );  
+        FacesContext.getCurrentInstance().addMessage(Constants.ERROR,message);
+        
+        //spit the stack trace
+        log.error(JSFUtil.class.getName(),e);
+        
+        return genericNavState;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public static String getErrorMsg()
+    {
+        String errorMsg = null;
+        
+        Iterator msgs = FacesContext.getCurrentInstance().getMessages(Constants.ERROR);
+        if(msgs!=null)
+        {
+            if(msgs.hasNext())
+            {
+                FacesMessage message = (FacesMessage)msgs.next();
+                errorMsg = message.getDetail();
+            }
+        }
+        
+        return errorMsg;
+    } 
+    
+    /**
+     * 
+     *
+     */
+    public static boolean isErrorOccurred()
+    {
+        boolean errorOccurred = false;
+        
+        Iterator msgs = FacesContext.getCurrentInstance().getMessages(Constants.ERROR);
+        if(msgs!=null && msgs.hasNext())
+        {
+            errorOccurred = true;
+        }
+        
+        return errorOccurred;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static void setMessage(String id,String msg)
+    {
+        FacesMessage message = new FacesMessage(
+                FacesMessage.SEVERITY_INFO,//severity
+                msg,//summary
+                msg//detail
+              );
+        FacesContext.getCurrentInstance().addMessage(id,message);
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static void setErrorMessage(String id,String msg)
+    {
+        FacesMessage message = new FacesMessage(
+                FacesMessage.SEVERITY_ERROR,//severity
+                msg,//summary
+                msg//detail
+              );
+        FacesContext.getCurrentInstance().addMessage(id,message);
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static String getMessage(String id)
+    {
+        String msg = null;
+        
+        Iterator msgs = FacesContext.getCurrentInstance().getMessages(id);
+        if(msgs!=null)
+        {
+            if(msgs.hasNext())
+            {
+                FacesMessage message = (FacesMessage)msgs.next();
+                msg = message.getDetail();
+            }
+        }
+        
+        return msg;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static String getBundleMessage(String bundleName,String messageKey)
+    {
+        String bundleMessage = null;
+        
+        //Getting ResourceBundle with current Locale
+        FacesContext ctx = FacesContext.getCurrentInstance();
+        UIViewRoot uiRoot = ctx.getViewRoot();
+        Locale locale = uiRoot.getLocale();
+        ClassLoader ldr = Thread.currentThread().getContextClassLoader();
+        ResourceBundle bundle = ResourceBundle.getBundle(bundleName,locale,ldr);
+        
+        bundleMessage = bundle.getString(messageKey);
+        
+        return bundleMessage;
+    }
+    
+    /**
+     * 
+     */
+    public static Locale getSelectedLocale()
+    {
+        return FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
+    }
+    
+    /**
+     * 
+     */
+    public static Locale getDefaultLocale()
+    {
+        return FacesContext.getCurrentInstance().getApplication().getDefaultLocale();
+    }
+    
+    /**
+     * 
+     */
+    public static Iterator getSupportedLocales()
+    {
+        return FacesContext.getCurrentInstance().getApplication().getSupportedLocales();
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,734 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.core.modules.ModuleConstants;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.feeds.FeedConstants;
+import org.jboss.portlet.forums.helper.TempFileBinding;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.impl.PollImpl;
+import org.jboss.portlet.forums.impl.PollOptionImpl;
+import org.jboss.portlet.forums.impl.PosterImpl;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Watch;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * 
+ */
+public class PortalUtil
+{
+
+    private static Logger log = Logger.getLogger(PortalUtil.class);
+    
+    private static SimpleDateFormat sdfForLastLoginDate;
+
+    private static User userNA = new User() 
+    {
+        {
+           this.id = new Long(-1);
+           this.userName = "N/A";
+        }                 
+    
+        protected Object id;
+   
+        protected String userName; 
+
+        public Object getId() {
+           return id;
+        }
+
+        public String getUserName() {
+           return userName;
+        }
+
+        public void updatePassword(String password) {
+        }
+
+        public boolean validatePassword(String password) {
+            return false;
+        }
+    }; 
+    
+    private final static UserProfileModule upm;
+
+    static
+    {
+        UserProfileModule temporary = null;
+        try
+        {
+            temporary = (UserProfileModule) new InitialContext()
+                    .lookup("java:portal/UserProfileModule");
+        } catch (NamingException e)
+        {
+            JSFUtil.handleException(e);
+        } finally
+        {
+            upm = temporary;
+        }
+        
+        sdfForLastLoginDate = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",Locale.ENGLISH);
+    }
+
+    /**
+     * 
+     * 
+     */
+    public static boolean isRunningInPortal()
+    {
+        boolean isRunningInPortal = false;
+        Object o = FacesContext.getCurrentInstance().getExternalContext()
+                .getRequest();
+        if (o instanceof PortletRequest)
+        {
+            isRunningInPortal = true;
+        }
+        return isRunningInPortal;
+    }
+
+    /**
+     * 
+     * @author sshah
+     * 
+     */
+    public static String outputLink(String outputLink, boolean isAction)
+    {
+        try
+        {
+            String url = null;
+
+            Object response = FacesContext.getCurrentInstance()
+                    .getExternalContext().getResponse();
+
+            if (!outputLink.startsWith("/"))
+            {
+                outputLink = "/" + outputLink;
+            }
+
+            if (response instanceof RenderResponse)
+            {
+                RenderResponse renderResponse = (RenderResponse) response;
+
+                PortletURL portletURL = null;
+                
+                if (isAction)
+                {
+                    portletURL = renderResponse.createActionURL();
+                    portletURL.setSecure(false);
+                } else
+                {
+                    portletURL = renderResponse.createRenderURL();
+                }
+                
+                String jsfUrl = portletURL.toString();
+                jsfUrl += "&"
+                        + ForumsJSFPortlet.VIEW
+                        + "="
+                        + URLEncoder.encode(ForumsJSFPortlet
+                                .getIdForName(outputLink), "UTF-8");
+
+                url = jsfUrl;
+            } else
+            {
+                String contextPath = JSFUtil.getContextPath();
+                url = contextPath + outputLink;
+            }
+
+            return url;
+        } catch (Exception e)
+        {
+            log.error(PortalUtil.class.getName(), e);
+            return null;
+        }
+    }
+    
+    /**
+     * 
+     */
+    public static String postPermlink(String postId)
+    {
+
+        Object response = FacesContext.getCurrentInstance()
+                .getExternalContext().getResponse();
+
+        String url = "";
+
+        if (response instanceof RenderResponse)
+        {
+            RenderResponse renderResponse = (RenderResponse) response;
+            PortletURL portletURL = renderResponse.createActionURL();
+            
+            try
+            {
+                portletURL.setSecure(false);
+            } catch(javax.portlet.PortletSecurityException e)
+            {
+                log.error(PortalUtil.class.getName(), e);
+            }
+
+            url = portletURL.toString();
+            if (url.indexOf("/auth")!=-1)
+            {
+                url = url.replaceFirst("/auth", "");
+            }
+            url += "&" + Constants.p_viewId + "=t&" + Constants.p_postId + "="
+                    + postId + "#" + postId;
+        } else
+        {
+            url = JSFUtil.getContextPath();
+            ApplicationFactory factory = (ApplicationFactory) FactoryFinder
+                    .getFactory(FactoryFinder.APPLICATION_FACTORY);
+            Application application = factory.getApplication();
+            EmptyController binding = (EmptyController) application
+                    .getVariableResolver().resolveVariable(
+                            FacesContext.getCurrentInstance(), "shared");
+            url += binding.getLinks().get("topic").toString();
+            url += "?" + Constants.p_postId + "=" + postId + "#" + postId;
+        }
+
+        return url;
+    }
+    
+    /**
+     * Creates feed link.
+     * 
+     * @param type
+     *            RSS/Atom. See FeedConstants
+     * @param what
+     *            Kind of the link. See available kinds in FeedConstants
+     * @param id
+     *            Id - for kind FeedCostants.GLOBAL is ignored
+     * @return String with proper address
+     */
+    public static String createFeedLink(String type, String what, Integer id)
+    {
+        
+        ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
+        String url = ctx.getRequestContextPath()
+                + "/feeds/"
+                + type
+                + "/"
+                + what
+                + (FeedConstants.GLOBAL.equals(what) ? "" : "/"
+                + id.toString());
+        
+        String urlParam = ctx.getInitParameter("org.jboss.forums.feeds.URL");
+        String urlType = ctx.getInitParameter("org.jboss.forums.feeds.URL_TYPE");
+        if (urlParam==null || urlParam.trim().length()==0
+                || urlType==null || urlType.trim().length()==0)
+        {
+            Object responseObj = ctx.getResponse();
+            if (responseObj instanceof RenderResponse)
+            {
+                RenderResponse response = (RenderResponse)responseObj;
+                PortletURL portletUrl = response.createActionURL();
+                
+                try
+                {
+                    portletUrl.setSecure(false);
+                } catch(javax.portlet.PortletSecurityException e)
+                {
+                    log.error(PortalUtil.class.getName(), e);
+                }
+
+                urlParam = portletUrl.toString();
+                if (urlParam.indexOf("/auth")!=-1)
+                {
+                    urlParam = urlParam.replaceFirst("/auth", "");
+                }
+                
+                urlType = "p";
+            }
+            else
+            {
+                urlParam = JSFUtil.getContextPath();
+                urlType = "s";
+            }
+            
+            url += "?url="
+                + urlParam
+                + "&urlType="
+                + urlType;
+        }
+        
+        return url;
+    }
+    
+    /**
+     * 
+     * 
+     */
+    public static void executeNotifications()
+    {
+
+        Object responseObj = FacesContext.getCurrentInstance()
+                .getExternalContext().getResponse();
+
+        Object requestObj = FacesContext.getCurrentInstance()
+                .getExternalContext().getRequest();
+
+        // Initializing url values
+        String postUrl = "";
+        String replyUrl = "";
+
+        if (requestObj instanceof RenderRequest)
+        {
+
+            PortletRequest request = (PortletRequest) requestObj;
+
+            // Checking whether there is watched post id in RenderParameters and
+            // scheduling notification e-mails.
+            String watchedPostId = request
+                    .getParameter(Constants.p_notified_post_id);
+            String watchedType = request
+                    .getParameter(Constants.p_notified_watch_type);
+
+            if (watchedPostId != null && watchedPostId.trim().length() > 0
+                    && watchedType != null && watchedType.trim().length() > 0)
+            {
+
+                // Creating permament link to post
+                PortletURL portletURL = ((RenderResponse) responseObj)
+                        .createActionURL();
+                postUrl = portletURL.toString();
+                
+                try
+                {
+                    portletURL.setSecure(false);
+                } catch(javax.portlet.PortletSecurityException e)
+                {
+                    log.error(PortalUtil.class.getName(), e);
+                }
+                
+                if (postUrl.indexOf("/auth")!=-1)
+                {
+                    postUrl = postUrl.replaceFirst("/auth", "");
+                }
+                postUrl += "&" + Constants.p_viewId + "=t&"
+                        + Constants.p_postId + "=" + watchedPostId + "#"
+                        + watchedPostId;
+
+                portletURL = ((RenderResponse) responseObj).createRenderURL();
+                replyUrl = portletURL.toString();
+                replyUrl += "&" + Constants.p_viewId + "=z&"
+                        + Constants.p_postId + "=" + watchedPostId;
+
+                // Generate hostUrl to servlet
+                String hostURL = ((request.isSecure()) ? "https" : "http")
+                        + "://"
+                        + request.getServerName()
+                        + ((request.getServerPort() == 80) ? "" : ":"
+                                + request.getServerPort());
+
+                postUrl = hostURL + postUrl;
+                replyUrl = hostURL + replyUrl;
+
+                Integer postId = new Integer(watchedPostId);
+                int type = Integer.parseInt(watchedType);
+
+                try
+                {
+                    BaseController.getForumsModule().processNotifications(
+                            postId, type, postUrl, replyUrl);
+                } catch (Exception e)
+                {
+                    JSFUtil.handleException(e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 
+     * @param preferenceKey
+     * @return
+     */
+    public static String getPreference(String preferenceKey)
+    {
+        String preference = null;
+
+        Object o = FacesContext.getCurrentInstance().getExternalContext()
+                .getRequest();
+        if (!JSFUtil.isAnonymous() && o instanceof PortletRequest)
+        {
+            PortletRequest request = (PortletRequest) o;
+            PortletPreferences pp = request.getPreferences();
+            preference = pp.getValue(preferenceKey, "");
+        }
+
+        return preference;
+    }
+
+    /**
+     * 
+     * 
+     */
+    public static void setPreferences(Map preferences) throws Exception
+    {
+        Object o = FacesContext.getCurrentInstance().getExternalContext()
+                .getRequest();
+        if (!JSFUtil.isAnonymous() && o instanceof PortletRequest)
+        {
+            PortletRequest request = (PortletRequest) o;
+            PortletPreferences pp = request.getPreferences();
+            for (Iterator itr = preferences.keySet().iterator(); itr.hasNext();)
+            {
+                String preferenceKey = (String) itr.next();
+                String value = (String) preferences.get(preferenceKey);
+                if (!pp.isReadOnly(preferenceKey))
+                {
+                    pp.setValue(preferenceKey, value);
+                }
+            }
+            pp.store();
+        }
+    }
+
+    /**
+     * Get a <code>SimpleDateFormat</code> object from the session. The object
+     * is stored in the session because it is expensive to create and we want to
+     * reuse it as much as we can. Also it is configured with the date format
+     * taken from the preference of the user if it exists.
+     * 
+     * @param req
+     *            the request that maybe contains the format object
+     * @return the format object
+     */
+    public static SimpleDateFormat getSDF()
+    {
+        Object o = FacesContext.getCurrentInstance().getExternalContext()
+                .getRequest();
+        if (o instanceof PortletRequest)
+        {
+            PortletRequest req = (PortletRequest) FacesContext
+                    .getCurrentInstance().getExternalContext().getRequest();
+
+            // Get the pattern
+            String pattern = req.getPreferences().getValue("dateformat",
+                    ForumsConstants.DEFAULT_DATE_PATTERN);
+
+            // Get the simple date format if it exists
+            SimpleDateFormat sdf = (SimpleDateFormat) FacesContext
+                    .getCurrentInstance().getExternalContext().getSessionMap()
+                    .get("SDF");
+
+            // Do we have it ?
+            if (sdf == null)
+            {
+                // Create a new one
+                sdf = new SimpleDateFormat(pattern, req.getLocale());
+
+                // Put it in the session
+                FacesContext.getCurrentInstance().getExternalContext()
+                        .getSessionMap().put("SDF", sdf);
+            } else
+            {
+                // Check if config has not changed
+                if (!sdf.toPattern().equals(pattern))
+                {
+                    sdf.applyPattern(pattern);
+                }
+            }
+            return sdf;
+        } else
+        {
+            SimpleDateFormat sdf = new SimpleDateFormat();
+            sdf.applyPattern(ForumsConstants.DEFAULT_DATE_PATTERN);
+            return sdf;
+        }
+    }
+
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static User getUser() throws Exception
+    {
+        User user = null;
+        String userName = FacesContext.getCurrentInstance()
+                .getExternalContext().getRemoteUser();
+        if (userName != null && userName.trim().length() > 0)
+        {
+            UserModule userModule = (UserModule) new InitialContext()
+                    .lookup(ModuleConstants.USERMODULE_JNDINAME);
+            user = userModule.findUserByUserName(userName);
+        }
+        return user;
+    }
+
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static String userProperty(User user, String propertyName)
+            throws Exception
+    {
+        String property = null;
+        String valueStr = null;
+        try
+        {
+            property = user.getClass().getField(propertyName).get(user)
+                    .toString();
+            Object value = upm.getProperty(user, property);
+            if (value != null && value.toString().trim().length() != 0)
+            {
+                valueStr = value.toString();
+            }
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+            throw e;
+        }
+        return valueStr;
+    }
+    
+    public static Date getUserLastLoginDate()
+    {
+        try
+        {
+            User user = PortalUtil.getUser();
+            if (user == null)
+            {
+                return null;
+            }
+            Object property = upm.getProperty(user, User.INFO_USER_LAST_LOGIN_DATE);
+            if (property!=null)
+            {
+                Date date =  sdfForLastLoginDate.parse(property.toString());
+                return date;
+            }
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return null;
+    }
+
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static Poster getPoster() throws Exception
+    {
+        Poster poster = null;
+
+        if (!JSFUtil.isAnonymous())
+        {
+            User user = PortalUtil.getUser();
+
+            Object userId = user.getId();
+            poster = BaseController.getForumsModule().findPosterByUserId(
+                    userId.toString());
+
+            if (poster == null)
+            {
+                poster = new PosterImpl(userId.toString());
+            }
+        } else {
+            poster = getGuestPoster();
+        }
+
+        return poster;
+    }
+
+    public static Poster getGuestPoster() throws Exception 
+    {
+        Poster poster = null;
+        
+        UserModule userModule = null;
+        User user = null;
+        
+        String guestUserName = BaseController.getForumsModule().getGuestUserName();
+        
+        try
+        {                                
+           userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
+           user = userModule.findUserByUserName(guestUserName);
+        }
+        catch (NoSuchUserException e)
+        {
+            user = userModule.createUser(guestUserName, "Guest user account!");
+        }
+        
+        Long userId = (Long) user.getId();
+        poster = BaseController.getForumsModule().findPosterByUserId(
+                String.valueOf(userId));
+        
+        if (poster == null) {
+            poster = new PosterImpl(userId.toString());
+        }
+        
+        return poster;
+    }
+
+    /**
+     * 
+     * @return
+     */
+    public static Poll createPoll()
+    {
+        Poll poll = new PollImpl();
+
+        poll.setTitle("");
+        poll.setCreationDate(new Date());
+
+        return poll;
+    }
+
+    /**
+     * 
+     * @return
+     */
+    public static PollOption createPollOption()
+    {
+        PollOption pollOption = new PollOptionImpl();
+        return pollOption;
+    }
+
+    /**
+     * 
+     * @author sshah
+     * 
+     * 
+     */
+    public static Message createMessage()
+    {
+        Message message = new MessageImpl();
+        return message;
+    }
+
+    /**
+     * 
+     * 
+     */
+    public static float getVotePercent(Poll poll, PollOption option)
+    {
+        float votePercent = 0;
+
+        float votesSum = poll.getVotesSum();
+        if (votesSum > 0)
+        {
+            votePercent = (option.getVotes() / votesSum);
+        }
+
+        return votePercent;
+    }
+
+    /**
+     * 
+     * 
+     */
+    public static String isWatchingForum(Forum forum)
+    {
+        String watchId = null;
+        
+        try 
+        {
+            User user = PortalUtil.getUser();
+            if (user==null) 
+            {
+                return null;
+            }
+            
+            Watch watch = BaseController.getForumsModule().findForumWatchByUserAndForum( user , forum.getId().intValue() );
+            
+            if (watch!=null)
+            {
+                return watch.getId().toString();
+            }
+            
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        
+        return watchId;
+    }
+
+    /**
+     * 
+     * This is for handling attachments in the portal environment Created on Jul
+     * 13, 2006
+     * 
+     * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+     */
+    private static ThreadLocal uploadedAttachment = new ThreadLocal();
+
+    /**
+     * 
+     * 
+     */
+    public static void setUploadedAttachment(TempFileBinding attachment)
+    {
+        PortalUtil.uploadedAttachment.set(attachment);
+    }
+
+    /**
+     * 
+     * 
+     */
+    public static TempFileBinding getUploadedAttachment()
+    {
+        return (TempFileBinding) PortalUtil.uploadedAttachment.get();
+    }
+    
+    public static User getUserNA() {
+        return userNA;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ThemeHelper.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ThemeHelper.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/ThemeHelper.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,270 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.properties.TCCLXProperties;
+import org.jboss.portlet.forums.theme.FolderType;
+import org.jboss.portlet.forums.theme.ForumsTheme;
+
+import org.jboss.portlet.forums.model.Topic;
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class ThemeHelper 
+{
+    private static Logger log = Logger.getLogger(ThemeHelper.class);
+    
+    /**
+     * 
+     */
+    private static Set supportedLanguages;
+    
+    /**
+     * 
+     */
+    private static ThemeHelper singleton = null;
+    
+    /**
+     * 
+     */
+    private ForumsTheme theme = null;
+    
+    /**
+     *  If number of posts in topic exceeds this value it means that this topic is hot.
+     */
+    public static final int hotThreshold = 10;
+    
+    
+    static
+    {
+        SortedSet languages = new TreeSet();
+        Iterator it = JSFUtil.getSupportedLocales();
+        while (it.hasNext())
+        {
+            languages.add(((Locale)it.next()).getLanguage());
+        }
+        supportedLanguages = java.util.Collections.unmodifiableSortedSet(languages);
+    }
+    
+    /**
+     * 
+     *
+     */
+    private ThemeHelper() throws Exception
+    {
+        //Start the theme
+        this.theme = new ForumsTheme();
+        //start theme
+        this.theme.setExtendedProperties(new TCCLXProperties(ForumsConstants.THEMENAME, "theme.properties"));
+        this.theme.start();    
+    }
+    
+    
+    /**
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static ThemeHelper getInstance() throws Exception
+    {
+        if(ThemeHelper.singleton==null)
+        {
+            ThemeHelper.singleton = new ThemeHelper();
+        }
+        return ThemeHelper.singleton;
+    }
+    
+    /**
+     * 
+     */
+    private static boolean isSupportedLanguage(String language)
+    {
+        return supportedLanguages.contains(language);
+    }
+    
+    //method linked to facelet functions---------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public static String getURL(String urlKey)
+    {
+        ThemeHelper helper = null;
+        try
+        {
+	       String url = null;
+	       
+	       helper = ThemeHelper.getInstance();	        
+	       
+	       //extract the urlValue
+	       /*String methodName = "get" + urlKey.substring(0,1).toUpperCase() + urlKey.substring(1);
+	       url = (String)helper.getClass().getMethod(methodName,null).invoke(helper,null);*/
+	       url = (String)helper.theme.getClass().getField(urlKey).get(helper.theme);
+               int lastIndexOfSlash = url.lastIndexOf("/");
+               String beginning = url.substring(0, lastIndexOfSlash);
+               
+               // We don't want to I18N images contained in common directory.
+               if (!beginning.endsWith("common"))
+               {
+                    String language = JSFUtil.getSelectedLocale().getLanguage();
+                    if (language.compareTo("")==0 || !isSupportedLanguage(language))
+                    {
+                        language = JSFUtil.getDefaultLocale().getLanguage();
+                    }
+                    String end = url.substring(lastIndexOfSlash,url.length());
+                    url = beginning + "/" + language + end;
+               }
+	       return url;
+        }
+        catch(Exception e)
+        {
+            log.error(helper,e);
+            return null;
+        }
+    }
+    
+    /**
+     * 
+     *
+     */
+    public static String getFolderTypeURL(Topic topic,boolean isAnonymous)
+    {
+       String folderTypeURL = ThemeHelper.getURL("resourceFolderURL");
+       
+
+       FolderType folderType = ThemeHelper.singleton.theme.getFolderType(topic.getType(),
+       topic.getStatus(), topic.getReplies() >= hotThreshold);
+       
+       if(!isAnonymous)
+       {
+           Date lastPostDate = topic.getLastPostDate();
+           Date lastLoginDate = PortalUtil.getUserLastLoginDate();
+           
+           if (lastPostDate==null || lastLoginDate==null || lastPostDate.compareTo(lastLoginDate)<=0)
+           {
+               folderTypeURL = folderType.folder;
+           } else
+           {
+                folderTypeURL = folderType.folderNew;
+           }
+       }
+       else
+       {
+           folderTypeURL = folderType.folder;
+       }
+       
+       return folderTypeURL;
+    }
+    
+    /**
+     *
+     *
+     */
+    public static String getFolderType(Topic topic)
+    {
+
+        // Getting ResourceBundle with current Locale
+        FacesContext ctx = FacesContext.getCurrentInstance();
+        UIViewRoot uiRoot = ctx.getViewRoot();
+        Locale locale = uiRoot.getLocale();
+        ClassLoader ldr = Thread.currentThread().getContextClassLoader();
+        ResourceBundle bundle = ResourceBundle.getBundle("ResourceJSF", locale, ldr);
+        
+        String topicType=null;
+        
+        int topicStatus = topic.getStatus();
+        FolderType folderType =
+            ThemeHelper.singleton.theme.getFolderType(topic.getType(),
+                                                      topicStatus,
+                                                      topic.getReplies() >=
+                                                      hotThreshold);
+
+        try {
+            if (topicStatus != ConstantsHelper.getConstantInt("TOPIC_MOVED")) 
+            {
+                try
+                {
+                   topicType = bundle.getString(folderType.type);
+                }
+                catch (java.util.MissingResourceException e)
+                {
+                   topicType = "";
+                }
+            } else 
+            {
+                topicType = bundle.getString("Topic_Moved");
+            }
+        } catch (Exception e) 
+        {
+            log.error(ThemeHelper.singleton,e);
+            return "";
+        }
+        return topicType;
+    }
+    //--------------------------------------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     * @return
+     */
+    public String getResourceForumURL()
+    {
+        return this.theme.resourceForumURL;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public String getResourceForumNewURL()
+    {
+        return this.theme.resourceForumNewURL;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public String getResourceForumLockedURL()
+    {
+        return this.theme.resourceForumLockedURL;
+    }      
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Util.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Util.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/Util.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/*
+ * Created on Jul 13, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class Util 
+{
+    /**
+     * 
+     * @param srcStream
+     * @param destStream
+     * @throws IOException
+     */
+    public static void transferBytes(InputStream srcStream,OutputStream destStream) 
+    throws IOException
+    { 
+        try
+        {            
+            byte[] buffer = new byte[1024];
+            int read = -1;
+            while((read=srcStream.read(buffer))!=-1)
+            {
+                destStream.write(buffer,0,read);
+            }
+        }
+        finally
+        {
+            if(srcStream!=null)
+            {
+                srcStream.close();
+            }
+            if(destStream!=null)
+            {
+                destStream.close();
+            }
+        }
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ActionController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ActionController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ActionController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import org.jboss.portlet.forums.ui.BaseController;
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ */
+public class ActionController extends BaseController 
+{
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,811 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portlet.forums.ui.*;
+
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+// Luca Stancapiano - import
+import org.jboss.portlet.forums.model.ForumInstance;
+import org.jboss.portlet.forums.model.Topic;
+
+/**
+ * 
+ * Created on May 16, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class AdminController extends ActionController 
+{
+    private static final int up = -15;
+    private static final int down = 15;
+    
+    /**
+     * ui data associated with "Category" information 
+     *
+     */
+    private String categoryName = null; //this is used by the create new category usecase
+    
+    /**
+     * ui data associated with "Forum" information
+     *
+     */
+    private String forumName = null;
+    private String forumDescription = null;
+    
+    /**
+     * ui data associated with selecting a category to perform a certain operation
+     */
+    private int selectedCategory = -1;    
+    private int selectedForum = -1;
+    
+    /**
+     * flags telling in what mode should the view be displayed
+     */
+    private boolean editCategoryMode;
+    private boolean editForumMode;
+    private boolean addCategoryMode;
+    private boolean addForumMode;
+    
+    //-----ui data-------------------------------------------------------------------------------------------------------------------------
+    /**
+     * @return Returns the categoryName.
+     */
+    public String getCategoryName() 
+    {
+        return this.categoryName;
+    }
+    /**
+     * @param categoryName The categoryName to set.
+     */
+    public void setCategoryName(String categoryName) 
+    {
+        this.categoryName = categoryName;
+    }         
+    /**
+     * @return Returns the forumDescription.
+     */
+    public String getForumDescription() 
+    {
+        return forumDescription;
+    }
+    /**
+     * @param forumDescription The forumDescription to set.
+     */
+    public void setForumDescription(String forumDescription) 
+    {
+        this.forumDescription = forumDescription;
+    }
+    /**
+     * @return Returns the forumName.
+     */
+    public String getForumName() 
+    {
+        return forumName;
+    }
+    /**
+     * @param forumName The forumName to set.
+     */
+    public void setForumName(String forumName) 
+    {
+        this.forumName = forumName;
+    }
+    /**
+     * 
+     *
+     */
+    public int getSelectedCategory()
+    {
+        return this.selectedCategory;
+    }
+    /**
+     * 
+     *
+     */
+    public void setSelectedCategory(int selectedCategory)
+    {
+        this.selectedCategory = selectedCategory;
+    }
+    /**
+     * 
+     *
+     */
+    public int getSelectedForum()
+    {
+        return this.selectedForum;
+    }
+    /**
+     * 
+     *
+     */
+    public void setSelectedForum(int selectedForum)
+    {
+        this.selectedForum = selectedForum;
+    }
+    
+    /**
+     * 
+     */
+    public boolean isEditCategoryMode()
+    {
+        return editCategoryMode;
+    }
+    
+    /**
+     * 
+     */
+    public boolean isEditForumMode()
+    {
+        return editForumMode;
+    }
+    
+    /**
+     * 
+     */
+    public boolean isAddCategoryMode()
+    {
+        return addCategoryMode;
+    }
+    
+    /**
+     * 
+     */
+    public boolean isAddForumMode()
+    {
+        return addForumMode;
+    }
+    //cleanup related----------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public void cleanup()
+    {
+        this.categoryName = null;
+        this.forumName = null;
+        this.forumDescription = null;
+        this.selectedCategory = -1;
+        this.selectedForum = -1;
+        this.editCategoryMode = false;
+        this.editForumMode = false;
+        this.addCategoryMode = false;
+        this.addForumMode = false;
+    }
+    //-------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public AdminController()
+    { 
+        try
+        {
+	        //load the selected category if a categoryid is found
+	        //fetch the category to be edited/deleted
+	        int categoryId = -1;
+	        String cour = ForumUtil.getParameter(Constants.p_categoryId);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	            categoryId = Integer.parseInt(cour);
+	        }
+	        if(categoryId!=-1)
+	        {
+	            Category category = null;
+	            try {
+	                category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+	            } catch (ModuleException e) {
+	                // Category was deleted
+	            }
+                    if (category!=null) {
+                        this.categoryName = category.getTitle();
+                        this.selectedCategory = category.getId().intValue();
+                    }
+	        }
+	        
+	        //load the selected forum is a forumid is found
+	        //fetch the forum to be edited/deleted
+	        int forumId = -1;
+	        String forumIdStr = ForumUtil.getParameter(Constants.p_forumId);
+	        if(forumIdStr!=null && forumIdStr.trim().length()>0)
+	        {
+	            forumId = Integer.parseInt(forumIdStr);
+	        }
+	        if(forumId!=-1)
+	        {
+                    Forum forum = null;
+                    try {
+                        forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+                    } catch (ModuleException e) {
+                        // Forum was deleted
+                    }
+                    if (forum!=null) {
+                        this.forumName = forum.getName();
+                        this.forumDescription = forum.getDescription();
+                        this.selectedCategory = forum.getCategory().getId().intValue();
+                        this.selectedForum = forum.getId().intValue();
+                    }
+	        }
+            
+            // Checking for editModes flags
+            String editCatStr = ForumUtil.getParameter(Constants.EDIT_CATEGORY);
+            if (editCatStr != null && editCatStr.trim().length()>0)
+            {
+                this.editCategoryMode = Boolean.valueOf(editCatStr).booleanValue();
+            }
+            
+            String editForStr = ForumUtil.getParameter(Constants.EDIT_FORUM);
+            if (editForStr != null && editForStr.trim().length()>0)
+            {
+                this.editForumMode = Boolean.valueOf(editForStr).booleanValue();
+            }
+            
+            // Checking for addModes flags
+            String addCatStr = ForumUtil.getParameter(Constants.ADD_CATEGORY);
+            if (addCatStr != null && addCatStr.trim().length()>0)
+            {
+                this.addCategoryMode = Boolean.valueOf(addCatStr).booleanValue();
+            }
+            
+            String addForStr = ForumUtil.getParameter(Constants.ADD_FORUM);
+            if (addForStr != null && addForStr.trim().length()>0)
+            {
+                this.addForumMode = Boolean.valueOf(addForStr).booleanValue();
+            }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+    }
+    
+    //----actions---------------------------------------------------------------------------------------------------------------------------
+    /**
+     * adds a category
+     *
+     */
+    public String addCategory()
+    {
+        String navState = null;
+        boolean success = false;
+        try
+        {
+        	// Luca Stancapiano start
+            //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+            
+            //add this new category to the forum instance
+            ForumInstance forumInstance = BaseController.getForumsModule().findForumInstanceById(new Integer(forumInstanceId));
+            
+            BaseController.getForumsModule().createCategory(this.categoryName, forumInstance);
+            // Luca Stancapiano end
+            
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Category_created_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Category_created_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.categoryName+"\" "+end);
+            success = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        finally
+        {
+            if(success)
+            {
+                //cleanup the state
+                this.cleanup();
+            }
+        }
+        return navState;
+    } 
+    
+    
+    /**
+     * edit category
+     */
+    public String editCategory()
+    {
+        String navState = null;
+        boolean success = false;
+        try
+        { 
+            int categoryId = -1;
+            String cour = ForumUtil.getParameter(Constants.p_categoryId);
+            if(cour!=null && cour.trim().length()>0)
+            {
+                categoryId = Integer.parseInt(cour);
+            }
+	        
+            //grab the category from the module and set the title
+            Category category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+            category.setTitle(this.categoryName);
+            
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Category_updated_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Category_updated_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.categoryName+"\" "+end);
+            
+            navState = Constants.EDIT_CATEGORY;
+            success = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        finally
+        {
+            if(success)
+            {
+                //cleanup the state
+                this.cleanup();
+            }
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String deleteCategory()
+    {
+       String navState = null;
+       boolean success = false;
+       try
+       { 
+            int categoryId = -1;
+            String cour = ForumUtil.getParameter(Constants.p_categoryId);
+            if(cour!=null && cour.trim().length()>0)
+            {
+                categoryId = Integer.parseInt(cour);
+            }
+	        
+           //grab the category from the module and set the title
+            Category source = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+            
+            if (this.selectedCategory!=-1) {
+                
+                Category target = BaseController.getForumsModule().findCategoryById(new Integer(this.selectedCategory));
+    	        
+                //move all the forums from source category to the selected target category
+                BaseController.getForumsModule().addAllForums(source,target);
+                
+            }
+            
+            //remove the source category
+            BaseController.getForumsModule().removeCategory(source);
+           
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Category_deleted_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Category_deleted_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.categoryName+"\" "+end);
+           
+            navState = Constants.DELETE_CATEGORY;
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+            success = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }        
+       finally
+       {
+           if(success)
+           {
+               //cleanup the state
+               this.cleanup();
+           }
+       }
+       return navState;
+    }
+    
+    /**
+     * adds a new forum
+     *
+     */
+    public String addForum()
+    {
+        String navState = null;
+        boolean success = false;
+        try
+        {
+            //add this new forum to the category
+            Category category = BaseController.getForumsModule().findCategoryById(new Integer(this.selectedCategory));
+            BaseController.getForumsModule().createForum(category,this.forumName,this.forumDescription);
+            
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Forum_created_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Forum_created_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.forumName+"\" "+end);
+            
+            success = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        finally
+        {
+            if(success)
+            {
+                //cleanup the state
+                this.cleanup();
+            }
+        }
+        return navState;
+    } 
+    
+    /**
+     * 
+     *
+     */
+    public String editForum()
+    {
+       String navState = null;
+       boolean success = false;
+       try
+       { 
+            int forumId = -1;
+            String cour = ForumUtil.getParameter(Constants.p_forumId);
+            if(cour!=null && cour.trim().length()>0)
+            {
+                forumId = Integer.parseInt(cour);
+            }
+	        
+            //grab the forum from the module and set the proper information
+            Forum forum = getForumsModule().findForumById(new Integer(forumId));
+            Category selectedCategory = getForumsModule().findCategoryById(new Integer(this.selectedCategory));
+            forum.setCategory(selectedCategory);
+            forum.setName(this.forumName);
+            forum.setDescription(this.forumDescription);	        	        
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+                
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Forum_updated_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Forum_updated_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.forumName+"\" "+end);
+                
+            navState = Constants.EDIT_FORUM;
+            success = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }        
+       finally
+       {
+           if(success)
+           {
+               //cleanup the state
+               this.cleanup();
+           }
+       }
+       return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String deleteForum()
+    {
+       String navState = null;
+       boolean success = false;
+       try
+       { 
+            int forumId = -1;
+	    String cour = ForumUtil.getParameter(Constants.p_forumId);
+	    if(cour!=null && cour.trim().length()>0)
+	    {
+	        forumId = Integer.parseInt(cour);
+	    }
+	    Forum source = null;
+	    //move all the topics/posts of this forum to the specified target forum
+            if(this.selectedForum!=-1)
+            {
+                source = BaseController.getForumsModule().findForumByIdFetchTopics(new Integer(forumId));
+                Forum target = BaseController.getForumsModule().findForumByIdFetchTopics(new Integer(selectedForum));
+                target.getTopics().addAll(source.getTopics());
+                target.setPostCount(target.getPostCount() + source.getPostCount());
+                target.setTopicCount(target.getTopicCount() + source.getTopicCount());
+                for (Iterator i = target.getTopics().iterator(); i.hasNext();)
+                {
+                   Topic tp = (Topic)i.next();
+                   tp.setForum(target);
+                }
+                
+                //clear the source out before delete
+                source.setTopics(new ArrayList());
+            } else {
+                source = BaseController.getForumsModule().findForumById(new Integer(forumId));
+            }
+            
+            
+            //means delete all topic/posts on this forum            
+            BaseController.getForumsModule().removeForum(source);
+	        
+            String start = JSFUtil.getBundleMessage("ResourceJSF","Forum_deleted_0");
+            String end = JSFUtil.getBundleMessage("ResourceJSF","Forum_deleted_1");
+            JSFUtil.setMessage(Constants.FEEDBACK,start+" \""+this.forumName+"\" "+end);	        	                   
+            
+            navState = Constants.DELETE_FORUM;
+            success = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }        
+       finally
+       {
+           if(success)
+           {
+               //cleanup the state
+               this.cleanup();
+           }
+       }
+       return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String moveCategoryUp()
+    {
+        String navState = null;        
+        try
+        {
+	        //get the categoryId where this forum should be added
+	        int categoryId = -1;
+	        String cour = ForumUtil.getParameter(Constants.p_categoryId);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	            categoryId = Integer.parseInt(cour);
+	        }
+	        	        
+	        Category category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+	        category.setOrder(category.getOrder() + AdminController.up);
+	        
+	         // Luca Stancapiano start
+	         //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+	         
+	        Iterator categories = BaseController.getForumsModule().findCategories(new Integer(forumInstanceId)).iterator();
+	         // Luca Stancapiano end
+	        
+	        for (int index = 10; categories.hasNext(); index += 10)
+	        {
+	           category = (Category)categories.next();
+	           category.setOrder(index);
+	        }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String moveCategoryDown()
+    {
+        String navState = null;
+        try
+        {
+	        //get the categoryId where this forum should be added
+	        int categoryId = -1;
+	        String cour = ForumUtil.getParameter(Constants.p_categoryId);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	            categoryId = Integer.parseInt(cour);
+	        }
+	        	        
+	        Category category = BaseController.getForumsModule().findCategoryById(new Integer(categoryId));
+	        category.setOrder(category.getOrder() + AdminController.down);
+	        
+	        // Luca Stancapiano start
+	        //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+	         
+	        Iterator categories = BaseController.getForumsModule().findCategories(new Integer(forumInstanceId)).iterator();
+	        // Luca Stancapiano end
+	        
+	        for (int index = 10; categories.hasNext(); index += 10)
+	        {
+	           category = (Category)categories.next();
+	           category.setOrder(index);
+	        }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String moveForumUp()
+    {
+        String navState = null;
+        try
+        {
+	        //get the categoryId where this forum should be added
+	        int forumId = -1;
+	        String cour = ForumUtil.getParameter(Constants.p_forumId);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	            forumId = Integer.parseInt(cour);
+	        }
+	        	     
+	        Forum forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+	        forum.setOrder(forum.getOrder() + AdminController.up);
+	        Iterator forums = BaseController.getForumsModule().findForumsByCategoryId(forum.getCategory().getId()).iterator();
+	        for (int index = 10; forums.hasNext(); index += 10)
+	        {
+	            forum = (Forum)forums.next();
+	            forum.setOrder(index);
+	        }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String moveForumDown()
+    {
+        String navState = null;
+        try
+        {
+	        //get the categoryId where this forum should be added
+	        int forumId = -1;
+	        String cour = ForumUtil.getParameter(Constants.p_forumId);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	            forumId = Integer.parseInt(cour);
+	        }
+	        	     
+	        Forum forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+	        forum.setOrder(forum.getOrder() + AdminController.down);
+	        Iterator forums = BaseController.getForumsModule().findForumsByCategoryId(forum.getCategory().getId()).iterator();
+	        for (int index = 10; forums.hasNext(); index += 10)
+	        {
+	            forum = (Forum)forums.next();
+	            forum.setOrder(index);
+	        }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     */
+    public String lockForum()
+    {
+        try
+        {
+            //get the forumId where this forum should be added
+            int forumId = -1;
+            String cour = ForumUtil.getParameter(Constants.p_forumId);
+            if(cour!=null && cour.trim().length()>0)
+            {
+                forumId = Integer.parseInt(cour);
+            }
+                     
+            Forum forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+            forum.setStatus(Constants.FORUM_LOCKED);
+            String message = JSFUtil.getBundleMessage("ResourceJSF","Forum_locked");
+            JSFUtil.setMessage(Constants.FEEDBACK,message);
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        finally
+        {
+            //cleanup the state
+            this.cleanup();
+        }
+        return null;
+    }
+
+    /**
+     * 
+     */
+    public String unlockForum()
+    {
+        try
+        {
+            //get the forumId where this forum should be added
+            int forumId = -1;
+            String cour = ForumUtil.getParameter(Constants.p_forumId);
+            if(cour!=null && cour.trim().length()>0)
+            {
+                forumId = Integer.parseInt(cour);
+            }
+                     
+            Forum forum = BaseController.getForumsModule().findForumById(new Integer(forumId));
+            forum.setStatus(Constants.FORUM_UNLOCKED);
+            String message = JSFUtil.getBundleMessage("ResourceJSF","Forum_unlocked");
+            JSFUtil.setMessage(Constants.FEEDBACK,message);
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        finally
+        {
+            //cleanup the state
+            this.cleanup();
+        }
+        return null;
+    }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return null;
+    }
+    
+    /**
+     * 
+     */
+    public String cancel()
+    {
+        cleanup();
+        return "cancel";
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/DeletePost.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/DeletePost.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/DeletePost.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Post;
+
+
+/*
+ * Created on May 3, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class DeletePost extends ActionController
+{
+    
+    private int postId;
+    private Post post;
+    
+    public int getPostId()
+    {
+        return this.postId;
+    }
+    
+    public void setPostId(int postId)
+    {
+        this.postId=postId;
+    }
+    
+    public Post getPost()
+    {
+        return this.post;
+    }
+    
+    public void setPost(Post post)
+    {
+        this.post=post;
+    }
+    
+    //----------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public DeletePost()
+    {
+        try
+        {
+            execute();
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+    }
+    
+    //initialization--------------------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public void execute() throws Exception
+    {
+        //get the post id
+        int postId = -1;
+        String p = ForumUtil.getParameter(Constants.p_postId);
+        if(p!=null && p.trim().length()>0)
+        {
+            postId = Integer.parseInt(p);
+        }
+        this.postId = postId;
+        if (postId!=-1)
+        {
+            post = getForumsModule().findPostById(new Integer(postId));
+        }
+    }
+    
+    //actions---------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public String confirmDelete()
+    {
+        String navState = null;        
+        try
+        {
+	        
+	        //setup the business objects/data of interest
+	        Post post = BaseController.getForumsModule().findPostById(new Integer(postId));
+	        Topic topic = post.getTopic();
+	        Forum forum = topic.getForum();
+	        
+	        //make sure this topic is not locked
+            if(topic.getStatus()==Constants.TOPIC_LOCKED)
+            {
+               //should not allow posting a reply since the topic is locked
+               throw new Exception(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME,Constants.TOPIC_LOCKED_ERR_KEY));
+            }
+	        
+	        
+	        boolean isFirstPost = false;
+	        boolean isLastPost = false;
+	        if(topic.getFirstPost().getId().intValue()==post.getId().intValue())
+	        {
+	            isFirstPost = true;
+	        }
+	        if(topic.getLastPost().getId().intValue()==post.getId().intValue())
+	        {
+	            isLastPost = true;
+	        }
+                
+	        //now perform the actual delete operation.........................
+	        if (isLastPost && isFirstPost)
+	        {
+	            // cascade delete will take care of removing
+	            // the post
+	            // the watches
+	            // the poll
+	            // the links	            
+	            getForumsModule().removeTopic(post.getTopic());	 
+	            
+	            //set the proper navigation state
+	            navState = Constants.TOPIC_DELETED;
+	         }
+	         else
+	         {
+	            getForumsModule().removePost(post);
+	            topic.setReplies(topic.getReplies() - 1);
+	            forum.setPostCount(forum.getPostCount() - 1);	            
+	            if(isLastPost)
+	            {
+	               Post lastPost = topic.getLastPost();
+	               topic.setLastPostDate(lastPost.getCreateDate());
+	            }
+	            
+	            //set the proper navigation state
+	            navState = Constants.SUCCESS;
+	         }	        	        
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        return navState;
+    }    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,363 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Collection;
+import java.util.TreeMap;
+
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Attachment;
+
+/**
+ * Created on May 2, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class EditPost extends PostAction
+{
+    
+    private boolean isFirstPost = false;
+    
+    public boolean isFirstPost ()
+    {
+        return isFirstPost;
+    }
+    
+    //constructor------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public EditPost()
+    {
+        super();
+    }
+    
+    //action processing methods-----------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public String start()
+    {
+        String navState = null;
+        try
+        {
+	        int postId = -1;
+	        String p = ForumUtil.getParameter(Constants.p_postId);
+	        if(p!=null && p.trim().length()>0)
+	        {
+	            postId = Integer.parseInt(p);
+	        }
+	        
+	        //grab the post information
+	        if(postId!=-1)
+	        {
+	            //re-initialize this controller to edit the specified post
+	            this.cleanup();
+	            
+	            //get the post from the module
+	            Post post = BaseController.getForumsModule().findPostById(new Integer(postId));
+	            Topic topic = post.getTopic();
+	            
+	            //set the selected post's topic id
+	            this.topicId = topic.getId().intValue();
+	            this.postId = postId;
+	            
+	            //set the subject of the post
+	            this.subject = post.getMessage().getSubject();
+	            
+	            //set the message of the post
+	            this.message = post.getMessage().getText();
+	            
+	            //set the topicType
+	            this.topicType = topic.getType();
+	            
+	            //setup poll related information
+	            this.setupPoll(topic.getPoll());
+	            
+	            //setup the attachment related information
+	            this.setupAttachments(post.getAttachments());
+                    
+                    isFirstPost = false;
+                    if(topic.getFirstPost().getId().intValue()==post.getId().intValue())
+                    {
+                        isFirstPost = true;
+                    }
+	        }
+	        
+	        navState = Constants.START_EDIT_POST;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String deletePoll()
+    {
+        String navState = null;        
+        try
+        {                        	        
+	        //cleanout poll related data from this controller
+	        this.question = null;
+	        this.options = new TreeMap();
+	        this.activeDuration = 0;
+	        
+	        navState = Constants.SUCCESS;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        return navState;
+    }
+    
+    
+    /**
+     * 
+     *
+     */
+    public String execute()
+    {
+        String navState = null;
+        boolean success = false;
+        try
+        {	        	        
+	        //setup the business objects to be updated
+	        Post post = BaseController.getForumsModule().findPostById(new Integer(this.postId));
+	        Topic topic = post.getTopic();
+	        	        
+	        //make sure this topic is not locked
+            if(topic.getStatus()==Constants.TOPIC_LOCKED)
+            {
+               //should not allow posting a reply since the topic is locked
+               throw new Exception(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME,Constants.TOPIC_LOCKED_ERR_KEY));
+            }
+	        
+	        //setup the message/subject related data
+	        Message message = PortalUtil.createMessage();
+	        message.setText(this.message);
+	        message.setSubject(this.subject);
+	        
+	        //update the message/subject/topicType data on the business objects
+	        post.setMessage(message);
+	        if(isFirstPost)
+	        {
+	            topic.setSubject(this.subject);
+	            topic.setType(this.topicType);
+	        }
+	        
+	        //miscellaneous post related update
+	        post.setEditCount(post.getEditCount() + 1);
+	        post.setEditDate(new Date());
+	        
+	        
+	        //TODO: cleanup this poll update process............move this as a private method
+	        //setup poll information
+	        List localPollOptions = new ArrayList();
+            for(Iterator itr=this.options.keySet().iterator();itr.hasNext();)
+            {
+                String key = (String)itr.next();
+                PollOption pollOption = PortalUtil.createPollOption();
+                pollOption.setQuestion((String)options.get(key));
+                pollOption.setVotes(0);
+                localPollOptions.add(pollOption);
+            }
+	        
+	        //update poll information
+            if(		topic.getPoll()==null	||
+                    topic.getPoll().getTitle() == null ||
+                    topic.getPoll().getTitle().trim().length() == 0
+            )
+            {
+                //no existing poll information found in the database
+                if(localPollOptions.size()>0 && this.question!=null && this.question.trim().length()>0)
+                {
+                    //need to add a new poll to this topic
+                    Poll poll = PortalUtil.createPoll();
+                    poll.setTitle(this.question);
+                    poll.setLength(this.activeDuration);
+                    poll.setOptions(localPollOptions);
+                    validatePoll(poll);
+                    BaseController.getForumsModule().addPollToTopic(topic,poll);
+                }
+            }
+            else
+            {
+                //existing poll information is available in the database
+                if(localPollOptions.size()>0)
+                {
+                    //this is a diff update..............................
+                    
+                    //setup the poll to be updated in the database
+                    Poll poll = PortalUtil.createPoll();
+                    poll.setTitle(this.question);
+                    poll.setLength(this.activeDuration);
+                    poll.setVoted(topic.getPoll().getVoted());
+                    poll.setCreationDate(topic.getPoll().getCreationDate());
+                                                            
+                    Iterator newOptions = localPollOptions.iterator();
+                    while (newOptions.hasNext())
+                    {                       
+                       PollOption newPollOption = (PollOption)newOptions.next();
+                       Iterator stored = topic.getPoll().getOptions().iterator();
+                       while(stored.hasNext())
+                       {
+                           PollOption oldPollOption = (PollOption)stored.next();
+	                       if(oldPollOption!=null && oldPollOption.getQuestion().equals(newPollOption.getQuestion()))
+	                       {
+	                           newPollOption.setVotes(oldPollOption.getVotes());
+	                           break;
+	                       }
+                       }
+                    }
+                    poll.setOptions(localPollOptions);
+                                        
+                    BaseController.getForumsModule().addPollToTopic(topic,poll);                    
+                }
+                else
+                {
+                    //remove the poll from the database...poll was removed during this editPost process
+                    topic.setPoll(null);
+                }
+            }
+	        
+                        
+            //TODO: cleanup this forums update process............move this as a private method
+	        //setup attachment information
+            Collection attachments = this.produceAttachments(this.attachments);
+            Collection removeFilter = new ArrayList();
+            Collection newAttachments = new ArrayList();
+            
+            //filter out the newly added attachments            
+            for(Iterator itr=attachments.iterator();itr.hasNext();)
+            {
+                Attachment cour = (Attachment)itr.next();
+                if(
+                        cour.getId()==null 
+                  )
+                {
+                    newAttachments.add(cour); //adds this new attachment to the database
+                    removeFilter.add(cour); //remove this newly added attachments from the list
+                    //to be compared against the list of stored attachments for update/remove                    
+                }
+            }
+            attachments.removeAll(removeFilter);
+	        
+	        //update/remove currently stored attachments on this post
+            Iterator storedAttachments = post.getAttachments().iterator();
+            removeFilter = new ArrayList();
+            while(storedAttachments.hasNext())
+            {
+                Attachment storedAttachment = (Attachment)storedAttachments.next();
+                
+                //not sure why a record like this is popping out from the hibernate layer
+                if(storedAttachment.getId()==null)
+                {
+                    removeFilter.add(storedAttachment); //clean this record up
+                    continue;
+                }
+                
+                //find this storedAttachment in the list of ui attachments.
+                //ones that are found are to be updated. once not found need to be removed
+                Iterator uiAttachments = attachments.iterator();
+                if(uiAttachments==null || !uiAttachments.hasNext())
+                {
+                    //basically all attachments on the ui were deleted
+                    removeFilter.add(storedAttachment);
+                    break;
+                }
+                while(uiAttachments.hasNext())
+                {
+                    Attachment local = (Attachment)uiAttachments.next();
+                    if(local.getId().intValue()==storedAttachment.getId().intValue())
+                    {
+                        //update this attachment
+                        storedAttachment.setComment(local.getComment());                       
+                        break;
+                    }
+                    //check if this stored attachment should be removed
+                    if(!uiAttachments.hasNext())
+                    {
+                        //if i get here, no match was made with the list of ui attachments
+                        //hence this particular stored attachment must be removed
+                        removeFilter.add(storedAttachment);
+                    }
+                }                                
+            }
+            post.getAttachments().removeAll(removeFilter);
+            
+            //add the newly added attachments
+            for(Iterator itr=newAttachments.iterator();itr.hasNext();)
+            {
+                post.addAttachment((Attachment)itr.next());
+            }
+                                    	       	        
+	        //set the proper navigation state
+	        navState = Constants.SUCCESS;	        	        
+	        
+	        success = true;
+        }
+        catch (PollValidationException e)
+        {
+//          handle proper validation error with a proper message...not just a generic message..
+            //just use generic error page for the proof of concept
+            //set the custom exception such that e.toString() results in the proper message
+            JSFUtil.handleException(e);
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        finally
+        {
+            //cleanup if necessary
+            if(success)
+            {
+                this.cleanup();
+            }
+        }        
+        return navState;
+     }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,351 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.portlet.forums.ui.*;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.ForumWatch;
+import org.jboss.portlet.forums.model.TopicWatch;
+
+/**
+ * This controller is used for activating/deactivating/managing forum watches
+ * 
+ * Created on Jul 7, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ForumWatchController extends ActionController 
+{
+    //ui data supporting the AddForumWatch widget
+    private int selectedForum = -1;
+    private int watchMode = -1;
+    private Forum forum = null;
+    
+    // flag informing UI that notification edit mode is turned on
+    private boolean editMode;
+    
+    
+    /**
+     * @return Returns the selectedForum.
+     */
+    public int getSelectedForum() 
+    {
+        return selectedForum;
+    }
+    
+    /**
+     * @param selectedForum The selectedForum to set.
+     */
+    public void setSelectedForum(int selectedForum) 
+    {
+        this.selectedForum = selectedForum;
+    }
+    
+    /**
+     * 
+     */
+    public Forum getForum()
+    {
+        return this.forum;
+    }
+    
+    /**
+     * 
+     */
+    public void setForum (Forum forum)
+    {
+        this.forum=forum;
+    }
+            
+    /**
+     * @return Returns the watchMode.
+     */
+    public int getWatchMode() 
+    {
+        return watchMode;
+    }
+    
+    /**
+     * @param watchMode The watchMode to set.
+     */
+    public void setWatchMode(int watchMode) 
+    {
+        this.watchMode = watchMode;
+    }
+    
+    /**
+     * 
+     */
+    public boolean isEditMode ()
+    {
+        return this.editMode;
+    }
+    
+    /**
+     * 
+     */
+    public void setEditMode (boolean editMode)
+    {
+        this.editMode = editMode;
+    }
+    
+    //-------------------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public ForumWatchController()
+    { 
+        try
+        {
+	        //populate the already setup form watches
+	        //this.reloadWatches();
+            
+            try
+            {
+                String f = JSFUtil.getRequestParameter(Constants.p_forumId);
+                if (f!=null && f.trim().length()>0) {
+                    selectedForum = Integer.parseInt(f);
+                } 
+            } catch (NumberFormatException e)
+            {
+                JSFUtil.handleException(e);
+            }
+            
+            if (selectedForum!=-1)
+            {
+                try
+                {
+                    this.forum = getForumsModule().findForumById(new Integer(this.selectedForum));
+                } catch (Exception e)
+                {
+                    JSFUtil.handleException(e);
+                    this.forum=null;
+                }
+            }
+            
+            if (selectedForum!=-1)
+            {
+                try
+                {
+                    this.forum = getForumsModule().findForumById(new Integer(selectedForum));
+                } catch (Exception e)
+                {
+                    JSFUtil.handleException(e);
+                }
+            }
+            
+            String edit = JSFUtil.getRequestParameter(Constants.EDIT_WATCH);
+            if (edit!=null && edit.trim().length()>0) {
+                editMode = Boolean.valueOf(edit).booleanValue();
+            } else {
+                editMode = false;
+            }
+            
+            
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+    }        
+    //-------------------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public String activateWatch()
+    {
+        String navState = null;
+        try
+        {	                
+	        int forumId = this.selectedForum;
+	        
+            try
+            {
+                String wt = JSFUtil.getRequestParameter(Constants.p_notified_watch_type);
+                if (wt!=null && wt.trim().length()>0) {
+                    watchMode = Integer.parseInt(wt);
+                } else {
+                    watchMode = -1;
+                }
+            } catch (NumberFormatException e)
+            {
+                JSFUtil.handleException(e);
+                watchMode = -1;
+            }
+            
+            if (forumId==-1 || watchMode==-1)
+            {
+                return null;
+            }
+            
+	        //make sure a watch for this forum is not already issued for this user
+	        boolean isDuplicate = this.isDuplicateWatch(forumId);
+	        if(isDuplicate)
+	        {
+	            return "success";
+	        }
+	        
+	        //get the forum that must be activated for watching
+	        Forum forum = this.getForumsModule().findForumById(new Integer(forumId));
+	        	        
+	        
+	        //activate the watch for the selected forum
+	        this.getForumsModule().createWatch(PortalUtil.getPoster(),forum,this.watchMode);
+            navState="success";
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String deActivateWatch()
+    {
+        String navState = null;
+        try
+        {
+            int watchId = -1;
+            
+	        String w = JSFUtil.getRequestParameter(Constants.p_watchId);
+            if (w!=null && w.trim().length()>0)
+            {
+	           watchId = Integer.parseInt(w);
+            }
+	        
+            if (watchId==-1)
+            {
+                String f = JSFUtil.getRequestParameter(Constants.p_forumId);
+                if (f!=null && f.trim().length()>0)
+                {
+                   int forumId = Integer.parseInt(f);
+                   ForumWatch forumWatch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(), forumId);
+                   watchId = forumWatch!=null ? forumWatch.getId().intValue() : -1;
+                }
+            }
+            
+            if (watchId!=-1)
+            {
+	           this.getForumsModule().removeWatch(this.getForumsModule().findForumWatchById(new Integer(watchId)));
+            }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        return navState;
+    }
+    
+    /**
+     * 
+     */
+    public String updateNotificationType()
+    {
+        String navState = null;
+        
+        try
+        {
+            String wt = JSFUtil.getRequestParameter(Constants.p_notified_watch_type);
+            if (wt!=null && wt.trim().length()>0) {
+                watchMode = Integer.parseInt(wt);
+            } else {
+                watchMode = -1;
+            }
+        } catch (NumberFormatException e)
+        {
+            JSFUtil.handleException(e);
+            watchMode = -1;
+        }
+        
+        if (watchMode==-1 || selectedForum==-1)
+        {
+            return navState;
+        }
+        
+        try
+        {
+            ForumWatch forumWatch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(),this.selectedForum);
+            forumWatch.setMode(watchMode);
+            navState="success";
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        selectedForum=-1;
+        return navState;
+    }
+    
+    /**
+     * When user cancels creating forum notification then this action is executed.
+     */
+    public String cancel()
+    {
+        return "cancel";
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String updateWatch()
+    {
+        return null;
+    }
+    
+    //--------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     *
+     */
+    private boolean isDuplicateWatch(int forumId)
+    {
+        try
+        {
+            ForumWatch watch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(), selectedForum);
+            return watch!=null;
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return false;
+    }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return null;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/MessageValidationException.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/MessageValidationException.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/MessageValidationException.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+/**
+ * 
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class MessageValidationException extends Exception
+{
+    
+    public static final int INVALID = 0;
+    public static final int INVALID_POST_SUBJECT = 1;
+    public static final int INVALID_POST_TEXT = 2;
+    
+    private int type;
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public MessageValidationException (int type) {
+        super();
+        this.type = type;
+        if ( type != INVALID_POST_SUBJECT  &&
+             type != INVALID_POST_TEXT)
+        {
+            this.type = INVALID;
+        }
+    }
+    
+    public int getType() {
+        return type;
+    }
+    
+}
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,542 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.view.PageNavigator;
+
+/**
+ * ModeratorAction class is a managed bean used for getting, keeping, transforming
+ * all data and invoking moderator actions for Moderator's Control Panel.
+ * 
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ModeratorAction extends BaseController
+{
+
+    //preference related data
+    private PreferenceController userPreferences = null;
+
+    //business data being generated in this bean by executing ui actions
+    //this is data is created such that it can be consumed by the view components
+    //like facelets  
+    private Forum forum = null;
+    private PageNavigator pageNavigator = null;
+    private Collection page = new ArrayList();
+    private Map topicNavigator = new HashMap();
+    private Map checkboxes;
+    
+    // Page navigation methods
+     /**
+      * 
+      */
+     public PageNavigator getPageNavigator()
+     {
+         return this.pageNavigator;
+     }
+     
+     /**
+      * 
+      *
+      */
+     public Map getTopicNavigator()
+     {
+         return this.topicNavigator;
+     }
+
+     //------------user preferences-------------------------------------------------------------------------------------------------------------
+     /**
+      * @return Returns the userPreferences.
+      */
+     public PreferenceController getUserPreferences() 
+     {
+         return userPreferences;
+     }
+     /**
+      * @param userPreferences The userPreferences to set.
+      */
+     public void setUserPreferences(PreferenceController userPreferences) 
+     {
+         this.userPreferences = userPreferences;    
+     }             
+     //-------------------------------------------------------------------------------------------------------------------------------------
+    
+    //----------------business data being generated for use by the view components like facelets---------------------------------------------------------------------------------------
+    public Forum getForum()
+    {
+        return this.forum;
+    }     
+    
+    public void setCheckboxes(Map checkboxes)
+    {
+        this.checkboxes = checkboxes;
+    }
+
+    public Map getCheckboxes()
+    {
+        return checkboxes;
+    } 
+    
+    public Collection getPage() {
+        return page;
+    }
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------
+    
+    //-------------------------------------------------------------------------------------------------------------------------------------                
+    /**
+     * 
+     * @author Ryszard Kozmik
+     */
+    public ModeratorAction()
+    { 
+        super();         
+    }
+    
+    //ui actions supported by this bean----------------------------------------------------------------------------------------------------
+    
+    /**
+     * UI Action for deleting topic(s) from the forum.
+     * 
+     * @return
+     */
+    public String deleteTopic () 
+    {  
+        Iterator it = checkboxes.keySet().iterator();
+        String message="";     
+        try {
+            while (it.hasNext()) 
+            {
+                Integer topicId = (Integer)it.next();
+                boolean value = ((Boolean)checkboxes.get(topicId)).booleanValue();                
+                
+                try {   
+                    if (value)
+                    {
+                        Topic topic = getForumsModule().findTopicById(topicId);
+                        this.getForumsModule().removeTopic(topic);
+                    }
+                } catch(Exception e)
+                {
+                    setWarnBundleMessage("ERR_CANNOT_REMOVE_TOPIC");
+                    return "success";
+                }        
+            }
+            setInfoBundleMessage("SUCC_TOPIC_REMOVED");
+            
+        } catch (Exception e) 
+        {
+            JSFUtil.handleException(e);
+        }
+        return "success";
+    }
+    
+    /**
+     * UI Action for moveing topic(s) from one forum to other.
+     * 
+     * @return
+     */
+    public String moveTopic () 
+    {
+        String message="";
+        String forum_to_id = ForumUtil.getParameter(Constants.p_forum_to_id);
+        if (forum_to_id==null || forum_to_id.trim().length()==0 || forum_to_id.trim().compareToIgnoreCase("-1")==0) 
+        {
+            setWarnBundleMessage("ERR_NO_DEST_FORUM");
+            return "success";
+        }
+        Forum forumDest=null;
+        try {
+            forumDest = this.getForumsModule().findForumById(new Integer(forum_to_id));
+        } catch (Exception e) 
+        {
+            setWarnBundleMessage("ERR_INTERNAL");
+            return "success";
+        }
+        
+        Iterator it = checkboxes.keySet().iterator();
+        try {
+            
+            // Refreshing forum from which topics are going to be moved
+            this.forum = getForumsModule().findForumById(forum.getId());
+            
+            while (it.hasNext()) 
+            {
+                Integer topicId = (Integer)it.next();
+                boolean value = ((Boolean)checkboxes.get(topicId)).booleanValue();                
+                if (value)
+                {
+                    Topic topic = null;
+                    try {   
+                        topic = getForumsModule().findTopicById(topicId);
+                    } catch(Exception e)
+                    {
+                        setWarnBundleMessage("ERR_INTERNAL");
+                        return "success";
+                    }
+                    
+                    forumDest.addTopic(topic);
+                    forumDest.setPostCount(forumDest.getPostCount()+topic.getReplies()+1);
+                    forumDest.setTopicCount(forumDest.getTopicCount()+1);
+                    
+                    this.forum.setPostCount(this.forum.getPostCount()-topic.getReplies()-1);
+                    this.forum.setTopicCount(this.forum.getTopicCount()-1);
+                    
+                    getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+                }
+            }
+            setInfoBundleMessage("SUCC_TOPIC_MOVED");
+            
+        } catch (Exception e) 
+        {
+            JSFUtil.handleException(e);
+        }
+        return "success";
+    }
+    
+    /**
+     * UI Action for locking selected topic(s).
+     * 
+     * @return
+     */
+    public String lockTopic () 
+    {
+        if (isAnyCheckboxSelected()) 
+        {
+            Iterator it = checkboxes.keySet().iterator();
+            String message="";     
+            try {
+                while (it.hasNext()) 
+                {
+                    Integer topicId = (Integer)it.next();
+                    boolean value = ((Boolean)checkboxes.get(topicId)).booleanValue();                
+                    
+                    try {   
+                        if (value)
+                        {
+                            Topic topic = getForumsModule().findTopicById(topicId);
+                            topic.setStatus(Constants.TOPIC_LOCKED);
+                        }
+                    } catch(Exception e)
+                    {
+                        setWarnBundleMessage("ERR_INTERNAL");
+                        return "";
+                    }        
+                }
+                setInfoBundleMessage("SUCC_TOPIC_LOCKED");
+                
+            } catch (Exception e) 
+            {
+                JSFUtil.handleException(e);
+            }
+            return "";
+        } else 
+        {
+            setWarnBundleMessage("None_selected");
+            return "";
+        }
+        
+    }
+    
+    /**
+     * UI Action for unlocking selected topic(s).
+     * 
+     * @return
+     */
+    public String unlockTopic () 
+    {
+        if (isAnyCheckboxSelected()) 
+        {
+            Iterator it = checkboxes.keySet().iterator();
+            String message="";     
+            try {
+                while (it.hasNext()) 
+                {
+                    Integer topicId = (Integer)it.next();
+                    boolean value = ((Boolean)checkboxes.get(topicId)).booleanValue();                
+                    
+                    try {   
+                        if (value)
+                        {
+                            Topic topic = getForumsModule().findTopicById(topicId);
+                            topic.setStatus(Constants.TOPIC_UNLOCKED);
+                        }
+                    } catch(Exception e)
+                    {
+                        setWarnBundleMessage("ERR_INTERNAL");
+                        return "";
+                    }        
+                }
+                setInfoBundleMessage("SUCC_TOPIC_UNLOCKED");
+                
+            } catch (Exception e) 
+            {
+                JSFUtil.handleException(e);
+            }
+            return "";
+        } else 
+        {
+            setWarnBundleMessage("None_selected");
+            return "";
+        }
+    }
+    
+    /**
+     * Action checking if user selected at least one topic and forwards him to
+     * delete confirmation view.
+     * 
+     * @return
+     */
+    public String deleteConfirm() 
+    {
+        if (isAnyCheckboxSelected()) 
+        {
+            return "confirmDelete";
+        } else 
+        {
+            setWarnBundleMessage("None_selected");
+            return "";
+        }
+    }
+
+    /**
+     * Action checking if user selected at least one topic and forwards him to
+     * move topic view.
+     * 
+     * @return
+     */    
+    public String moveConfirm() 
+    {
+        if (isAnyCheckboxSelected()) 
+        {
+            return "confirmMove";
+        } else 
+        {
+            setWarnBundleMessage("None_selected");
+            return "";
+        }
+    }
+    
+    /**
+     * Method checks if user selected at least one topic from checkboxes or
+     * there is topic id sent in request.
+     * 
+     * @return
+     */
+    public boolean isAnyCheckboxSelected() 
+    {
+        // Looking for selected topicId's in checkboxes Map
+        if (checkboxes!=null && checkboxes.size()!=0)
+        {
+            Iterator it = checkboxes.keySet().iterator();
+            while (it.hasNext()) 
+            {
+                if (((Boolean)checkboxes.get(it.next())).booleanValue()) 
+                {
+                    return true;
+                }
+            }
+        }
+        
+        // Looking for topicId sent in parameter
+        String topicId = ForumUtil.getParameter(Constants.p_topicId);
+        
+        if (topicId!=null && topicId.trim().length()>0)
+        {    
+            checkboxes = new HashMap(1);
+            checkboxes.put(new Integer(topicId),Boolean.TRUE);
+            return true;
+        }
+        return false;
+    }
+    
+    public List getAllSelectedTopics()
+    {
+        List list = new LinkedList();
+        Iterator it = checkboxes.keySet().iterator();
+        while (it.hasNext())
+        {
+             Integer topicId = (Integer)it.next();
+             if ( ((Boolean)checkboxes.get(topicId)).booleanValue() )
+             {
+                 try
+                 {
+                     list.add(getForumsModule().findTopicById(topicId));
+                 }
+                 catch (Exception e)
+                 {
+                     JSFUtil.handleException(e);
+                 }
+             }
+        }
+        return list;
+    }
+    
+    // ---------- Initialization -----------------------------------------------
+    
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+       boolean initialized = false;
+       try
+       { 
+           this.execute();
+           initialized = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       return initialized;
+    }
+    
+    private void execute() throws Exception
+    {      
+        int currentPage = 0;
+        //parse the input parameters
+        String pageParam = ForumUtil.getParameter(Constants.p_page);
+        if(pageParam!=null && pageParam.trim().length()>0)
+        {
+            //setup the page data
+            currentPage = Integer.parseInt(pageParam);                                           
+        }
+        
+        // trying to get forumId from request parameter
+        int forumId = -1;
+        String f = ForumUtil.getParameter(Constants.p_forumId);
+
+        if(f!=null && f.trim().length()>0)
+        {
+            forumId = Integer.parseInt(f);
+        }
+
+        checkboxes=new HashMap();
+
+        // ForumsModule is stored as a final variable so that anonymous class could use it.
+        final ForumsModule fm = BaseController.getForumsModule();
+
+        //grab the data to be displayed for this page
+        if(forumId!=-1)
+        {
+            
+            //setup the business objects like the forum, topics etc that will be displayed
+            this.forum = fm.findForumById(new Integer(forumId));
+                    
+        } else {
+            
+            // trying to get forumId from topicId read from request
+            String t = ForumUtil.getParameter(Constants.p_topicId);
+            
+            if (t!=null && t.trim().length()>0) {
+            
+                Topic topic = fm.findTopicById(new Integer(t));
+                this.forum = topic.getForum();
+                
+            } else {
+                String p = ForumUtil.getParameter(Constants.p_postId);
+                
+                if (p!=null && p.trim().length()>0) {
+
+                    Post post = fm.findPostById(new Integer(p));
+                    Topic topic = post.getTopic();
+                    this.forum = topic.getForum();
+                }
+            }
+        }
+
+        int topicCount = this.forum.getTopicCount();
+
+        //setup the pageNavigator for this forum        
+        this.pageNavigator = new PageNavigator(
+            topicCount, //total number of entries to be split up into pages
+            Integer.parseInt(this.userPreferences.getPreference(Constants.TOPICS_FORUM_KEY)), 
+            currentPage //currently selected page being displayed, first page by default
+        ) {
+
+            protected Collection initializePage() {
+            
+                int beginIndex = this.getBeginIndex();
+                int totalEntries = this.getNumberOfEntries();
+                int pageSize = this.getPageSize();
+                
+                //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                if(beginIndex >= totalEntries || beginIndex < 0)
+                {
+                    this.setCurrentPage(0); //go to the first page
+                    beginIndex = this.getBeginIndex();
+                }
+                
+                try {
+                    return fm.findTopicsDesc(forum,
+                                             beginIndex,
+                                             pageSize);
+                } catch (ModuleException e) {
+                    JSFUtil.handleException(e);
+                }
+                return new ArrayList();
+                
+            }
+            
+        };
+        
+        this.page = this.pageNavigator.getPage();
+    }
+    
+    private void setWarnBundleMessage(String bundleKey) {
+        String message = JSFUtil.getBundleMessage("ResourceJSF",bundleKey);
+        FacesContext.getCurrentInstance().addMessage("message",
+        new FacesMessage(FacesMessage.SEVERITY_WARN,message, "moderate"));
+    }
+    
+    private void setInfoBundleMessage(String bundleKey) {
+        String message = JSFUtil.getBundleMessage("ResourceJSF",bundleKey);
+        FacesContext.getCurrentInstance().addMessage("message",
+        new FacesMessage(FacesMessage.SEVERITY_INFO,message, "moderate"));
+    }
+    
+    //-------------------------------------------------------------------------------------------------------------------------------------
+
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,187 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.Date;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Post;
+
+//myfaces
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class NewTopic extends PostAction
+{            
+    //----------------------------------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public NewTopic() 
+    { 
+        super();                 
+    }    
+    //----------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public String start()
+    {
+        String navState = null;
+        try
+        {
+	        int forumId = -1;
+	        String f = ForumUtil.getParameter(Constants.p_forumId);
+	        if(f!=null && f.trim().length()>0)
+	        {
+	            forumId = Integer.parseInt(f);
+	        }
+	        
+	        //grab the forum where this topic will be added
+	        if(forumId!=-1)
+	        {
+	            //re-initialize this controller to add a new topic
+	            //to the specified forum
+	            this.cleanup();
+	            
+	            //set the selected forum's id
+	            this.forumId = forumId;	 
+	            
+	            //get the poll title if one was specified
+	            this.question = ForumUtil.getParameter(Constants.p_poll_title);	            	            
+	        }
+	        
+	        navState = Constants.START_NEW_TOPIC;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        } 
+        return navState;
+    }                        
+    //--------execute-------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @return
+     */
+    public String execute()
+    {
+       String navState = null;
+       boolean success = false;
+       try
+       { 
+           //setup the message
+           Message message = PortalUtil.createMessage();
+           message.setText(this.message);
+           message.setSubject(this.subject);
+           
+           //setup the forum and the corresponding poster
+           Forum forum = BaseController.getForumsModule().findForumById(new Integer(this.forumId));
+           Poster poster = PortalUtil.getPoster();
+           
+           //setup the poll related information
+           Poll poll = PortalUtil.createPoll();
+           if(this.question!=null && this.question.trim().length()>0)
+           {
+               poll.setTitle(this.question);               
+               poll.setLength(this.activeDuration);
+               List pollOptions = new ArrayList();
+               for(Iterator itr=this.options.keySet().iterator();itr.hasNext();)
+               {
+                   String option = (String)itr.next();
+                   PollOption pollOption = PortalUtil.createPollOption();
+                   pollOption.setQuestion((String)options.get(option));
+                   pollOption.setVotes(0);
+                   pollOptions.add(pollOption);
+               }
+               poll.setOptions(pollOptions);
+               validatePoll(poll);
+           }
+                                 
+           //actually create the topic in this forum
+           //use this method when poll and attachments are actually integrated
+           Post post = BaseController.getForumsModule().createTopic(
+	           forum,
+	           message,
+	           new Date(),
+	           poster,
+	           poll, //poll
+	           (List)this.produceAttachments(this.attachments), //attachments
+	           this.topicType
+           );
+           
+           poster.incrementPostCount();
+                      
+           //setup the navigation state           
+           navState = Constants.SUCCESS;
+           
+           success = true;
+       }
+       catch (MessageValidationException e) 
+       {
+           //handle proper validation error with a proper message...not just a generic message..
+           //just use generic error page for the proof of concept
+           //set the custom exception such that e.toString() results in the proper message
+           JSFUtil.handleException(e);
+       }
+       catch (PollValidationException e) 
+       {
+           //handle proper validation error with a proper message...not just a generic message..
+           //just use generic error page for the proof of concept
+           //set the custom exception such that e.toString() results in the proper message
+           JSFUtil.handleException(e);
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       finally
+       {
+           //cleanup if necessary
+           if(success)
+           {
+               this.cleanup();
+           }
+       }
+       return navState;
+    }    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import org.jboss.portlet.forums.ui.*;
+
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Poster;
+
+/**
+ * Created on May 5, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class PollController extends ActionController 
+{
+    
+    /**
+     * accepts a vote and processes it
+     *
+     */
+    public String vote()
+    {
+        String navState = null;        
+        try
+        {
+	        String t = ForumUtil.getParameter(Constants.p_topicId);
+	        String vote = ForumUtil.getParameter(Constants.p_vote);
+	        
+	        if(t!=null && t.trim().length()>0)
+	        {
+	            //setup the data needed for this process
+	            int topicId,voteIndex;
+	            try
+	            {
+	                topicId = Integer.parseInt(t);
+	                voteIndex = Integer.parseInt(vote);
+	            }
+	            catch(NumberFormatException e)
+	            {
+	                //dont process a vote
+	                return null;
+	            }
+	            	            
+	            Topic topic = this.getForumsModule().findTopicById(new Integer(topicId));
+	            Poll poll = topic.getPoll();
+	            PollOption selectedOption = (PollOption)poll.getOptions().get(voteIndex);
+	            Poster poster = PortalUtil.getPoster();
+	            
+	            //perform the voting on the selected option
+	            if(poster!=null)
+	            {
+	                poll.getVoted().add(new Integer(poster.getUserId()));
+	            }
+	            selectedOption.incVotes();
+	        }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }        
+        return navState;
+    }    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollValidationException.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollValidationException.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PollValidationException.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+/**
+ * 
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class PollValidationException extends Exception
+{
+
+    public static final int INVALID = 0;
+    public static final int INVALID_POLL_OPTION = 1;
+    public static final int TOO_FEW_POLL_OPTION = 2;
+    public static final int TOO_MANY_POLL_OPTION = 3;
+    public static final int INVALID_POLL_TITLE = 4;
+    
+    private int type;
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public PollValidationException (int type) {
+        super();
+        this.type = type;
+        if ( type != INVALID_POLL_OPTION  &&
+             type != INVALID_POLL_TITLE   &&
+             type != TOO_FEW_POLL_OPTION &&
+             type != TOO_MANY_POLL_OPTION  )
+        {
+            this.type = INVALID;
+        }
+    }
+    
+    public int getType() {
+        return type;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,699 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.Date;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.text.SimpleDateFormat;
+
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.helper.TempFileBinding;
+import org.jboss.portlet.forums.impl.AttachmentImpl;
+import org.jboss.portlet.forums.model.Attachment;
+import org.jboss.portlet.forums.model.Poll;
+import org.jboss.portlet.forums.model.PollOption;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Message;
+
+//myfaces
+import org.apache.myfaces.custom.fileupload.UploadedFile;
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public abstract class PostAction extends ActionController
+{
+    //post related view data
+    protected String subject = null;
+    protected String message = null;
+    protected int    topicType = 0;
+    
+    //poll related data view data
+    protected String question = null;
+    protected Map options = new TreeMap();
+    protected int		 activeDuration = 0;
+    protected String option = null;
+    //protected Map optionRow = null;
+    
+    
+    //attachment related view data
+    protected String attachmentComment = null;
+    protected UploadedFile attachment = null;
+    protected Collection attachments = new ArrayList();
+    
+    
+    //navigation control related data
+    protected boolean isPreview = false;
+    protected int     forumId = -1;
+    protected int     topicId = -1;
+    protected int	  postId = -1;
+    
+    //business state
+      
+    //ui related data accessors----------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * @return Returns the message.
+     */
+    public String getMessage() 
+    {
+        return message;
+    }
+    
+    /**
+     * @param message The message to set.
+     */
+    public void setMessage(String message) 
+    {
+        this.message = message;
+    }
+    
+    /**
+     * @return Returns the subject.
+     */
+    public String getSubject() 
+    {
+        return subject;
+    }
+    
+    /**
+     * @param subject The subject to set.
+     */
+    public void setSubject(String subject) 
+    {
+        this.subject = subject;
+    }
+        
+    /**
+     * @return Returns the topicType.
+     */
+    public int getTopicType() 
+    {
+        return topicType;
+    }
+    
+    /**
+     * @param topicType The topicType to set.
+     */
+    public void setTopicType(int topicType) 
+    {
+        this.topicType = topicType;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public String getPostDate()
+    {
+        String dateStr = null;
+        
+        SimpleDateFormat dateFormat = PortalUtil.getSDF();
+        
+        dateStr = dateFormat.format(new Date());
+        
+        return dateStr;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public String getQuestion()
+    {
+        return this.question;
+    }
+    
+    /**
+     * 
+     * @param question
+     */
+    public void setQuestion(String question)
+    {
+        this.question = question;
+    }
+        
+    /**
+     * @return Returns the activeDuration.
+     */
+    public int getActiveDuration() 
+    {
+        return activeDuration;
+    }
+    /**
+     * @param activeDuration The activeDuration to set.
+     */
+    public void setActiveDuration(int activeDuration) 
+    {
+        this.activeDuration = activeDuration;
+    }
+    
+    /**
+     * @return
+     */
+    public String getOption() 
+    {
+        return this.option;
+    }
+    
+    /**
+     * @param
+     */
+    public void setOption(String option) 
+    {
+        this.option = option;
+    }
+    
+    public String addOption () {
+        if (this.options==null) {
+            this.options = new TreeMap();
+        }
+        if(option!=null && option.trim().length()>0)
+        {
+            TreeMap map = (TreeMap)options;
+            if (map.isEmpty()) {
+                this.options.put("1",option);
+            } else {
+                this.options.put(Integer.toString(Integer.parseInt((String)map.lastKey())+1),option);
+            }
+        }
+        this.option=null;
+        return null;
+    }
+    
+    public Map getOptions()
+    {
+        if (this.options==null) {
+            this.options = new TreeMap();
+        }
+        return this.options;
+    }
+    
+    public void setOptions(Map options)
+    {
+        this.options=options;
+    }
+    
+    public Set getEntrySet() {
+        if (this.options==null) {
+            this.options = new TreeMap();
+        }
+        return this.options.entrySet();
+    }
+            
+    /**
+     * @return Returns the attachmentComment.
+     */
+    public String getAttachmentComment() 
+    {
+        return this.attachmentComment;
+    }
+    
+    /**
+     * @param attachmentComment The attachmentComment to set.
+     */
+    public void setAttachmentComment(String attachmentComment) 
+    {
+        this.attachmentComment = attachmentComment;
+    }
+        
+    /**
+     * @return Returns the attachment.
+     */
+    public UploadedFile getAttachment() 
+    {
+        return attachment;
+    }
+    
+    /**
+     * @param attachment The attachment to set.
+     */
+    public void setAttachment(UploadedFile attachment) 
+    {
+        this.attachment = attachment;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public Collection getAttachments()
+    {
+        return this.attachments;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public int getNumberOfAttachments()
+    {
+        int numberOfAttachments = 0;
+        
+        if(this.attachments!=null)
+        {
+            numberOfAttachments = this.attachments.size();
+        }
+        
+        return numberOfAttachments;
+    }
+    //-----navigation related data---------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public boolean isPreview()
+    {
+        return this.isPreview;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public boolean isPollPresent()
+    {
+        boolean isPollPresent = false;
+        
+        if(this.question!=null && this.question.trim().length()>0)
+        {
+            isPollPresent = true;
+        }
+        
+        return isPollPresent;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getForumId()
+    {
+        return this.forumId;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getTopicId()
+    {
+        return this.topicId;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getPostId()
+    {
+        return this.postId;
+    }
+    
+    //------------------------------------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     * since this controller is at session scope, must cleanup its state when not needed
+     * this will help optimize memory usage...
+     * puts the bean in an uninitialized state in that user's session
+     *
+     */
+    protected void cleanup()
+    {
+        //puts this controller in an cleaned up state for the next time it will be used in the session
+        this.subject = null;
+        this.message = null;
+        this.topicType = 0;
+        this.isPreview = false;
+        this.forumId = -1; 
+        this.topicId = -1;
+        this.postId = -1;
+        
+        //cleanup poll related data
+        this.question = null;
+        this.options = new TreeMap();
+        this.activeDuration = 0;
+        
+        //cleanup attachment related data
+        this.attachment = null;
+        this.attachmentComment = null;
+        this.attachments = new ArrayList();
+    }
+    
+    /**
+     * Takes a collection of tempFiles setup during data setup and produces attachments that are to be sent
+     * over to the module
+     * 
+     * @param tempFiles
+     * @return
+     */
+    protected Collection produceAttachments(Collection tempFiles)
+    {
+       Collection attachments = new ArrayList();
+       if(tempFiles!=null)
+       {
+           for(Iterator itr=tempFiles.iterator();itr.hasNext();)
+           {
+               TempFileBinding cour = (TempFileBinding)itr.next();
+               Attachment attachment = cour.produceAttachment();
+               if(cour.getFileId()!=null && cour.getFileId().trim().length()>0)
+               {
+                   try
+                   {
+                       //try to see if this fileId is the attachmentId in the database
+                       int attachmentId = Integer.parseInt(cour.getFileId());
+                       if(attachmentId!=-1)
+                       {
+                           ((AttachmentImpl)attachment).setId(new Integer(attachmentId));
+                       }
+                       else
+                       {
+                           ((AttachmentImpl)attachment).setId(null);
+                       }
+                   }
+                   catch(Exception e){/*if an error occurs here...no problem..this is not the attachmentId anyways*/
+                   ((AttachmentImpl)attachment).setId(null);}                   
+               }
+               attachments.add(attachment);
+           }
+       }
+       return attachments;
+    }
+    
+    /**
+     * sets the poll information of a post for the ui from the business object
+     *
+     */
+    protected void setupPoll(Poll poll)
+    {
+        if(poll!=null)
+        {
+	        this.question = poll.getTitle();
+	        this.activeDuration = poll.getLength();
+	        List pollOptions = poll.getOptions();
+	        if(pollOptions!=null && pollOptions.size()>0)
+	        {
+	            this.options = new TreeMap();
+                    int counter = 1;
+	            for(Iterator itr=pollOptions.iterator();itr.hasNext();)
+	            {
+	                PollOption cour = (PollOption)itr.next();
+	                this.options.put(Integer.toString(counter),cour.getQuestion());
+                        counter++;
+	            }
+	        }
+        }
+    }
+    
+    /**
+     * sets up the attachment information of a post for the ui from the business object
+     *
+     */
+    protected void setupAttachments(Collection attachments) throws Exception
+    {
+        if(attachments!=null)
+        {
+            this.attachments = new ArrayList();
+            for(Iterator itr=attachments.iterator();itr.hasNext();)
+            {
+                Attachment cour = (Attachment)itr.next();
+                TempFileBinding uiAttachment = new TempFileBinding(
+                    cour.getFile().getContentType(),    //contentType
+                    "".getBytes(),    //byte content....just use empty data...this object is for the ui and the actual
+                    //content of the attachment is not needed here
+                    cour.getFile().getName(),    //file name
+                    String.valueOf(System.currentTimeMillis()) + "_" + this.attachments.size() //unique fileId for this collection of files
+                );
+                uiAttachment.setComment(cour.getComment());
+                uiAttachment.setFileId(String.valueOf(cour.getId().intValue())); //this holds the information to actually identify the 
+                //attachment stored in the database
+                this.attachments.add(uiAttachment);
+            }
+        }
+    }
+    
+    //----------------------------------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public PostAction() 
+    { 
+        super();                 
+    }
+    
+    //----------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public abstract String start();
+                
+    //poll related operations--------------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     */
+    public String deleteOption()
+    {
+        String navState = null;
+        try
+        {
+            String optionIndex = ForumUtil.getParameter(Constants.p_option);
+            this.options.remove(optionIndex);
+            Iterator it = this.options.keySet().iterator();
+            Map temporary = new TreeMap();
+            byte counter = 1;
+            while (it.hasNext())
+            {
+                temporary.put(Byte.toString(counter++), this.options.get(it.next()));
+            }
+            this.options = temporary;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    public String updateOption()
+    {
+        String navState = null;
+        try
+        {
+            String optionIndex = ForumUtil.getParameter(Constants.p_option);
+            String value = ForumUtil.getParameter("post:option_"+optionIndex);
+            this.options.put(optionIndex,value);
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+    
+    public void validatePoll(Poll poll) throws PollValidationException
+    {
+        if (poll.getOptions().size() > 10)
+        {
+           throw new PollValidationException(PollValidationException.TOO_MANY_POLL_OPTION);
+        }
+        if (poll.getOptions().size() < 2)
+        {
+           throw new PollValidationException(PollValidationException.TOO_FEW_POLL_OPTION);
+        }
+        if (poll.getTitle()==null || poll.getTitle().trim().length()==0)
+        {
+           throw new PollValidationException(PollValidationException.INVALID_POLL_TITLE);
+        }    
+        for (Iterator i = poll.getOptions().iterator(); i.hasNext();)
+        {
+           PollOption option = (PollOption)i.next();
+           if (option.getQuestion()==null || option.getQuestion().trim().length()==0)
+           {
+              throw new PollValidationException(PollValidationException.INVALID_POLL_OPTION);
+           }
+        }
+    
+    }
+    
+    //-----------------message related------------------------------------------------------------------------------------------    
+    
+    public void validateMessage(Message message) throws MessageValidationException
+    {
+        String subject = message.getSubject();
+        if ( subject==null || subject.trim().length()==0 )
+        {
+           throw new MessageValidationException(MessageValidationException.INVALID_POST_SUBJECT);
+        }
+
+        String text = message.getText();
+        if ( text==null || text.trim().length()==0 )
+        {
+           throw new MessageValidationException(MessageValidationException.INVALID_POST_TEXT);
+        }
+    }
+    
+    //-----------------attachment related------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public String addAttachment()
+    {
+        String navState = null;
+        try
+        {
+           TempFileBinding file = null;
+            
+           if(!JSFUtil.isRunningInPortal() && this.attachment!=null)
+           {
+	            file = new TempFileBinding(
+	                    this.attachment.getContentType(),
+	                    this.attachment.getBytes(),
+	                    this.attachment.getName(),
+	            String.valueOf(System.currentTimeMillis()) + "_" + this.attachments.size() //unique fileId for this collection of files
+	            );
+           }
+           else
+           {
+               //grab this from the thread local
+               file = PortalUtil.getUploadedAttachment();
+           }
+           
+           if(file!=null)
+           {
+	           if(this.attachmentComment!=null)
+	           {
+	               file.setComment(this.attachmentComment);
+	           }
+	           file.setFileId("-1"); //identifies attachments from ui that are not stored in the database yet
+	           this.attachments.add(file);
+           }
+            
+            //clear out the attachment related view data
+            this.setAttachment(null);
+            this.setAttachmentComment(null);            
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+        
+    /**
+     * 
+     * @author sshah
+     */
+    public String deleteAttachment()
+    {
+        String navState = null;
+        try
+        {
+            int attachmentIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_attachment));
+            
+            ((ArrayList)this.attachments).remove(attachmentIndex);
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    } 
+    
+    /**
+     * 
+     * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+     */
+    public String updateAttachment() {
+        return null;
+    }
+    
+    
+    //------------preview-------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @return
+     */
+    public String preview()
+    {                
+       String navState = null;
+       try
+       {                      
+           this.isPreview = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       return navState;
+    }
+    
+    //---------------------------cancel-----------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public String cancel()
+    {
+        this.cleanup();
+        return Constants.CANCEL;
+    }
+    
+    //--------execute-------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @return
+     */
+    public abstract String execute(); 
+    
+    //utility methods-------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public Post getPost() throws Exception
+    {
+        Post post = null;
+        
+        post = this.getForumsModule().findPostById(new Integer(JSFUtil.getRequestParameter(Constants.p_postId)));
+        
+        return post;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/PreferenceController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,413 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.text.SimpleDateFormat;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Date;
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/*
+ * Created on May 24, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class PreferenceController extends ActionController 
+{
+    /**
+     * data associated with "notify on reply"
+     * the default value of this is setup using the managed-property value in the faces config file  
+     */
+    private boolean notifyOnReply = false;
+    
+    /**
+     * data associated with "always allow html"
+     * the default value of this is setup using the managed-property value in the faces config file
+     */
+    private boolean alwaysAllowHtml = false;
+    
+    /**
+     * data associated with "post order"
+     * the default value of this is setup using the managed-property value in the faces config file
+     */
+    private String postOrder = null;
+    
+    /**
+     * data associated with "date format"
+     * the default value of this is setup using the managed-property value in the faces config file
+     */
+    private String dateFormat = null;
+    
+    /**
+     * data associated with "always add signature"
+     * the default value of this is setup using the managed-property value in the faces config file
+     */
+    private boolean alwaysAddSignature = false;
+    
+    /**
+     * data associated with "signature"
+     */
+    private String signature = null;
+    
+    /**
+     * summary related preferences
+     */
+    private int    summaryMode = 0;
+    private int    summaryTopicLimit = 0;
+    private int	   summaryTopicDays = 0;
+    private int    summaryTopicReplies = 0;
+    
+    
+    /**
+     * topic related preferences
+     */    
+    private int postsPerTopic = 0;
+    
+    /**
+     * forum related preferences
+     *
+     */
+    private int topicsPerForum = 0; 
+    
+    /**
+     * business data
+     *
+     */
+    private Map defaultPreferences = null;
+    
+    //------accessors-------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public boolean isNotifyOnReply()
+    {
+        return this.notifyOnReply;
+    }
+    /**
+     * 
+     *
+     */
+    public void setNotifyOnReply(boolean notifyOnReply)
+    {
+        this.notifyOnReply = notifyOnReply;
+    }        
+    /**
+     * @return Returns the alwaysAllowHtml.
+     */
+    public boolean isAlwaysAllowHtml() 
+    {
+        return alwaysAllowHtml;
+    }
+    /**
+     * @param alwaysAllowHtml The alwaysAllowHtml to set.
+     */
+    public void setAlwaysAllowHtml(boolean alwaysAllowHtml) 
+    {
+        this.alwaysAllowHtml = alwaysAllowHtml;
+    }    
+    /**
+     * @return Returns the postOrder.
+     */
+    public String getPostOrder() 
+    {
+        return postOrder;
+    }
+    /**
+     * @param postOrder The postOrder to set.
+     */
+    public void setPostOrder(String postOrder) 
+    {
+        this.postOrder = postOrder;
+    }    
+    /**
+     * @return Returns the dateFormat.
+     */
+    public String getDateFormat() 
+    {
+        return dateFormat;
+    }
+    /**
+     * @param dateFormat The dateFormat to set.
+     */
+    public void setDateFormat(String dateFormat) 
+    {
+        try
+        {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
+            simpleDateFormat.format(new Date());
+        }
+        catch(Exception e)
+        {
+            this.dateFormat = this.getPreference(Constants.DATE_FORMAT_KEY);
+            return; //don't modify with the submitted dateFormat
+        }
+        
+        //if I get here, the input date format is fine
+        this.dateFormat = dateFormat;
+    }        
+    /**
+     * @return Returns the alwaysAddSignature.
+     */
+    public boolean isAlwaysAddSignature() 
+    {
+        return alwaysAddSignature;
+    }
+    /**
+     * @param alwaysAddSignature The alwaysAddSignature to set.
+     */
+    public void setAlwaysAddSignature(boolean alwaysAddSignature) 
+    {
+        this.alwaysAddSignature = alwaysAddSignature;
+    }    
+    /**
+     * @return Returns the signature.
+     */
+    public String getSignature() 
+    {
+        return signature;
+    }
+    /**
+     * @param signature The signature to set.
+     */
+    public void setSignature(String signature) 
+    {
+        this.signature = signature;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getSummaryMode()
+    {
+        return this.summaryMode;
+    }    
+    /**
+     * 
+     * @param summaryMode
+     */
+    public void setSummaryMode(int summaryMode)
+    {
+        this.summaryMode = summaryMode;                
+    }
+    /**
+     * 
+     *
+     */
+    public int getSummaryTopicLimit()
+    {
+        return this.summaryTopicLimit;
+    }
+    /**
+     * 
+     * @param summaryTopicLimit
+     */
+    public void setSummaryTopicLimit(int summaryTopicLimit)
+    {
+        this.summaryTopicLimit = summaryTopicLimit;                
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getSummaryTopicDays()
+    {
+        return this.summaryTopicDays;
+    }
+    /**
+     * 
+     * @param summaryTopicDays
+     */
+    public void setSummaryTopicDays(int summaryTopicDays)
+    {
+        this.summaryTopicDays = summaryTopicDays;                
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getSummaryTopicReplies()
+    {
+        return this.summaryTopicReplies;
+    }
+        
+    /**
+     * 
+     * @param summaryTopicReplies
+     */
+    public void setSummaryTopicReplies(int summaryTopicReplies)
+    {
+        this.summaryTopicReplies = summaryTopicReplies;                
+    }
+        
+    
+    
+    /**
+     * @return Returns the postsPerTopic.
+     */
+    public int getPostsPerTopic() 
+    {
+        return postsPerTopic;
+    }
+    /**
+     * @param postsPerTopic The postsPerTopic to set.
+     */
+    public void setPostsPerTopic(int postsPerTopic) 
+    {
+        this.postsPerTopic = postsPerTopic;                
+    }
+    /**
+     * @return Returns the topicsPerForum.
+     */
+    public int getTopicsPerForum() 
+    {
+        return topicsPerForum;
+    }
+    /**
+     * @param topicsPerForum The topicsPerForum to set.
+     */
+    public void setTopicsPerForum(int topicsPerForum) 
+    {
+        this.topicsPerForum = topicsPerForum;                
+    } 
+    
+    /**
+     * 
+     *
+     */
+    public Map getDefaultPreferences()
+    {
+        return this.defaultPreferences;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void setDefaultPreferences(Map defaultPreferences)
+    {
+        this.defaultPreferences = defaultPreferences;
+    }
+    //-------cleanup-------------------------------------------------------------------------------------------------------------------------------
+    public void cleanup()
+    {        
+    }
+    //---------------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     *
+     */
+    public PreferenceController()
+    {
+        super();
+    }
+    
+    /**
+     * 
+     *
+     */
+    public boolean isInitialized()
+    {
+       boolean initialized = true;
+       
+       this.notifyOnReply = Boolean.valueOf(this.getPreference(Constants.NOTIFY_REPLY_KEY)).booleanValue();
+       this.alwaysAllowHtml = Boolean.valueOf(this.getPreference(Constants.ALLOW_HTML_KEY)).booleanValue();
+       this.alwaysAddSignature = Boolean.valueOf(this.getPreference(Constants.ALWAYS_SIG_KEY)).booleanValue();
+       this.signature = this.getPreference(Constants.SIG_KEY);
+       this.dateFormat = this.getPreference(Constants.DATE_FORMAT_KEY);
+       this.postOrder = this.getPreference(Constants.POST_ORDER_KEY);
+       
+       this.summaryMode = Integer.parseInt(this.getPreference(Constants.SUMMARY_MODE_KEY));
+       this.summaryTopicDays = Integer.parseInt(this.getPreference(Constants.SUMMARY_DAYS_KEY));
+       this.summaryTopicLimit = Integer.parseInt(this.getPreference(Constants.SUMMARY_LIMIT_KEY));
+       this.summaryTopicReplies = Integer.parseInt(this.getPreference(Constants.SUMMARY_REPLIES_KEY));
+       
+       this.postsPerTopic = Integer.parseInt(this.getPreference(Constants.POSTS_TOPIC_KEY));
+       this.topicsPerForum = Integer.parseInt(this.getPreference(Constants.TOPICS_FORUM_KEY));
+       
+       return initialized;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String getPreference(String preferenceKey)
+    {
+        String preference = null;
+        
+        preference = (String)this.defaultPreferences.get(preferenceKey);
+        
+        //override the default preference with the logged in user's specified preference
+        String storedPreference = PortalUtil.getPreference(preferenceKey);
+        if(storedPreference!=null && storedPreference.trim().length()>0)
+        {
+            preference = storedPreference;
+        }
+        
+        return preference;
+    }
+    
+    //----------action-----------------------------------------------------------------------------------------------------------------------------
+    public String execute()
+    {
+        String navState = null;
+        try
+        {
+            Map updated = new HashMap();
+            
+            updated.put(Constants.NOTIFY_REPLY_KEY,String.valueOf(this.notifyOnReply));
+            updated.put(Constants.ALLOW_HTML_KEY,String.valueOf(this.alwaysAllowHtml));
+            updated.put(Constants.ALWAYS_SIG_KEY,String.valueOf(this.alwaysAddSignature));
+            updated.put(Constants.SIG_KEY,this.signature);
+            updated.put(Constants.POST_ORDER_KEY,this.postOrder);
+            updated.put(Constants.DATE_FORMAT_KEY,this.dateFormat);
+            updated.put(Constants.SUMMARY_MODE_KEY,String.valueOf(this.summaryMode));
+            updated.put(Constants.SUMMARY_LIMIT_KEY,String.valueOf(this.summaryTopicLimit));
+            updated.put(Constants.SUMMARY_DAYS_KEY,String.valueOf(this.summaryTopicDays));
+            updated.put(Constants.SUMMARY_REPLIES_KEY,String.valueOf(this.summaryTopicReplies));
+            updated.put(Constants.POSTS_TOPIC_KEY,String.valueOf(this.postsPerTopic));
+            updated.put(Constants.TOPICS_FORUM_KEY,String.valueOf(this.topicsPerForum));
+            
+            PortalUtil.setPreferences(updated);
+            
+            //check if this is running as a stanalone app...if thats the case navigate to the proper location
+            if(!JSFUtil.isRunningInPortal())
+            {
+                //
+                navState = Constants.SUCCESS;
+            }
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return navState;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/ReplyTopic.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,279 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.Date;
+import java.util.List;
+
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Post;
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class ReplyTopic extends PostAction
+{
+    
+    // Variable describing whether bean was initialized.
+    private boolean initialized;
+    
+    //----------------------------------------------------------------------------------------------------------------------------------------    
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public ReplyTopic() 
+    { 
+        super();                 
+    }    
+    //----------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public String start()
+    {
+        String navState = null;
+        this.initialized=false;
+        try
+        {
+	        int forumId = -1;
+	        int topicId = -1;
+            int postId = -1;
+	        String f = ForumUtil.getParameter(Constants.p_forumId);
+	        String t = ForumUtil.getParameter(Constants.p_topicId);
+            String p = ForumUtil.getParameter(Constants.p_postId);
+	        if(f!=null && f.trim().length()>0)
+	        {
+	            forumId = Integer.parseInt(f);
+	        }
+	        if(t!=null && t.trim().length()>0)
+	        {
+	            topicId = Integer.parseInt(t);
+	        }
+            if(p!=null && p.trim().length()>0)
+            {
+                postId = Integer.parseInt(p);
+            }
+            
+            Topic topic = null;
+            
+            if (topicId==-1 && postId!=-1) {
+                // If topicId was not given and postId is available we get topicId from Post
+                Post post = getForumsModule().findPostById(new Integer(postId));
+                if (post!=null) {
+                    topic = post.getTopic();
+                    topicId = topic.getId().intValue();
+                }
+            } else {
+                topic = getForumsModule().findTopicById(new Integer(topicId));
+            }
+            
+            if (forumId==-1 && topic!=null) {
+                forumId = topic.getForum().getId().intValue();
+            }
+            
+            //re-initialize this controller to add a reply post in a topic
+            //to the specified forum
+            this.cleanup();
+            
+            //set the selected forum's id and topic's id
+            this.forumId = forumId;	 
+            this.topicId = topicId;
+            
+            //set the subject information
+            this.subject = "Re: " + topic.getSubject();
+            
+	        navState = Constants.START_REPLY;
+            
+            this.initialized = true;
+            
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        } 
+        return navState;
+    }  
+    
+    /**
+     * 
+     *
+     */
+    public String startQuote()
+    {
+        String navState = this.start();        
+        try
+        {	        
+	        String p = ForumUtil.getParameter(Constants.p_postId);	        
+	        if(p!=null && p.trim().length()>0)
+	        {
+	            postId = Integer.parseInt(p);
+	        }
+	        
+	        //setup the quote information	        
+	        Post post = this.getForumsModule().findPostById(new Integer(postId));
+	        Poster poster = PortalUtil.getPoster();
+	        this.message = "["+Constants.QUOTE+"="+poster.getUser().getUserName()+"]"+post.getMessage().getText()+"[/"+Constants.QUOTE+"]";
+        }
+        catch(Exception e)
+        {
+           JSFUtil.handleException(e); 
+        }        
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String startInstantReplyPreview()
+    {
+        String navState = null;
+        String message = this.getMessage();
+        navState = this.start();
+        this.setMessage(message);
+        this.preview();        
+        return navState;
+    }
+    
+    public boolean isInitialized() {
+        
+        // Lets try to initialize maybe the view was executed from permament link.
+        if (this.initialized==false) {
+            this.start();
+        }
+        
+        return this.initialized;
+    }
+    
+    //--------execute-------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @return
+     */
+    public String execute()
+    {
+       String navState = null;
+       boolean success = false;
+       try
+       { 
+           Message message = PortalUtil.createMessage();
+           message.setText(this.message);
+           message.setSubject(this.subject);
+           
+           //setup the forum and the corresponding poster
+           Forum forum = BaseController.getForumsModule().findForumById(new Integer(this.forumId));
+           Topic topic = BaseController.getForumsModule().findTopicById(new Integer(topicId));
+           Poster poster = PortalUtil.getPoster();
+           
+           //make sure this topic is not locked
+           if(topic.getStatus()==Constants.TOPIC_LOCKED)
+           {
+               //should not allow posting a reply since the topic is locked
+               throw new Exception(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME,Constants.TOPIC_LOCKED_ERR_KEY));
+           }
+           
+           //actually post a reply to this topic in the forum
+           Post post = BaseController.getForumsModule().createPost(topic,
+	           forum,
+	           message,
+	           new Date(),
+	           poster,
+	           (List)this.produceAttachments(this.attachments) //attachments
+           );           
+           poster.incrementPostCount();
+           
+                                            
+           //setup the navigation state           
+           navState = Constants.SUCCESS;
+           
+           success = true;
+       }
+       catch (MessageValidationException e) 
+       {
+           //handle proper validation error with a proper message...not just a generic message..
+           //just use generic error page for the proof of concept
+           //set the custom exception such that e.toString() results in the proper message
+           JSFUtil.handleException(e);
+       }
+       catch(PollValidationException e)
+       {
+           //handle proper validation error with a proper message...not just a generic message..
+           //just use generic error page for the proof of concept
+           //set the custom exception such that e.toString() results in the proper message
+           JSFUtil.handleException(e);
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       finally
+       {
+           //cleanup if necessary
+           if(success)
+           {
+               this.cleanup();
+               this.initialized=false;
+           }
+       }
+       return navState;
+    } 
+    
+    /**
+     * 
+     *
+     */
+    public String executeInstantReply()
+    {
+        String navState = null;
+        
+        //setup the instantReply message
+        String message = this.getMessage();
+        this.start();
+        this.setMessage(message);
+        
+        //make the actual post
+        this.execute();
+                
+        //setup proper navigation
+        navState = "instantReply";
+        
+        return navState;
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.search.SearchCriteria;
+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;
+
+public class Search extends ActionController {
+
+    private static final long serialVersionUID = 1L;
+    
+    private SearchCriteria searchCriteria = new SearchCriteria();
+
+    public SearchCriteria getSearchCriteria()
+    {
+        return searchCriteria;
+    }
+
+    public void setSearchCriteria(SearchCriteria searchCriteria)
+    {
+        this.searchCriteria = searchCriteria;
+    }
+
+    public boolean isInitialized()
+    {
+        boolean initialized = false;
+        
+        try
+        { 
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        return initialized;
+    }
+    
+	@SuppressWarnings("unchecked")
+    public Collection<SelectItem> getCategoriesItems()
+    {
+        Collection<SelectItem> categories = new ArrayList<SelectItem>();
+        
+        categories.add(new SelectItem("", "Search All Categories"));
+        
+        try {
+        	
+	        // Luca Stancapiano start
+	        //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+	        
+            List<Category> c = BaseController.getForumsModule().findCategories(forumInstanceId);
+            
+            if (c != null) {
+                for (Category category : c) {
+                    categories.add(new SelectItem(category.getId().toString(), category.getTitle()));
+                }
+            }
+            
+        } catch (Exception e) {
+            JSFUtil.handleException(e);
+        }
+        
+        return categories;
+    }
+    
+	@SuppressWarnings("unchecked")
+    public Collection<SelectItem> getForumsItems()
+    {
+        Collection<SelectItem> forums = new ArrayList<SelectItem>();
+        
+        forums.add(new SelectItem("", "Search All Forums"));
+        
+        try {
+	        // Luca Stancapiano start
+	        //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+	        
+            List<Forum> f = BaseController.getForumsModule().findForums(forumInstanceId);
+            
+            if (f != null) {
+                for (Forum forum : f) {
+                    forums.add(new SelectItem(forum.getId().toString(), forum.getName()));
+                }
+            }
+
+        } catch (Exception e) {
+            JSFUtil.handleException(e);
+        }
+        
+        return forums;
+    }
+	
+	public String search()
+	{
+		return "success";
+	}
+	
+    private void execute() throws Exception
+    {
+        searchCriteria = new SearchCriteria();
+    }
+
+}
+
+
+
+  
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,360 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import java.util.ResourceBundle;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/**
+ * SplitTopic is a bean which keeps data and has actions needed to achieve
+ * spltting topic into two separate topics.
+ *
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class SplitTopic extends BaseController {
+
+    // Title for newly created topic
+    private String newTopicTitle;
+    
+    // Map containing Integer:Boolean pairs with TopicId:IsSelected states
+    private Map checkboxes;
+    
+    // Topic to split
+    private Topic topic;
+
+    // ---------- Getters And Setters for bean's attributes --------------------
+    
+    public void setNewTopicTitle(String newTopicTitle) {
+        this.newTopicTitle = newTopicTitle;
+    }
+
+    public String getNewTopicTitle() {
+        return newTopicTitle;
+    }
+    
+    public void setCheckboxes(Map checkboxes)
+    {
+        this.checkboxes = checkboxes;
+    }
+
+    public Map getCheckboxes()
+    {
+        return checkboxes;
+    }
+    
+    public Topic getTopic() {
+        return topic;
+    }
+    
+    // ---------- UI Actions supported by this bean ----------------------------
+    
+    /**
+     * This user interface action is spliting topic after post selected by user.
+     *
+     * @return
+     */
+    public String splitAfter () {
+    
+        // Temporary variable for bunlde message
+        String message = "";
+        
+        // Removing all not slected posts
+        Iterator selectIt = checkboxes.keySet().iterator();
+        while (selectIt.hasNext()) {
+            Boolean postFlag = (Boolean)checkboxes.get(selectIt.next());
+            if (!postFlag.booleanValue()) {
+                selectIt.remove();
+            }
+        }
+        
+        // Checking whether topic has only one post, so it can't be splitted
+        if (topic.getPosts().size()==1) {
+            setWarnBundleMessage("ERR_SPLIT_ONE_POST_TOPIC");
+            return "";
+        }
+        
+        // Checking if user selected anything.
+        if (checkboxes.size()==0) {
+            setWarnBundleMessage("ERR_NO_POST_SELECTED");
+            return "";
+        }
+        
+        // User can't select more than one post for this action.
+        if (checkboxes.size()!=1) {
+            setWarnBundleMessage("Too_many_error");
+            return "";
+        }
+        
+        //check if user selected first post
+        if (topic.getFirstPost().getId().equals((Integer)(checkboxes.keySet().iterator().next()))) {
+            setWarnBundleMessage("ERR_SPLIT_ALL");            
+            return "";
+        }
+        
+        // Trying to get destination forum for new topic.
+        String toForumId = ForumUtil.getParameter(Constants.p_forum_to_id);
+        if (toForumId == null || 
+            toForumId.trim().compareToIgnoreCase("-1")==0 || 
+            toForumId.trim().length()==0) {
+            setWarnBundleMessage("ERR_DEST_FORUM");
+            return "";
+        }
+        
+        // Checking if user gave subject for new topic.
+        if (newTopicTitle == null || 
+            newTopicTitle.trim().compareToIgnoreCase("-1")==0 || 
+            newTopicTitle.trim().length()==0) {
+            setWarnBundleMessage("ERR_NO_SUBJECT_GIVEN");
+            return "";
+        }
+        
+        try {
+            
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().refresh(this.topic);
+            
+            Forum destForum = getForumsModule().findForumById(new Integer(toForumId));
+            
+            // Creating new topic in destination forum.
+            Topic newTopic = getForumsModule().createTopic(destForum,
+                                    PortalUtil.getUser().getId().toString(),
+                                    newTopicTitle, topic.getType());
+                                    
+            // Getting post id after which the topic must be splitted.
+            Integer selectedPostId = (Integer)checkboxes.keySet().iterator().next();
+            
+            // Searching for the split pointing post in topic.
+            Iterator it = topic.getPosts().iterator();
+            Post tempPost = null;
+            while( it.hasNext() )
+            {
+                tempPost = (Post)it.next();
+                // searching for post to split after
+                if (tempPost.getId().equals(selectedPostId))
+                {
+                   break;
+                }
+            }
+            
+            // Adding splitting post and all which are after him to new topic.
+            if (tempPost != null)
+            {
+               newTopic.addPost(tempPost);
+            }
+            while (it.hasNext())
+            {
+               newTopic.addPost((Post)it.next());
+            }
+            
+            newTopic.setReplies(newTopic.getPosts().size()-1);
+            newTopic.setLastPostDate(newTopic.getLastPost().getCreateDate());
+            
+            Forum fromForum = topic.getForum();
+            topic.setReplies(topic.getReplies()-newTopic.getReplies()-1);
+            fromForum.setPostCount(fromForum.getPostCount()-newTopic.getReplies()-1);
+            topic.setLastPostDate(topic.getLastPost().getCreateDate());
+
+            destForum.addTopicSize();
+            destForum.setPostCount(destForum.getPostCount()+newTopic.getReplies()+1);
+
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+            setWarnBundleMessage("ERR_INTERNAL");
+            return "";
+        }
+        
+        // Setting message that everything went smooth.
+        setInfoBundleMessage("SUCC_TOPIC_SPLITTED");
+        return "splitted";
+    }
+    
+    /**
+     * This user interface action is spliting topic bh=y moving all selected
+     * by user posts into newly created topic.
+     *
+     * @return
+     */
+    public String splitPosts () {
+    
+        // Temporary variable for bunlde message
+        String message = "";
+        
+        // Removing all not slected posts
+        Iterator selectIt = checkboxes.keySet().iterator();
+        while (selectIt.hasNext()) {
+            Boolean postFlag = (Boolean)checkboxes.get(selectIt.next());
+            if (!postFlag.booleanValue()) {
+                selectIt.remove();
+            }
+        }
+        
+        // Checking whether topic has only one post, so it can't be splitted
+        if (topic.getPosts().size()==1) {
+            setWarnBundleMessage("ERR_SPLIT_ONE_POST_TOPIC");
+            return "";
+        }
+        
+        // Checking if user selected anything.
+        if (checkboxes.size()==0) {
+            setWarnBundleMessage("ERR_NO_POST_SELECTED");
+            return "";
+        }
+        
+        // Checking if user didn't select all posts.
+        if (checkboxes.size()==topic.getPosts().size()) {
+            setWarnBundleMessage("ERR_SPLIT_ALL");         
+            return "";
+        }
+ 
+        // Trying to get destination forum for new topic.
+        String toForumId = ForumUtil.getParameter(Constants.p_forum_to_id);
+        if (toForumId == null || 
+            toForumId.trim().compareToIgnoreCase("-1")==0 || 
+            toForumId.trim().length()==0) {
+            setWarnBundleMessage("ERR_DEST_FORUM");     
+            return "";
+        }
+        
+        // Checking if user gave subject for new topic.
+        if (newTopicTitle == null || 
+            newTopicTitle.trim().compareToIgnoreCase("-1")==0 || 
+            newTopicTitle.trim().length()==0) {
+            setWarnBundleMessage("ERR_NO_SUBJECT_GIVEN");
+            return "";
+        }
+        try {
+            
+            Forum destForum = getForumsModule().findForumById(new Integer(toForumId));
+            
+            // Creating new topic in selected destination forum.
+            Topic newTopic = getForumsModule().createTopic(destForum,
+                                    PortalUtil.getUser().getId().toString(),
+                                    newTopicTitle, topic.getType());
+                                    
+            // Moving all selected posts to new topic.
+            selectIt = checkboxes.keySet().iterator();
+            Post movedPost=null;
+            while (selectIt.hasNext()) {
+                movedPost = getForumsModule().findPostById((Integer)selectIt.next());
+                newTopic.addPost(movedPost);
+            }
+            
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().refresh(this.topic);
+            
+            Forum fromForum = topic.getForum();
+            topic.setReplies(topic.getReplies()-checkboxes.size());
+            fromForum.setPostCount(fromForum.getPostCount()-checkboxes.size());
+            topic.setLastPostDate(topic.getLastPost().getCreateDate());
+            
+            newTopic.setReplies(checkboxes.size()-1);
+            newTopic.setLastPostDate(newTopic.getLastPost().getCreateDate());
+            
+            destForum.addTopicSize();
+            destForum.setPostCount(destForum.getPostCount()+newTopic.getReplies()+1);
+            
+            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+            setWarnBundleMessage("ERR_INTERNAL");
+            return "";
+        }
+        
+        // Setting message that everything went smooth.
+        setInfoBundleMessage("SUCC_TOPIC_SPLITTED");
+        return "splitted";
+    }
+    
+    // ---------- Initializing -------------------------------------------------
+    
+    /**
+     * Called at every page refresh, manages bean's initialization.
+     */
+    public boolean isInitialized()
+    {
+       boolean initialized = false;
+       try
+       { 
+           this.execute();
+           initialized = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       return initialized;
+    }
+    
+    /**
+     * Bean's attributes initialization.
+     *
+     * @throws Exception
+     */
+    private void execute() throws Exception
+    {    
+        //parse input data
+        int topicId = -1;
+        String t = ForumUtil.getParameter(Constants.p_topicId);
+        String page = ForumUtil.getParameter(Constants.p_page);
+        if (t != null && t.trim().length() > 0) {
+            topicId = Integer.parseInt(t);
+        }
+
+        //process the topic information
+        if (topicId != -1) {
+            this.topic = BaseController.getForumsModule().findTopicById(new Integer(topicId));
+        }
+        if (checkboxes==null || checkboxes.size()!=topic.getPosts().size()) {
+            checkboxes = new HashMap();
+        }
+    }
+    
+    private void setWarnBundleMessage(String bundleKey) {
+        String message = JSFUtil.getBundleMessage("ResourceJSF",bundleKey);
+        FacesContext.getCurrentInstance().addMessage("message",
+        new FacesMessage(FacesMessage.SEVERITY_WARN,message, "moderate"));
+    }
+    
+    private void setInfoBundleMessage(String bundleKey) {
+        String message = JSFUtil.getBundleMessage("ResourceJSF",bundleKey);
+        FacesContext.getCurrentInstance().addMessage("message",
+        new FacesMessage(FacesMessage.SEVERITY_INFO,message, "moderate"));
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/TopicWatchController.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/TopicWatchController.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/TopicWatchController.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,287 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action;
+
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.TopicWatch;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/**
+ * This controller is used for activating/deactivating topic watches
+ * 
+ * Created on Jul 7, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class TopicWatchController extends ActionController 
+{
+    
+    private int topicId ;
+    private int watchType ;
+    private boolean editMode;
+    private Topic topic;
+    
+    /**
+     * 
+     */
+    public int getWatchType()
+    {
+        return watchType;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchType(int watchType)
+    {
+        this.watchType = watchType;
+    }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return "success";
+    }
+    
+    /**
+     * 
+     */
+    public int getTopicId()
+    {
+        return topicId;
+    }
+    
+    /**
+     * 
+     */
+    public void setTopicId(int topicId)
+    {
+        this.topicId = topicId;
+    }
+    
+    /**
+     * 
+     */
+    public Topic getTopic()
+    {
+        return this.topic;
+    }
+    
+    /**
+     * 
+     */
+    public void setTopic(Topic topic)
+    {
+        this.topic = topic;
+    }
+    
+    /**
+     * 
+     */
+    public void setEditMode(boolean editMode)
+    {
+        this.editMode = editMode;
+    }
+    
+    /**
+     * 
+     */
+    public boolean getEditMode()
+    {
+        return this.editMode;
+    }
+
+    /**
+     * 
+     *
+     */
+    public TopicWatchController()
+    {
+        try
+        {
+            String t = JSFUtil.getRequestParameter(Constants.p_topicId);
+            if (t!=null && t.trim().length()>0) {
+                topicId = Integer.parseInt(t);
+            } else {
+                topicId = -1;
+            }
+        } catch (NumberFormatException e)
+        {
+            JSFUtil.handleException(e);
+            topicId = -1;
+        }
+        
+        if (topicId!=-1)
+        {
+            try
+            {
+                this.topic = getForumsModule().findTopicById(new Integer(this.topicId));
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+                this.topic = null;
+            }
+        }
+        
+        try
+        {
+            String wt = JSFUtil.getRequestParameter(Constants.p_notified_watch_type);
+            if (wt!=null && wt.trim().length()>0) {
+                watchType = Integer.parseInt(wt);
+            } else {
+                watchType = -1;
+            }
+        } catch (NumberFormatException e)
+        {
+            JSFUtil.handleException(e);
+            watchType = -1;
+        }
+        
+        String edit = JSFUtil.getRequestParameter(Constants.EDIT_WATCH);
+        if (edit!=null && edit.trim().length()>0) {
+            editMode = Boolean.valueOf(edit).booleanValue();
+        } else {
+            editMode = false;
+        }
+        
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String activateWatch()
+    {
+        String navState = null;
+        
+        try
+        {
+            
+            // checking for needed parameters
+            if (this.topicId == -1 || this.watchType==-1)
+            {
+                return navState;
+            }
+            
+            //make sure a watch for this topic is not already issued for this user
+            boolean isDuplicate = this.isWatched();
+            if(isDuplicate)
+            {
+                return navState;
+            }
+            
+            //get the topic that must be activated for watching
+            Topic topic = getForumsModule().findTopicById(new Integer(topicId));
+                        
+            
+            //activate the watch for the selected topic
+            getForumsModule().createWatch(PortalUtil.getPoster(),topic,this.watchType);
+            navState="success";
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        return navState;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public String deActivateWatch()
+    {
+        String navState = null;
+        
+        try
+        {
+            
+            TopicWatch watch = getForumsModule().findTopicWatchByUserAndTopic(PortalUtil.getUser(),topicId);
+        
+            getForumsModule().removeWatch(watch);
+            
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        return navState;
+    }
+    
+    /**
+     * 
+     */
+    public String updateNotificationType()
+    {
+        String navState = null;
+        if (watchType==-1 || topicId==-1)
+        {
+            return navState;
+        }
+        
+        try
+        {
+            TopicWatch topicWatch = getForumsModule().findTopicWatchByUserAndTopic(PortalUtil.getUser(),this.topicId);
+            topicWatch.setMode(watchType);
+            navState="success";
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        topicId=-1;
+        return navState;
+    }
+    
+    /**
+     * When user cancels creating topic notification then this action is executed.
+     */
+    public String cancel()
+    {
+        return "cancel";
+    }
+    
+    public boolean isWatched()
+    {
+        TopicWatch topicWatch = null;
+        
+        try
+        {
+         
+            topicWatch = getForumsModule().findTopicWatchByUserAndTopic(PortalUtil.getUser(),this.topicId);
+            
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        
+        return topicWatch!=null;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollDurationConverter.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollDurationConverter.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollDurationConverter.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.converters;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.action.validators.ValidatorMessages;
+
+/**
+ * This is a special JSF converter for poll duration time.
+ * It's more or less String - Integer converter but with the option that empty String equals to 0.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class PollDurationConverter implements Converter
+{
+
+    public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException
+    {
+        
+        if (value==null || value.trim().length()==0)
+        {
+            return new Integer(0);
+        }
+        else
+        {
+            try
+            {
+                int duration = Integer.parseInt(value);
+                return new Integer(duration);
+            }
+            catch (NumberFormatException e)
+            {
+                FacesMessage message = new FacesMessage();
+                message.setDetail(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, ValidatorMessages.POLL_DURATION_MSG));
+                message.setSummary(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, ValidatorMessages.POLL_DURATION_MSG));
+                message.setSeverity(FacesMessage.SEVERITY_ERROR);
+                throw new ConverterException(message);
+            }
+        }
+    }
+
+    public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException
+    {
+        if (value==null)
+        {
+            return "0";
+        }
+        return value.toString();
+    }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/LengthValidator.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/LengthValidator.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/LengthValidator.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.validators;
+
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+
+/**
+ * Abstract class for defining validators that check length of user input in a JSF UIComponent.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+abstract class LengthValidator implements Validator
+{
+    
+    public LengthValidator()
+    { 
+        super();
+    }
+
+    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+    {
+        
+        // A check whether it is post submition or preview action. If not validators are not executed.
+        FacesContext fc = FacesContext.getCurrentInstance();
+        Map reqParams = fc.getExternalContext().getRequestParameterMap();
+        if ( ! (reqParams.keySet().contains("post:Preview") || reqParams.keySet().contains("post:Submit")) )
+        {
+            return;
+        }
+        
+        UIComponent formComp = component.getParent();
+        UIComponent validatedComp = getComponentToValidation(formComp);
+        
+        if (validatedComp.getAttributes().get("value")==null
+                || validatedComp.getAttributes().get("value").toString().trim().length()<1)
+        {
+            FacesMessage message = new FacesMessage();
+            message.setDetail(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, getMessage()));
+            message.setSummary(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, getMessage()));
+            message.setSeverity(FacesMessage.SEVERITY_ERROR);
+            throw new ValidatorException(message);
+        }
+    }
+    
+    protected abstract String getMessage ();
+    
+    protected abstract UIComponent getComponentToValidation(UIComponent parentComponent);
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/MessageLengthValidator.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/MessageLengthValidator.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/MessageLengthValidator.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.validators;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Validator class for validating a length of user input in post message.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class MessageLengthValidator extends LengthValidator
+{
+    
+    protected String getMessage ()
+    {
+        return ValidatorMessages.MESSAGE_LENGTH_ERROR;
+    }
+    
+    protected UIComponent getComponentToValidation(UIComponent parentComponent)
+    {
+        return parentComponent.findComponent("message");
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/PollValidator.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/PollValidator.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/PollValidator.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.validators;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+
+/**
+ * PollValidator is a class that implements JSF Validator interface
+ * and is used for validating a forum poll.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class PollValidator implements Validator
+{
+
+    public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+    {
+        
+        // A check whether it is post submition action. If not validators are not executed.
+        FacesContext fc = FacesContext.getCurrentInstance();
+        Map reqParams = fc.getExternalContext().getRequestParameterMap();
+        if (!reqParams.keySet().contains("post:Submit"))
+        {
+            return;
+        }
+        
+        // Collecting all poll data from the form.
+        UIComponent formComp = component.getParent();
+        UIComponent questionComp = formComp.findComponent("question");
+        UIComponent pollDurationComp = formComp.findComponent("pollDuration");
+        List options  = new ArrayList();
+        for (int i=1 ; ; i++ )
+        {
+            UIComponent temp = formComp.findComponent("option_"+Integer.toString(i));
+            if (temp!=null)
+            {
+                options.add(temp);
+            }
+            else
+            {
+                break;
+            }
+        }
+        
+        // If there are no question or options provided by the user, we don't validate. 
+        if (  !( (questionComp.getAttributes().get("value")!=null 
+                     && questionComp.getAttributes().get("value").toString().trim().length()!=0)
+                  || (options.size()>0) ) )
+        {
+            return;
+        }
+        
+        // Checks
+        if (options.size() > 10)
+        {
+            throwValidationException(ValidatorMessages.TOO_MANY_OPTIONS_MSG);
+        }
+        if (options.size() < 2)
+        {
+            throwValidationException(ValidatorMessages.TOO_FEW_OPTIONS_MSG);
+        }
+        if (questionComp.getAttributes().get("value")==null
+                || questionComp.getAttributes().get("value").toString().trim().length()==0)
+        {
+            throwValidationException(ValidatorMessages.EMPTY_POLL_QUESTION_MSG);
+        }
+        for (Iterator it = options.iterator(); it.hasNext();)
+        {
+           UIComponent option = (UIComponent)it.next();
+           if (option.getAttributes().get("value")==null
+                   || option.getAttributes().get("value").toString().trim().length()==0)
+           {
+               throwValidationException(ValidatorMessages.EMPTY_POLL_OPTION_MSG);
+           }
+        }
+        
+        int duration = 0;
+        if (pollDurationComp.getAttributes().get("value")!=null
+                && pollDurationComp.getAttributes().get("value").toString().trim().length()!=0)
+        {
+            try
+            {
+                duration = Integer.parseInt(pollDurationComp.getAttributes().get("value").toString());
+            }
+            catch (NumberFormatException e)
+            {
+                throwValidationException(ValidatorMessages.POLL_DURATION_MSG);
+            }
+            if (duration<0)
+            {
+                throwValidationException(ValidatorMessages.POLL_DURATION_MSG);
+            }
+        }
+    }
+    
+    private void throwValidationException ( String exceptionMsg ) throws ValidatorException
+    {
+        FacesMessage message = new FacesMessage();
+        message.setDetail(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, exceptionMsg));
+        message.setSummary(JSFUtil.getBundleMessage(Constants.BUNDLE_NAME, exceptionMsg));
+        message.setSeverity(FacesMessage.SEVERITY_ERROR);
+        throw new ValidatorException(message);
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/SubjectLengthValidator.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/SubjectLengthValidator.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/SubjectLengthValidator.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.validators;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Validator class for validating a length of user input in post subject.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class SubjectLengthValidator extends LengthValidator
+{
+    
+    protected String getMessage()
+    {
+        return ValidatorMessages.SUBJECT_LENGTH_ERROR;
+    }
+    
+    protected UIComponent getComponentToValidation(UIComponent parentComponent)
+    {
+        return parentComponent.findComponent("SubjectInputText");
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/ValidatorMessages.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/ValidatorMessages.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/action/validators/ValidatorMessages.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.action.validators;
+
+/**
+ * This class contains constants with message bundle keys that contain error messages.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+final public class ValidatorMessages
+{
+    
+    // Messages connected with input length errors.
+    public static final String SUBJECT_LENGTH_ERROR = "Empty_subject";
+    public static final String MESSAGE_LENGTH_ERROR = "Empty_message";
+    
+    // Poll oriented messages.
+    public static final String EMPTY_POLL_QUESTION_MSG = "Empty_poll_title";
+    public static final String EMPTY_POLL_OPTION_MSG = "Empty_poll_option";
+    public static final String TOO_FEW_OPTIONS_MSG = "To_few_poll_options";
+    public static final String TOO_MANY_OPTIONS_MSG = "To_many_poll_options";
+    public static final String POLL_DURATION_MSG = "Wrong_poll_duration";
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/BeginTransactionListener.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.event;
+
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+//transaction related
+import javax.naming.InitialContext;
+import javax.transaction.UserTransaction;
+
+//
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/*
+ * Created on May 17, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class BeginTransactionListener implements PhaseListener
+{
+    /**
+     * The JNDI context.
+     */
+    private InitialContext ctx = null;
+        
+    private static final String USER_TRANSACTION_JNDI="java:comp/UserTransaction";
+        
+    /**
+     * 
+     */
+    public BeginTransactionListener() throws Exception
+    {
+        this.ctx = new InitialContext();
+    }
+    
+    /* 
+     * 
+     */
+    public PhaseId getPhaseId() 
+    {        
+        return PhaseId.RESTORE_VIEW;
+    }
+    
+    /* 
+     * 
+     */
+    public void beforePhase(PhaseEvent phaseEvent) 
+    {
+        //check if the application is running in a portal
+        if(PortalUtil.isRunningInPortal())
+        {
+            //no need....use the portal's transaction context
+            return;
+        }
+        
+        //handle transactions in a non-portal environment
+        try
+        {
+           UserTransaction tx = (UserTransaction) ctx.lookup(USER_TRANSACTION_JNDI);
+           if (tx.getStatus()!=javax.transaction.Status.STATUS_ACTIVE)
+           {
+               tx.begin();
+           }
+        }
+        catch (Throwable t)
+        {
+           throw new RuntimeException(t);
+        }        
+    }
+    
+    /* 
+     * 
+     */
+    public void afterPhase(PhaseEvent phaseEvent) 
+    {
+        //leave this empty...nothing to do here       
+    }         
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/EndTransactionListener.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.event;
+
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+//transaction related
+import javax.naming.InitialContext;
+import javax.transaction.UserTransaction;
+
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+/*
+ * Created on May 17, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class EndTransactionListener implements PhaseListener
+{
+    /**
+     * The JNDI context.
+     */
+    private InitialContext ctx = null;
+    
+    private static final String USER_TRANSACTION_JNDI="java:comp/UserTransaction";
+    
+    /**
+     * 
+     */
+    public EndTransactionListener() throws Exception
+    {
+        this.ctx = new InitialContext();
+    }
+    
+    /* 
+     * 
+     */
+    public PhaseId getPhaseId() 
+    {        
+        return PhaseId.RENDER_RESPONSE;
+    }
+    
+    /* 
+     * 
+     */
+    public void beforePhase(PhaseEvent phaseEvent) 
+    {                        
+        //leave this empty, nothing to do here.......        
+    }
+    
+    /* 
+     * 
+     */
+    public void afterPhase(PhaseEvent phaseEvent) 
+    {
+        UserTransaction tx = null;
+        boolean rollback = false;
+        
+        //check if the application is running in a portal
+        if(PortalUtil.isRunningInPortal())
+        {
+            //no need....use the portal's transaction context
+            if(JSFUtil.isErrorOccurred())
+            {
+                try
+                {
+	                tx = (UserTransaction) ctx.lookup(USER_TRANSACTION_JNDI);
+	                tx.setRollbackOnly();	                
+                }
+                catch(Throwable t)
+                {                    
+                    //dont worry....this accomplishes killing the transaction
+                    //when an application error occurs
+                }
+            }            
+            return;
+        }        
+        
+        //handle transactions in a non-portal environment        
+        try
+        {        
+            tx = (UserTransaction) ctx.lookup(USER_TRANSACTION_JNDI);
+	        //check if an error occurred and transaction should be rolled back
+	        if(JSFUtil.isErrorOccurred())
+	        {
+	            //this means an error occurred
+	            rollback = true;
+	        }	        
+        }
+        catch(Throwable t)
+        {
+            rollback = true;
+            throw new RuntimeException(t);
+        }
+        finally
+        {
+            if(tx!=null)
+            {
+	            try
+	            {
+	                if (tx.getStatus()==javax.transaction.Status.STATUS_ACTIVE)
+	                {
+		            if(rollback)
+		            {
+		                tx.rollback();
+		            }
+		            else
+		            {
+		                tx.commit();
+		            }
+	                }
+	            }
+	            catch(Exception e)
+	            {
+	                //if exceptions occur with transaction rollback and committ...not a whole lot you can do about it
+	                e.printStackTrace();
+	            }
+            }
+        }
+    }         
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/FloodControlListener.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/FloodControlListener.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/FloodControlListener.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.event;
+
+import java.util.Date;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+import org.jboss.portal.identity.User;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+public class FloodControlListener implements ActionListener {
+
+    private long floodInterval;
+
+    public FloodControlListener() {
+        super();
+        
+        try 
+        {
+            floodInterval = BaseController.getForumsModule().getFloodInterval();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public void processAction(ActionEvent event) throws AbortProcessingException {
+        
+        long lastPostTime = 0;
+        
+        try 
+        {
+            User user = PortalUtil.getUser();
+            
+            if (user != null) {
+                Date lastPost = BaseController.getForumsModule().findLastPostDateForUser(user);
+            
+                if (lastPost != null)
+                {
+                    lastPostTime = lastPost.getTime();
+                }
+            }
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        if (lastPostTime > 0)
+        {
+           long now = new Date().getTime();
+           
+           long interval = (now - lastPostTime) / 1000;
+           
+           if (interval < floodInterval)
+           {
+               throw new AbortProcessingException("interval < floodInterval");
+           }
+        }
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/ValueRequiredMessageModifierListener.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/ValueRequiredMessageModifierListener.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/event/ValueRequiredMessageModifierListener.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portlet.forums.ui.event;
+
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+/**
+ * This class which implements JSF PhaseListener interface
+ * will modify the view of validation messages which are generated
+ * from required="true" validators.
+ * 
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class ValueRequiredMessageModifierListener implements PhaseListener {
+    
+    public static final String FIELD_NAME_COMP = "fieldName";
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public PhaseId getPhaseId() {
+        return PhaseId.RENDER_RESPONSE;
+    }
+
+    public void beforePhase(PhaseEvent event) {
+        FacesContext context = event.getFacesContext();
+        UIViewRoot root = context.getViewRoot();
+        Iterator it = context.getClientIdsWithMessages();
+        while (it.hasNext())
+        {
+            String clientId = (String)it.next();
+            UIComponent comp = root.findComponent(clientId);
+            {
+                Iterator i = context.getMessages(clientId);
+                while (i.hasNext())
+                {
+                    FacesMessage fm = (FacesMessage) i.next();
+                    if (fm.getDetail().indexOf(":")!=-1)
+                    {
+                        fm.setDetail(fm.getDetail().substring(fm.getDetail().indexOf(":")+1));
+                    }
+                }
+            }
+        }
+    }
+
+    public void afterPhase(PhaseEvent e) {
+    }
+}
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,246 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.io.Serializable;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/*
+ * Created on May 11, 2006
+ *
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public abstract class PageNavigator implements Serializable
+{
+    
+    public static final int PAGINATION_SIZE = 8;
+    
+    /**
+     * 
+     */    
+    private int totalPages = 0;
+    private int pageSize = 0;
+    private int currentPage = 0;
+    private int numberOfEntries=0;
+    private Collection page = null;
+    private SortedSet currentPaginationLeft = null;
+    private SortedSet currentPaginationRight = null;
+    
+    /**
+     * 
+     *
+     */
+    public PageNavigator(int numberOfEntries,int pageSize,int currentPage)
+    { 
+        if(numberOfEntries<0)
+        {
+            throw new IllegalStateException("PageNavigator cannot be initialized for negative number of entries");
+        }
+        
+        this.pageSize = pageSize;
+        this.currentPage = currentPage;
+        this.numberOfEntries = numberOfEntries;
+        
+        //calculate the totalNumberofPages that will be made
+        double pageSizeDbl = this.pageSize;
+        double pageCountDbl = numberOfEntries/pageSizeDbl;
+        this.totalPages = (int)Math.ceil(pageCountDbl);
+        
+        this.currentPaginationLeft = new TreeSet();
+        this.currentPaginationRight = new TreeSet();
+        
+        // Initializing pagination so that selected page will be in the middle.
+        if (currentPage >= totalPages)
+        {
+            for (int i=2;i<=PAGINATION_SIZE && i<=totalPages;i++)
+            {
+                this.currentPaginationRight.add(new Integer(i));
+            }
+        } else {
+            int counter = 1;
+            for (int j=1;j<totalPages && counter<PAGINATION_SIZE;j++)
+            {
+                if ( (currentPage+1) -j > 0) {
+                    this.currentPaginationLeft.add(new Integer( (currentPage+1) -j ));
+                    counter++;
+                    if (counter==PAGINATION_SIZE)
+                    {
+                        break;
+                    }
+                }
+                if ( (currentPage+1) +j <= totalPages)
+                {
+                    counter++;
+                    this.currentPaginationRight.add(new Integer( (currentPage+1) +j ));
+                }
+            }
+        }
+        
+        this.page = initializePage();
+    }
+    
+    /**
+     * Every non-abstract class extending this class will have to implement this method
+     * and initialize page with objects.
+     */
+    protected abstract Collection initializePage();
+    
+    /**
+     *
+     * 
+     */
+    public int getNumberOfEntries() {
+        return this.numberOfEntries;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getTotalPages()
+    {
+        return this.totalPages;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getCurrentPage()
+    {
+        return this.currentPage;
+    }
+
+    /**
+     * 
+     *
+     */
+    public int getPageSize()
+    {
+        return this.pageSize;
+    }    
+      
+    /**
+     * 
+     *
+     */
+    public int getBeginIndex()
+    {
+        int beginIndex = 0;
+        
+        beginIndex = this.currentPage * this.pageSize;
+        
+        return beginIndex;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getEndIndex()
+    {
+        int endIndex = 0;
+        
+        endIndex = this.getBeginIndex() + this.pageSize;
+        if(endIndex >= this.numberOfEntries)
+        {
+            endIndex = this.numberOfEntries;
+        }
+        
+        return endIndex;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public Collection getPage()
+    {
+        if (this.page==null) {
+            return new ArrayList();
+        }
+        return this.page;
+    }
+    
+        
+    /**
+     * 
+     *
+     */
+    public String getPageNumber()
+    {        
+        return String.valueOf(this.getCurrentPage()+1);
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int[] getPages()
+    {
+        int[] pages = new int[this.getTotalPages()];
+        for(int i=0;i<pages.length;i++)
+        {
+            pages[i] = i+1;
+        }
+        return pages;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public int getPageAfterAdd()
+    {
+       int pageAfterAdd = 0;
+       
+       double totalDbl = this.numberOfEntries+1;
+       double pageSizeDbl = this.pageSize;
+       double pageCountDbl = totalDbl/pageSizeDbl;
+       pageAfterAdd = ((int)Math.ceil(pageCountDbl))-1;       
+       
+       return pageAfterAdd;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public void setCurrentPage(int currentPage)
+    {
+        this.currentPage = currentPage;
+    }
+    
+    public Object[] getCurrentPaginationLeft() {
+        return this.currentPaginationLeft.toArray();
+    }
+    
+    public Object[] getCurrentPaginationRight() {
+        return this.currentPaginationRight.toArray();
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,123 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Iterator;
+import java.util.List;
+
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+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:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ViewAdminPanel extends BaseController
+{
+
+    private List categories = null;
+    private List forums = null;
+
+    /**
+     * 
+     */
+    public ViewAdminPanel() 
+    { 
+        super();                         
+    }
+    
+    /**
+     * 
+     *
+     */
+    public List getCategories() 
+    {
+        if (categories!=null) {
+            return categories;
+        }
+        synchronized(this) {
+            if (categories!=null) {
+                return categories;
+            }
+            try
+            {
+            	// Luca Stancapiano start
+            	//get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                
+                categories = getForumsModule().findCategoriesFetchForums(new Integer(forumInstanceId));    
+                // Luca Stancapiano end
+                
+                return categories;
+            }
+            catch(Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+            return null;
+        }
+    }
+    
+    public List getForums()
+    {
+        if (forums!=null) {
+            return forums;
+        }
+        synchronized(this) {
+            if (forums!=null) {
+                return categories;
+            }
+            try
+            {         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                
+                forums = getForumsModule().findForums(new Integer(forumInstanceId));  
+                // Luca Stancapiano end
+                
+                return forums;
+            }
+            catch(Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return null;
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,293 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Date;
+
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.feeds.FeedConstants;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.ThemeHelper;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+//jsf imports
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ViewCategory extends BaseController
+{ 
+    
+    //business data being generated in this bean by executing ui actions
+    //this is data is created such that it can be consumed by the view components
+    //like facelets    
+    private Collection categories = null;
+    private Map forums = null;
+    private Map forumImages = null;
+    private Map forumImageDescriptions = null;
+    private Map forumLastPosts = null;
+    private boolean categorySelected = false;
+    
+    //----------------bean configuration supplied by the forums-config.xml---------------------------------------------------------------------------------------------
+    
+    
+    //----------------business data being generated for use by the view components like facelets---------------------------------------------------------------------------------------        
+    /**
+     * 
+     * @return
+     */
+    public Collection getCategories()
+    {
+        if(this.categories==null)
+        {
+            this.categories = new ArrayList();
+        }
+        return this.categories;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public Map getForums()
+    {
+        if(this.forums==null)
+        {
+            this.forums = new HashMap();
+        }
+        return this.forums;
+    }
+    
+    public ForumsModule getModule () throws Exception {
+        return BaseController.getForumsModule();
+    }
+    
+            
+    /**
+     * @return Returns the forumImageDescriptions.
+     */
+    public Map getForumImageDescriptions() 
+    {
+        if(this.forumImageDescriptions==null)
+        {
+            this.forumImageDescriptions = new HashMap();
+        }
+        return this.forumImageDescriptions;
+    }
+    /**
+     * @return Returns the forumImages.
+     */
+    public Map getForumImages() 
+    {
+        if(this.forumImages==null)
+        {
+            this.forumImages = new HashMap();
+        }
+        return forumImages;
+    }
+    
+    /**
+     * @return Returns the a Map which contains ForumId:LastPost pairs.
+     */
+    public Map getForumLastPosts() 
+    {
+        if(this.forumLastPosts==null)
+        {
+            this.forumLastPosts = new HashMap();
+        }
+        return this.forumLastPosts;
+    }
+    
+    /**
+     * @return Returns true if category has been selected.
+     */
+    public boolean isCategorySelected() {
+        return this.categorySelected;
+    }
+    
+    public String getRssFeed()
+    {
+        if (categorySelected && categories!=null && !categories.isEmpty())
+        {
+            Category category = (Category)categories.iterator().next();
+            return PortalUtil.createFeedLink(FeedConstants.RSS,
+                    FeedConstants.CATEGORY, category.getId());
+        }
+        else
+        {
+            return PortalUtil.createFeedLink(FeedConstants.RSS,
+                    FeedConstants.GLOBAL,null);
+        }
+    }
+    
+    public String getAtomFeed()
+    {
+        if (categorySelected && categories!=null && !categories.isEmpty())
+        {
+            Category category = (Category)categories.iterator().next();
+            return PortalUtil.createFeedLink(FeedConstants.ATOM,
+                    FeedConstants.CATEGORY, category.getId());
+        }
+        else
+        {
+            return PortalUtil.createFeedLink(FeedConstants.ATOM,
+                    FeedConstants.GLOBAL,null);
+        }
+        
+    }
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------
+    
+    //-------------------------------------------------------------------------------------------------------------------------------------                
+    /**
+     * 
+     * @author sshah
+     */
+    public ViewCategory()
+    { 
+        super();                         
+        try
+        {
+            this.execute();
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+    }
+    
+    //ui actions supported by this bean---------------------------------------------------------------------------------------------------- 
+    /**
+     *  this generates the category and its corresponding forums
+     */
+     private void execute() throws Exception
+     {                
+         //try to extract categoryId
+         int categoryId = -1;
+         String c = ForumUtil.getParameter(Constants.p_categoryId);
+         if(c!=null && c.trim().length()>0)
+         {
+             categoryId = Integer.parseInt(c);
+             
+             // Setting flag that category has been selected.
+             this.categorySelected=true;
+         }
+
+         // Luca Stancapiano start
+         //get the forumInstanceId where this forum should be added
+	     int forumInstanceId = -1;
+	     String cou = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	     if(cou!=null && cou.trim().length()>0)
+	     {
+	        forumInstanceId = Integer.parseInt(cou);
+	     }
+         
+         this.forumLastPosts = this.getForumsModule().findLastPostsOfForums(new Integer(forumInstanceId));
+         // Luca Stancapiano end
+         
+         //setup category related data to be displayed
+         if(categoryId==-1)
+         {    
+             //process a default level category
+        	 // Luca Stancapiano
+             Collection cour = BaseController.getForumsModule().findCategoriesFetchForums(new Integer(forumInstanceId));
+             if(cour!=null)
+             {
+                 Iterator iterator = cour.iterator();
+                 while (iterator.hasNext())
+                 {
+                    Category currentCategory = (Category)iterator.next();
+                    this.processCategory(currentCategory);
+                 }
+             }
+         }
+         else
+         {
+             //process the specifed category 
+             Category currentCategory = BaseController.getForumsModule().findCategoryByIdFetchForums(new Integer(categoryId));
+             if(currentCategory!=null)
+             {
+                 this.processCategory(currentCategory);
+             }
+         }
+     }
+     
+     /**
+      * 
+      * @return
+      */
+     private void processCategory(Category category) throws Exception
+     {
+        Date userLastLogin = PortalUtil.getUserLastLoginDate();
+        if(category!=null)
+        {
+            this.getCategories().add(category);
+            
+            //process the forums associated with this category
+            Collection forums = category.getForums();
+            Iterator forumsIterator = forums.iterator();
+            Collection categoryForums = new ArrayList();
+            while (forumsIterator.hasNext())
+            {
+               Forum currentForum = (Forum)forumsIterator.next();
+               categoryForums.add(currentForum);
+                                                          
+               //setup folderLook based on whats specified in the theme
+               String folderImage = ThemeHelper.getInstance().getResourceForumURL();
+               String folderAlt = "No_new_posts"; //bundle key
+               if (this.forumLastPosts!=null && this.forumLastPosts.containsKey(currentForum.getId()))
+               {
+                   Post lastPost = (Post)this.forumLastPosts.get(currentForum.getId());
+                   Date lastPostDate = lastPost.getCreateDate();
+                   if (lastPostDate!=null && userLastLogin!=null && lastPostDate.compareTo(userLastLogin)>0)
+                   {
+                       folderAlt = "New_posts"; //bundle key
+                       folderImage = ThemeHelper.getInstance().getResourceForumNewURL();
+                   }
+               }
+               if (currentForum.getStatus() == Constants.FORUM_LOCKED)
+               {
+                  folderImage = ThemeHelper.getInstance().getResourceForumLockedURL();
+                  folderAlt = "Forum_locked"; //bundle key
+               }              
+               this.getForumImages().put(currentForum.getId(),folderImage);
+               this.getForumImageDescriptions().put(currentForum.getId(),folderAlt);                                                                                    
+            }           
+            this.getForums().put(category.getId(),categoryForums);
+        }
+     }    
+    //-------------------------------------------------------------------------------------------------------------------------------------    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,406 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+import java.util.LinkedList;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.feeds.FeedConstants;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
+
+//jsf imports
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public class ViewForum extends BaseController
+{   
+    //preference related data
+    private PreferenceController userPreferences = null;
+        
+    
+    //business data being generated in this bean by executing ui actions
+    //this is data is created such that it can be consumed by the view components
+    //like facelets  
+    private Forum forum = null;
+    private PageNavigator pageNavigator = null;
+    private Collection page = new ArrayList();
+    private Map topicNavigator = new HashMap();
+    private Map topicLastPosts = null;
+    private List stickyThreads = null;
+    private List announcements = null;
+            
+    //----------------business data being generated for use by the view components like facelets---------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public Forum getForum()
+    {
+        return this.forum;
+    }             
+    //page navigation related methods on this bean--------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    public PageNavigator getPageNavigator()
+    {
+        return this.pageNavigator;
+    }
+    
+    /**
+     * 
+     *
+     */
+    public Map getTopicNavigator()
+    {
+        return this.topicNavigator;
+    }
+    //--------------------------------------------------------------------------------------------    
+     /**
+      * 
+      *
+      */
+     public Collection getAnnouncements()
+     {
+         if (announcements!=null) {
+             return announcements;
+         }
+         announcements = new ArrayList(); 
+         try {
+             announcements = BaseController.getForumsModule().findTopicsDesc(forum,
+                     Constants.POST_ANNOUNCE,
+                     0,
+                     Integer.MAX_VALUE);
+         } catch (Exception e) {
+             JSFUtil.handleException(e);
+         }
+         return announcements;
+     }
+     
+     /**
+      * 
+      * TODO: Make a special method in ForumsModule for that.
+      */
+     public boolean isAnnouncementsPresent()
+     {
+         if (announcements!=null) {
+             if (announcements.size()>0) {
+                 return true;
+             } else {
+                 return false;
+             }
+         }
+         boolean present = false;
+         try {
+             announcements= BaseController.getForumsModule().findTopicsDesc(forum,
+                     Constants.POST_ANNOUNCE,
+                     0,
+                     Integer.MAX_VALUE);
+             if (announcements!=null && announcements.size()>0) {
+                 present = true;
+             }
+         } catch (Exception e) {
+             JSFUtil.handleException(e);
+         }
+         return present;
+     }
+     
+     /**
+      * 
+      * TODO: Make a special method in ForumsModule for that.
+      */
+     public Collection getStickyThreads()
+     {
+         if (this.pageNavigator!=null && this.pageNavigator.getCurrentPage()!=0) {
+             return new ArrayList();
+         }
+         if (stickyThreads !=null) {
+             return stickyThreads;
+         }
+         stickyThreads = new ArrayList();
+         try {
+             //ForumsModule fm = this.getForumsModule();
+             stickyThreads = BaseController.getForumsModule().findTopicsDesc(forum,
+                             Constants.POST_STICKY,
+                             0,
+                             Integer.MAX_VALUE);
+         } catch (Exception e) {
+             JSFUtil.handleException(e);
+         }
+         return stickyThreads;
+     }
+     
+     /**
+      * 
+      * TODO: Make a special method in ForumsModule for that.
+      */
+     public boolean isStickyThreadsPresent()
+     {
+         if (this.pageNavigator!=null && this.pageNavigator.getCurrentPage()!=0) {
+             return false;
+         }
+         if (stickyThreads !=null) {
+             if (stickyThreads.size()>0) {
+                 return true;
+             } else {
+                 return false;
+             }
+         }
+         boolean present = false;
+         try {
+             stickyThreads = BaseController.getForumsModule().findTopicsDesc(forum,
+                             Constants.POST_STICKY,
+                             0,
+                             Integer.MAX_VALUE);
+             if (stickyThreads!=null && stickyThreads.size()>0) {
+                 present = true;
+             }
+         } catch (Exception e) {
+             JSFUtil.handleException(e);
+         }
+         return present;
+     }
+     
+     /**
+      * 
+      */
+     public Collection getNormalThreads()
+     {
+         return this.page;
+     } 
+     
+     /**
+      * 
+      */
+     public boolean isNormalThreadsPresent()
+     {     
+         return this.page.size()>0;
+     }
+     
+     /**
+      * @return Returns the a Map which contains TopicId:LastPost pairs.
+      */
+     public Map getTopicLastPosts() 
+     {
+         if(this.topicLastPosts==null)
+         {
+             this.topicLastPosts = new HashMap();
+         }
+         return this.topicLastPosts;
+     }    
+     
+     //------------user preferences-------------------------------------------------------------------------------------------------------------
+     /**
+      * @return Returns the userPreferences.
+      */
+     public PreferenceController getUserPreferences() 
+     {
+         return userPreferences;
+     }
+     /**
+      * @param userPreferences The userPreferences to set.
+      */
+     public void setUserPreferences(PreferenceController userPreferences) 
+     {
+         this.userPreferences = userPreferences;    
+     }             
+     //-------------------------------------------------------------------------------------------------------------------------------------                
+          
+     
+     /**
+      * 
+      * @author sshah
+      */
+     public ViewForum()
+     { 
+         super();                 
+     }
+     
+     //ui actions supported by this bean----------------------------------------------------------------------------------------------------
+     /**
+      * 
+      */
+     public boolean isInitialized()
+     {
+        boolean initialized = false;
+        try
+        { 
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return initialized;
+     }
+     
+     /**
+      * 
+      *
+      */
+     private void execute() throws Exception
+     {
+         //parse the input parameters
+         String page = ForumUtil.getParameter(Constants.p_page);
+         int forumId = -1;
+         String f = ForumUtil.getParameter(Constants.p_forumId);
+         if(f!=null && f.trim().length()>0)
+         {
+             forumId = Integer.parseInt(f);
+         }
+         
+         // ForumsModule is stored as a final variable so that anonymous class could use it.
+         final ForumsModule fm = BaseController.getForumsModule();
+         
+         //grab the data to be displayed for this page
+         if(forumId!=-1)
+         {
+             //setup the business objects like the forum, topics etc that will be displayed
+             this.forum = fm.findForumById(new Integer(forumId));
+             
+             int pageNumber = 0;
+             
+             if(page!=null && page.trim().length()>0)
+             {
+                 //setup the page data
+                 pageNumber = Integer.parseInt(page);
+             }
+             
+             // clearing previous PageNavigator
+             this.pageNavigator=null;
+             
+             int ads = 0;
+             ads+=getAnnouncements().size();
+             ads+=getStickyThreads().size();
+             
+             //setup the pageNavigator for this forum
+             this.pageNavigator = new PageNavigator(
+                forum.getTopicCount()-ads, //total number of entries without annoucements and stickies to be split up into pages
+                Integer.parseInt(this.userPreferences.getPreference(Constants.TOPICS_FORUM_KEY)), 
+                pageNumber //currently selected page being displayed, first page by default
+             ) {
+             
+                 protected Collection initializePage() {
+                 
+                     int beginIndex = this.getBeginIndex();
+                     int totalEntries = this.getNumberOfEntries();
+                     int pageSize = this.getPageSize();
+                     
+                     //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                     if(beginIndex >= totalEntries || beginIndex < 0)
+                     {
+                         this.setCurrentPage(0); //go to the first page
+                         beginIndex = this.getBeginIndex();
+                     }
+                     
+                     try {
+                         return fm.findTopicsDesc(forum,
+                                                  Constants.POST_NORMAL,
+                                                  beginIndex,
+                                                  pageSize);
+                     } catch (ModuleException e) {
+                         JSFUtil.handleException(e);
+                     }
+                     return new ArrayList();
+                     
+                 }
+             
+             };
+             
+             this.page = this.pageNavigator.getPage();
+             
+             // Getting sticky topics for this page
+             Collection stickies = getStickyThreads();
+             
+             // Getting announcements
+             Collection announcements = getAnnouncements();
+             
+             Collection listOfTopics = new LinkedList();
+             
+             listOfTopics.addAll(stickies);
+             listOfTopics.addAll(announcements);
+             listOfTopics.addAll(this.page);
+
+            // Getting sticky topics for this page
+             this.topicLastPosts = fm.findLastPostsOfTopics(listOfTopics);
+             
+             // setup dummy pageNavigators for all topics being displayed for topic minipaging
+             for(Iterator itr=listOfTopics.iterator();itr.hasNext();)
+             {
+                 Topic cour = (Topic)itr.next();
+                 if(cour.getReplies()>0)
+                 {
+                     PageNavigator topicNav = new PageNavigator(cour.getReplies()+1,
+                     Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference
+                     0 //current page of the navigator
+                     ) {
+
+                            protected Collection initializePage() {
+                                return null;
+                            }
+                            
+                        };
+                     this.topicNavigator.put(cour.getId(),topicNav);
+                 }
+             }
+         }
+     }
+     
+     public String getRssFeed()
+     {
+         return PortalUtil.createFeedLink(FeedConstants.RSS,
+                          FeedConstants.FORUM, forum.getId());
+     }
+     
+     public String getAtomFeed()
+     {
+         return PortalUtil.createFeedLink(FeedConstants.ATOM,
+                          FeedConstants.FORUM, forum.getId());
+     }
+     
+    //-------------------------------------------------------------------------------------------------------------------------------------    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.hibernate.Hibernate;
+
+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:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class ViewJumpbox extends BaseController
+{
+
+    private List categories;
+
+    /**
+     * @author Ryszard Kozmik
+     */
+    public ViewJumpbox () { 
+        super();
+    }
+    
+    public List getCategories() 
+    {
+        if (categories!=null) {
+            return categories;
+        }
+        synchronized (this) {
+            if (categories!=null) {
+                return categories;
+            }
+            try
+            {
+            	// Luca Stancapiano start
+            	//get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                
+                categories = getForumsModule().findCategoriesFetchForums(new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+                return categories;
+            }
+            catch(Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+            return null ;
+        }
+    }
+    
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,162 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.Map;
+
+import org.jboss.portlet.forums.model.Watch;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+// Luca Stancapiano - import
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+public class ViewMyForumsAllSubscribed extends ViewMyForumsBase
+{
+    
+    private int topicId;
+    private Watch watch;
+    private Map topicWatches;
+    
+    public ViewMyForumsAllSubscribed()
+    {
+        try {
+            String t = JSFUtil.getRequestParameter(Constants.p_topicId);
+            if (t!=null && t.trim().length()>0) {
+                topicId = Integer.parseInt(t);
+            } else {
+                topicId = -1;
+            }
+            if (topicId != -1)
+            {
+                watch = getForumsModule().findTopicWatchByUserAndTopic(PortalUtil.getUser(),topicId);
+            }
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+            topicId=-1;
+            watch=null;
+        }
+    }
+    
+    /**
+     * 
+     */
+    public Watch getWatch()
+    {
+        return watch;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatch(Watch watch)
+    {
+        this.watch = watch;
+    }
+
+    /**
+     * 
+     */
+    public int getTopicId()
+    {
+        return topicId;
+    }
+    
+    /**
+     * 
+     */
+    public void setTopicId(int topicId)
+    {
+        this.topicId = topicId;
+    }
+    
+    /**
+     * 
+     */
+    public Collection getWatchedTopics()
+    {
+        if (watchedTopics==null)
+        {
+            try
+            {         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                watchedTopics = BaseController.getForumsModule().findTopicWatchedByUser(PortalUtil.getUser(), new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return watchedTopics;
+    }
+    
+    /**
+     * 
+     */
+    public Map getTopicWatches()
+    {
+        if (topicWatches==null)
+        {
+            try
+            {         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                topicWatches = BaseController.getForumsModule().findTopicWatches(PortalUtil.getUser(), new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return topicWatches;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchedTopics(Collection watchedTopics)
+    {
+        this.watchedTopics = watchedTopics;
+    }
+    
+    // -------- Business logic ----------------------------------------------------------------------------------------------------------------
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
+import org.jboss.portlet.forums.model.Topic;
+
+/**
+ * 
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
+public abstract class ViewMyForumsBase extends BaseController
+{
+    
+    //preference related data
+    private PreferenceController userPreferences = null;
+    
+    // Map<TopicId,LastPost>
+    private Map topicsLastPosts;
+    protected Collection watchedTopics;
+    private Map topicNavigator = new HashMap();
+    
+    public abstract Collection getWatchedTopics();
+    public abstract void setWatchedTopics(Collection watchedTopics);
+    
+    /**
+     * 
+     */
+    public Map getTopicsLastPosts()
+    {
+        if (topicsLastPosts==null)
+        {
+            try
+            {
+                Collection watched = getWatchedTopics();
+                if (watched != null) {
+                    Set temporaryContainer = new HashSet(watched.size());
+                    Iterator it = watched.iterator();
+                    while (it.hasNext())
+                    {
+                        Topic topic = (Topic)it.next();
+                        temporaryContainer.add(topic);
+                    }
+                    topicsLastPosts = BaseController.getForumsModule().findLastPostsOfTopics(temporaryContainer);
+                }
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return topicsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public void setTopicsLastPosts(Map topicsLastPosts)
+    {
+        this.topicsLastPosts = topicsLastPosts;
+    }
+    
+    /**
+     *
+     */
+    public Map getTopicNavigator()
+    {
+        return this.topicNavigator;
+    }
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }
+    
+    // -------- Business logic ----------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public ViewMyForumsBase ()
+    {
+        super();
+    }
+    
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+        boolean initialized = false;
+        try
+        { 
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return initialized;
+    }
+    
+    /**
+     * 
+     */
+    public void execute() throws Exception
+    {
+        // Forcing initialization of collections
+        getWatchedTopics();
+        getTopicsLastPosts();
+        
+        Collection topics = getWatchedTopics();
+        
+        // setup dummy pageNavigators for all topics being displayed for topic minipaging
+        if (topics != null) {
+            for(Iterator itr=topics.iterator();itr.hasNext();)
+            {
+                Topic courTopic = (Topic)itr.next();
+                if(courTopic.getReplies()>0)
+                {
+                   PageNavigator topicNav = new PageNavigator(courTopic.getReplies()+1,
+                   Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference
+                   0 //current page of the navigator
+                   ) {
+                        protected Collection initializePage() {
+                           return null;
+                        }
+                       
+                   };
+                   this.topicNavigator.put(courTopic.getId(),topicNav);
+                }
+            }
+        }
+        
+    }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,325 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Watch;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+// Luca Stancapiano - import
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.ThemeHelper;
+
+public class ViewMyForumsEditAllForums extends BaseController
+{
+
+    // Map<ForumId,LastPost>
+    private Map forumsLastPosts;
+    private Map forumImageDescriptions;
+    private Map forumImages;
+    private Map forumWatches;
+    private Collection watchedForums;
+    
+    private Watch watch;
+    private int forumId;
+    
+    /**
+     * 
+     */
+    public Map getForumImageDescriptions()
+    {
+        if(this.forumImageDescriptions==null)
+        {
+            this.forumImageDescriptions = new HashMap();
+        }
+        return this.forumImageDescriptions;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumImageDescriptions(Map forumImageDescriptions)
+    {
+        this.forumImageDescriptions = forumImageDescriptions;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumImages()
+    {
+        if(this.forumImages==null)
+        {
+            this.forumImages = new HashMap();
+        }
+        return forumImages;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumImages(Map forumImages)
+    {
+        this.forumImages = forumImages;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumsLastPosts()
+    {
+        if (forumsLastPosts==null)
+        {
+            try
+            {
+            	//get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                
+                forumsLastPosts = BaseController.getForumsModule().findLastPostsOfForums(new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return forumsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumsLastPosts(Map forumsLastPosts)
+    {
+        this.forumsLastPosts = forumsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumWatches()
+    {
+        return forumWatches;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumWatches(Map forumWatches)
+    {
+        this.forumWatches = forumWatches;
+    }
+    
+    /**
+     * 
+     */
+    public Collection getWatchedForums()
+    {
+        if (watchedForums==null)
+        {
+            try
+            {         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                watchedForums = BaseController.getForumsModule().findForumWatchedByUser(PortalUtil.getUser(), new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return watchedForums;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchedForums(Collection watchedForums)
+    {
+        this.watchedForums = watchedForums;
+    }
+    
+    /**
+     * 
+     */
+    public Watch getWatch ()
+    {
+        return this.watch;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatch (Watch watch)
+    {
+        this.watch = watch;
+    }
+    
+    /**
+     * 
+     */
+    public int getForumId()
+    {
+        return this.forumId;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumId (int forumId)
+    {
+        this.forumId = forumId;
+    }
+    
+// -------- Business logic ----------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public ViewMyForumsEditAllForums ()
+    {
+        super();
+    }
+    
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+        boolean initialized = false;
+        try
+        {
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return initialized;
+    }
+    
+    /**
+     * 
+     */
+    public void execute () throws Exception {
+        
+        Collection forums = getWatchedForums();
+        
+        try
+        {         
+        	// Luca Stancapiano start
+            //get the forumInstanceId where this forum should be added
+	        int forumInstanceId = -1;
+	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        if(cour!=null && cour.trim().length()>0)
+	        {
+	        	forumInstanceId = Integer.parseInt(cour);
+	        }
+            this.forumWatches = getForumsModule().findForumWatches(PortalUtil.getUser(), new Integer(forumInstanceId));
+            // Luca Stancapiano end
+            
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+            setForumWatches(new HashMap(0));
+        }
+        
+        Date userLastLogin = PortalUtil.getUserLastLoginDate(); 
+        
+        for (Iterator iter = forums.iterator(); iter.hasNext();)
+        {
+            Forum currentForum = (Forum) iter.next();
+        
+            // setup folderLook based on whats specified in the theme
+            String folderImage = ThemeHelper.getInstance().getResourceForumURL();
+            String folderAlt = "No_new_posts"; //bundle key
+            if (this.forumsLastPosts!=null && this.forumsLastPosts.containsKey(currentForum.getId()))
+            {
+                Post lastPost = (Post)this.forumsLastPosts.get(currentForum.getId());
+                Date lastPostDate = lastPost.getCreateDate();
+                if (lastPostDate!=null && userLastLogin!=null && lastPostDate.compareTo(userLastLogin)>0)
+                {
+                    folderAlt = "New_posts"; //bundle key
+                    folderImage = ThemeHelper.getInstance().getResourceForumNewURL();
+                }
+            }
+            if (currentForum.getStatus() == Constants.FORUM_LOCKED)
+            {
+               folderImage = ThemeHelper.getInstance().getResourceForumLockedURL();
+               folderAlt = "Forum_locked"; //bundle key
+            }              
+            this.getForumImages().put(currentForum.getId(),folderImage);
+            this.getForumImageDescriptions().put(currentForum.getId(),folderAlt);
+        }
+        
+        try {
+            String t = JSFUtil.getRequestParameter(Constants.p_forumId);
+            if (t!=null && t.trim().length()>0) {
+                forumId = Integer.parseInt(t);
+            } else {
+                forumId = -1;
+            }
+            if (forumId != -1)
+            {
+                watch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(),forumId);
+            }
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+            forumId=-1;
+            watch=null;
+        }
+    }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return "success";
+    }
+
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,256 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+// Luca Stancapiano - import
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.ThemeHelper;
+
+public class ViewMyForumsMain extends ViewMyForumsBase
+{
+    
+    // Map<ForumId,LastPost>
+    private Map forumsLastPosts;
+    
+    private Collection watchedForums;
+    
+    private Map forumImageDescriptions;
+    private Map forumImages;
+    
+    
+    /**
+     * 
+     */
+    public Collection getWatchedTopics()
+    {
+        if (watchedTopics==null)
+        {
+            try {
+                Date lastLoginDate = PortalUtil.getUserLastLoginDate();
+                if (lastLoginDate==null)
+                {
+                    return watchedTopics;
+                }         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                watchedTopics = BaseController.getForumsModule().
+                findTopicWatchedByUser(PortalUtil.getUser(),lastLoginDate, new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return watchedTopics;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchedTopics(Collection watchedTopics)
+    {
+        this.watchedTopics = watchedTopics;
+    }
+    
+    /**
+     * 
+     */
+    public Collection getWatchedForums()
+    {
+        if (watchedForums==null)
+        {
+            try
+            {         
+            	// Luca Stancapiano start
+                //get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                watchedForums = BaseController.getForumsModule().findForumWatchedByUser(PortalUtil.getUser(), new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return watchedForums;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchedForums(Collection watchedForums)
+    {
+        this.watchedForums = watchedForums;
+    }
+    
+    /**
+     * @return Returns the forumImageDescriptions.
+     */
+    public Map getForumImageDescriptions() 
+    {
+        if(this.forumImageDescriptions==null)
+        {
+            this.forumImageDescriptions = new HashMap();
+        }
+        return this.forumImageDescriptions;
+    }
+    
+    /**
+     * @return Returns the forumImages.
+     */
+    public Map getForumImages() 
+    {
+        if(this.forumImages==null)
+        {
+            this.forumImages = new HashMap();
+        }
+        return forumImages;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumsLastPosts()
+    {
+        if (forumsLastPosts==null)
+        {
+            try
+            {
+            	// Luca Stancapiano start
+            	//get the forumInstanceId where this forum should be added
+    	        int forumInstanceId = -1;
+    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        if(cour!=null && cour.trim().length()>0)
+    	        {
+    	        	forumInstanceId = Integer.parseInt(cour);
+    	        }
+                
+                forumsLastPosts = BaseController.getForumsModule().findLastPostsOfForums(new Integer(forumInstanceId));
+                // Luca Stancapiano end
+                
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return forumsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumsLastPosts(Map forumsLastPosts)
+    {
+        this.forumsLastPosts = forumsLastPosts;
+    }
+    
+    // -------- Business logic ----------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public ViewMyForumsMain ()
+    {
+        super();
+    }
+    
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+        boolean initialized = false;
+        try
+        {
+            super.execute();
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return initialized;
+    }
+    
+    /**
+     * 
+     */
+    public void execute () throws Exception {
+        
+        Collection forums = getWatchedForums();
+        Date userLastLogin = PortalUtil.getUserLastLoginDate(); 
+        
+        for (Iterator iter = forums.iterator(); iter.hasNext();)
+        {
+            Forum currentForum = (Forum) iter.next();
+        
+            // setup folderLook based on whats specified in the theme
+            String folderImage = ThemeHelper.getInstance().getResourceForumURL();
+            String folderAlt = "No_new_posts"; //bundle key
+            if (this.forumsLastPosts!=null && this.forumsLastPosts.containsKey(currentForum.getId()))
+            {
+                Post lastPost = (Post)this.forumsLastPosts.get(currentForum.getId());
+                Date lastPostDate = lastPost.getCreateDate();
+                if (lastPostDate!=null && userLastLogin!=null && lastPostDate.compareTo(userLastLogin)>0)
+                {
+                    folderAlt = "New_posts"; //bundle key
+                    folderImage = ThemeHelper.getInstance().getResourceForumNewURL();
+                }
+            }
+            if (currentForum.getStatus() == Constants.FORUM_LOCKED)
+            {
+               folderImage = ThemeHelper.getInstance().getResourceForumLockedURL();
+               folderAlt = "Forum_locked"; //bundle key
+            }              
+            this.getForumImages().put(currentForum.getId(),folderImage);
+            this.getForumImageDescriptions().put(currentForum.getId(),folderAlt);
+        }
+    }
+    
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewProfile.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:ryszard.kozmik at jboss.com">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);
+      }  
+    }
+
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,222 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.search.DisplayAs;
+import org.jboss.portlet.forums.search.ResultPage;
+import org.jboss.portlet.forums.search.SearchCriteria;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
+import org.jboss.portlet.forums.ui.action.Search;
+
+public class ViewSearch extends BaseController {
+
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * user preference related data
+     */
+    private PreferenceController userPreferences = null;
+    
+    private List<Post> posts;
+    
+    private List<Topic> topics;
+    
+    private Map topicLastPosts = null;
+    
+    private Search search;
+    
+    private PageNavigator pageNavigator = null;
+    
+	public List<Post> getPosts()
+	{
+        return posts;
+    }
+	
+	public List<Topic> getTopics() 
+	{
+	    return topics;
+	}
+
+    public Map getTopicLastPosts() 
+    {
+        if(this.topicLastPosts==null)
+        {
+            this.topicLastPosts = new HashMap();
+        }
+        return this.topicLastPosts;
+    }
+	
+    public Search getSearch()
+    {
+        return search;
+    }
+
+    public void setSearch(Search search)
+    {
+        this.search = search;
+    }
+    
+    public PageNavigator getPageNavigator()
+    {
+        return this.pageNavigator;
+    }
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }      
+    //-------------------------------------------------------------------------------------------------------------------------------------                
+
+    public boolean isInitialized()
+    {
+       boolean initialized = false;
+       try
+       { 
+           this.execute();
+           initialized = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       return initialized;
+    }
+
+    public boolean isDisplayAsTopics()
+    {
+        String displayAs = search.getSearchCriteria().getDisplayAs();
+        
+        if (displayAs.equals(DisplayAs.TOPICS.name())) {
+            return true;
+        }
+        
+        return false;
+    }
+    
+    @SuppressWarnings("unchecked")
+    private void execute() throws Exception
+    {
+        
+        String page = ForumUtil.getParameter(Constants.p_page);
+        
+        int currentPage = 0;
+        if (page != null && page.trim().length() > 0) {
+            //setup the page data
+            currentPage = Integer.parseInt(page);
+        }
+        
+        SearchCriteria criteria = search.getSearchCriteria();
+        
+        if (criteria != null) {
+            
+            criteria.setPageSize(Integer.valueOf(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)));
+            criteria.setPageNumber(currentPage);
+
+            if (criteria.getDisplayAs().equals(DisplayAs.POSTS.name())) {
+                
+                ResultPage<Post> resultPage = BaseController.getSearchModule().findPosts(criteria);
+            
+                posts = resultPage.getPage();
+
+                if (posts != null && posts.isEmpty())
+                    posts = null;
+                
+                this.pageNavigator =
+                    new PageNavigator(resultPage.getResultSize(),
+                                      criteria.getPageSize(),
+                                      currentPage) {
+        
+                        protected Collection<Post> initializePage() {
+                            
+                            int beginIndex = this.getBeginIndex();
+                            int totalEntries = this.getNumberOfEntries();
+                                
+                            //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                            if (beginIndex >= totalEntries || beginIndex < 0)
+                            {
+                                this.setCurrentPage(0); //go to the first page
+                                beginIndex = this.getBeginIndex();
+                            }
+                                
+                            return getPosts();
+                        }
+                    };
+            } else {
+                
+                ResultPage<Topic> resultPage = BaseController.getSearchModule().findTopics(criteria);
+                
+                topics = resultPage.getPage();
+                
+                if (topics != null && topics.isEmpty()) {
+                    topics = null;
+                } else {
+                    topicLastPosts = BaseController.getForumsModule().findLastPostsOfTopics(topics);
+                }
+                
+                this.pageNavigator =
+                    new PageNavigator(resultPage.getResultSize(),
+                                      criteria.getPageSize(),
+                                      currentPage) {
+        
+                        protected Collection<Topic> initializePage() {
+                            
+                            int beginIndex = this.getBeginIndex();
+                            int totalEntries = this.getNumberOfEntries();
+                                
+                            //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                            if (beginIndex >= totalEntries || beginIndex < 0)
+                            {
+                                this.setCurrentPage(0); //go to the first page
+                                beginIndex = this.getBeginIndex();
+                            }
+                                
+                            return getTopics();
+                        }
+                    };
+            }
+        }
+    }
+	
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,207 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.ArrayList;
+
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+// Luca Stancapiano - import
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+import org.jboss.portlet.forums.ui.action.PreferenceController;
+
+//jsf imports
+
+
+/**
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ *
+ */
+public class ViewSummary extends BaseController
+{ 
+    //user preference controller
+    private PreferenceController userPreferences = null;
+    
+    //business data being generated in this bean by executing ui actions
+    //this is data is created such that it can be consumed by the view components
+    //like facelets
+    private Collection topics = null;
+            
+    //----------------bean configuration supplied by the forums-config.xml---------------------------------------------------------------------------------------------
+    
+    
+    //----------------business data being generated for use by the view components like facelets---------------------------------------------------------------------------------------
+    /**
+     * 
+     * @return
+     */
+    public Collection getTopics()
+    {
+        if(this.topics==null)
+        {
+            this.topics = new ArrayList();
+        }
+        return this.topics;
+    }
+    
+    /**
+     * 
+     * @return
+     */
+    public String getNumberOfTopicsFound()
+    {
+        return String.valueOf(this.getTopics().size());        
+    }    
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    //-------------------------------------------------------------------------------------------------------------------------------------                
+    /**
+     * 
+     * @author sshah
+     *
+     */
+    public ViewSummary()
+    { 
+        super();        
+    } 
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+       boolean initialized = false;
+       try
+       { 
+           this.execute();
+           initialized = true;
+       }
+       catch(Exception e)
+       {
+           JSFUtil.handleException(e);
+       }
+       return initialized;
+    }
+    
+    /**
+     * 
+     *
+     */
+    private void execute() throws Exception
+    {                
+        //load the topics
+        this.loadDefaultTopics();
+    }
+    //-------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * This method returns the blockTopicType based on the summaryMode set for this application
+     * @return
+     */
+    public String getBlockTopicsType()
+    {
+        String blockTopicsType = "";
+        switch(Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_MODE_KEY)))
+        {
+           case Constants.BLOCK_TOPICS_MODE_HOT_TOPICS:
+              blockTopicsType = "L_MODE_HOT_TOPICS";              
+           break;
+           case Constants.BLOCK_TOPICS_MODE_HOTTEST_TOPICS:
+              blockTopicsType = "L_MODE_HOTTEST_TOPICS";              
+           break;
+           case Constants.BLOCK_TOPICS_MODE_LATEST_POSTS:
+              blockTopicsType = "L_MODE_LATEST_POSTS";              
+           break;
+           case Constants.BLOCK_TOPICS_MODE_MOST_VIEWED:
+              blockTopicsType = "L_MODE_MOST_VIEWED";              
+           break;
+        }
+        return blockTopicsType;
+    }
+    
+    /**
+     * 
+     * @throws Exception
+     */
+    private void loadDefaultTopics() throws Exception
+    {
+        Calendar after = Calendar.getInstance();
+        after.add(Calendar.DATE, - this.userPreferences.getSummaryTopicDays());
+        Date time = after.getTime();
+        int summaryTopicReplies = Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_REPLIES_KEY));
+        int summaryTopicLimit = Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_LIMIT_KEY));
+        
+        // Luca Stancapiano start
+        //get the forumInstanceId where this forum should be added
+        int forumInstanceId = -1;
+        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+        if(cour!=null && cour.trim().length()>0)
+        {
+        	forumInstanceId = Integer.parseInt(cour);
+        }
+        
+        if (BaseController.getForumsModule().findForumInstanceById(new Integer(forumInstanceId)) == null) 
+        	BaseController.getForumsModule().createForumInstance(new Integer(forumInstanceId), "by_manual_preferences");
+        
+        // Luca Stancapiano end
+        
+        switch(Integer.parseInt(this.userPreferences.getPreference(Constants.SUMMARY_MODE_KEY)))
+        {              
+           /* Luca Stancapiano start - findTopicsHot, findTopicsHottest,
+        	  findTopicsByLatestPosts, findTopicsMostViewed methods need to a forumInstanceId argument 
+        	  to take only categories of a specific forum instance 
+           */
+           case Constants.BLOCK_TOPICS_MODE_HOT_TOPICS:              
+              this.topics = BaseController.getForumsModule().findTopicsHot(summaryTopicReplies,summaryTopicLimit,new Integer(forumInstanceId));
+              break;
+           case Constants.BLOCK_TOPICS_MODE_HOTTEST_TOPICS:              
+        	  this.topics = BaseController.getForumsModule().findTopicsHottest(time,summaryTopicLimit,new Integer(forumInstanceId));
+        	  break;
+           case Constants.BLOCK_TOPICS_MODE_LATEST_POSTS:
+        	  this.topics = BaseController.getForumsModule().findTopicsByLatestPosts(summaryTopicLimit,new Integer(forumInstanceId));
+        	  break;
+           case Constants.BLOCK_TOPICS_MODE_MOST_VIEWED:              
+        	  this.topics = BaseController.getForumsModule().findTopicsMostViewed(time,summaryTopicLimit,new Integer(forumInstanceId));
+        	  break;              
+           // Luca Stancapiano end
+        }
+    }        
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,336 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import java.util.List;
+
+import org.jboss.portal.core.modules.ModuleException;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.feeds.FeedConstants;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.BaseController;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumUtil;
+import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
+
+
+/**
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ */
+public class ViewTopic extends BaseController
+{
+    /**
+     * user preference related data
+     */
+    private PreferenceController userPreferences = null;
+    
+    /**
+     * 
+     */
+    private Topic topic;
+    private boolean rowClass;    	
+    private long postDays=0L; // This is value of selectItem describing time constraint for displayed posts
+    private PageNavigator pageNavigator = null;
+    private Collection page = new ArrayList();
+	
+	/**
+	 * 
+	 *
+	 */
+	public Topic getTopic () 
+	{
+	    return this.topic;
+	}
+	
+	/**
+	 * 
+	 *
+	 */
+    public void setPostDays(long postDays)
+    {
+        this.postDays = postDays;
+    }
+
+    /**
+     * 
+     *
+     */
+    public long getPostDays()
+    {
+        return postDays;
+    }
+    
+   /**
+    * 
+    *
+    */
+   public boolean isPollPresent()
+   {
+       boolean isPollPresent = false;
+       
+       if(	   this.topic.getPoll()!= null && 
+               this.topic.getPoll().getId() != null &&
+               this.topic.getPoll().getId().intValue()>0 &&
+               this.topic.getPoll().getOptions() != null &&
+               !this.topic.getPoll().getOptions().isEmpty()
+         )
+       {
+           isPollPresent = true;
+       }
+       
+       return isPollPresent;
+   }
+   
+   /**
+    * 
+    *
+    */
+   public boolean isBallotView()
+   {
+       boolean isBallotView = true;  //in ballot view by default
+       
+       String result = ForumUtil.getParameter(Constants.p_results);
+       if(result!=null && result.trim().length()>0)
+       {
+           isBallotView = false;
+       }
+       
+       return isBallotView;
+   }   
+   
+   public String getRssFeed()
+   {
+       return PortalUtil.createFeedLink(FeedConstants.RSS,
+                        FeedConstants.TOPIC, topic.getId());
+   }
+   
+   public String getAtomFeed()
+   {
+       return PortalUtil.createFeedLink(FeedConstants.ATOM,
+                        FeedConstants.TOPIC, topic.getId());
+   }
+   
+   // page navigation related methods on this bean--------------------------------------------------------------------------------------------
+   /**
+    * 
+    */
+   public PageNavigator getPageNavigator()
+   {
+       return this.pageNavigator;
+   }
+   
+   /**
+    * 
+    *
+    */
+   public Collection getPage()
+   {
+       return this.page;
+   }
+  //------------user preferences-------------------------------------------------------------------------------------------------------------
+   /**
+    * @return Returns the userPreferences.
+    */
+   public PreferenceController getUserPreferences() 
+   {
+       return userPreferences;
+   }
+   /**
+    * @param userPreferences The userPreferences to set.
+    */
+   public void setUserPreferences(PreferenceController userPreferences) 
+   {
+       this.userPreferences = userPreferences;    
+   }      
+  //-------------------------------------------------------------------------------------------------------------------------------------                
+
+  /**
+   * @author Ryszard Kozmik
+   */
+  public ViewTopic () 
+  { 
+      super();                               
+  }
+    
+  //ui actions supported by this bean----------------------------------------------------------------------------------------------------
+  /**
+   * 
+   */
+  public boolean isInitialized()
+  {
+     boolean initialized = false;
+     try
+     { 
+         this.execute();
+         initialized = true;
+     }
+     catch(Exception e)
+     {
+         JSFUtil.handleException(e);
+     }
+     return initialized;
+  }
+  /**
+   *  This method gets topicId from parameters and tries to find topic with that id.
+   */
+    private void execute() throws Exception {
+        //parse input data
+        int topicId = -1;
+        Integer postId = new Integer(-1);
+        String t = ForumUtil.getParameter(Constants.p_topicId);
+        String page = ForumUtil.getParameter(Constants.p_page);
+        String p = ForumUtil.getParameter(Constants.p_postId);
+        String postOrder = this.userPreferences.getPreference(Constants.POST_ORDER_KEY);
+        Integer postsPerPage = Integer.valueOf(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY));
+        
+        if (t != null && t.trim().length() > 0) {
+            topicId = Integer.parseInt(t);
+        }
+        
+        int currentPage = 0;
+        if (page != null && page.trim().length() > 0) {
+            //setup the page data
+            currentPage = Integer.parseInt(page);
+        }
+        
+        if (p != null && p.trim().length() > 0) {
+            postId = new Integer(p);
+            Post post = this.getForumsModule().findPostById(postId);
+            topicId = post.getTopic().getId().intValue();
+            this.topic = post.getTopic();
+            List postIds = null;
+            if (postOrder.compareToIgnoreCase("ascending")==0) {
+                postIds = this.getForumsModule().findPostIdsAsc(this.topic.getId(),0,Integer.MAX_VALUE);
+            } else {
+                postIds = this.getForumsModule().findPostIdsDesc(this.topic.getId(),0,Integer.MAX_VALUE);
+            }
+            int counter = 0;
+            Iterator it = postIds.iterator();
+            while (it.hasNext()) {
+                Integer id = (Integer)it.next();
+                if (id.intValue()==postId.intValue()) {
+                    break;
+                }
+                counter++;
+            }
+            currentPage = (int)Math.round(Math.floor(counter/postsPerPage.intValue()));
+        }
+
+        // ForumsModule is stored as a final variable so that anonymous class could use it.
+        final ForumsModule fm = BaseController.getForumsModule();
+
+        //process the topic information
+        if (topicId != -1) {
+            if (this.topic==null) {
+                this.topic = fm.findTopicById(new Integer(topicId));
+            }
+            topic.setViewCount(topic.getViewCount()+1);
+            
+            int postCount = topic.getReplies()+1;
+            
+            if (postCount > 0) {
+
+                //setup the pageNavigator
+                //total number of entries to be split up into pages
+                //currently selected page being displayed, first page by default            
+                if (postOrder.compareToIgnoreCase("ascending")==0) {
+                    this.pageNavigator =
+                            new PageNavigator(postCount,
+                                              postsPerPage.intValue(),
+                                              currentPage) {
+
+                                protected Collection initializePage() {
+                                
+                                    int beginIndex = this.getBeginIndex();
+                                    int totalEntries = this.getNumberOfEntries();
+                                    int pageSize = this.getPageSize();
+                                    
+                                    //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                                    if(beginIndex >= totalEntries || beginIndex < 0)
+                                    {
+                                        this.setCurrentPage(0); //go to the first page
+                                        beginIndex = this.getBeginIndex();
+                                    }
+                                
+                                    try {
+                                        return fm.findPostIdsAsc(topic.getId(),
+                                                                 beginIndex,
+                                                                 pageSize);
+                                    } catch (ModuleException e) {
+                                        JSFUtil.handleException(e);
+                                    }
+                                    return new ArrayList();
+                                }
+                            };
+                    
+                    Collection pagePostIds = this.pageNavigator.getPage();
+                    this.page = fm.findPostsByIdsAscFetchAttachmentsAndPosters(pagePostIds);
+                
+                } else {
+                
+                    this.pageNavigator =
+                            new PageNavigator(postCount,
+                                              postsPerPage.intValue(),
+                                              currentPage) {
+
+                                protected Collection initializePage() {
+                                    
+                                    int beginIndex = this.getBeginIndex();
+                                    int totalEntries = this.getNumberOfEntries();
+                                    int pageSize = this.getPageSize();
+                                    
+                                    //reset the page navigation if the start cursor is outside the range (both forward and backward)
+                                    if(beginIndex >= totalEntries || beginIndex < 0)
+                                    {
+                                        this.setCurrentPage(0); //go to the first page
+                                        beginIndex = this.getBeginIndex();
+                                    }
+                                    
+                                    try {
+                                        return fm.findPostIdsDesc(topic.getId(),
+                                                                  beginIndex,
+                                                                  pageSize);
+                                    } catch (ModuleException e) {
+                                        JSFUtil.handleException(e);
+                                    }
+                                    return new ArrayList();
+                                }
+                            };
+
+                    Collection pagePostIds = this.pageNavigator.getPage();
+                    this.page = fm.findPostsByIdsDescFetchAttachmentsAndPosters(pagePostIds);
+
+                }
+            }
+        }
+    }
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,522 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.util;
+
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.mail.Address;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.portlet.ActionResponse;
+import javax.rmi.PortableRemoteObject;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.transaction.Transactions;
+import org.jboss.portal.format.render.bbcodehtml.ToTextRenderer;
+import org.jboss.portal.format.template.TemplateLoader;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portlet.forums.ForumsConstants;
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.auth.Authorization;
+import org.jboss.portlet.forums.auth.AuthorizationInterface;
+import org.jboss.portlet.forums.auth.JSFUIContext;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.TopicWatch;
+import org.jboss.portlet.forums.model.Watch;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.PortalUtil;
+
+import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+public class NotificationEngine
+{
+   // Types of post
+   public static final int MODE_POST = 0;
+   public static final int MODE_REPLY = 1;
+   public static final int MODE_REPOST = 2;
+
+   private ForumsModule forumsModule;
+   private UserProfileModule userProfileModule;
+   private TemplateLoader mailTemplates;
+   private String from;
+   private QueuedExecutor executor;
+   private TransactionManager tm;
+   private final Logger log = Logger.getLogger(NotificationEngine.class);
+
+   public NotificationEngine(ForumsModule module)
+   {
+      try
+      {
+         this.forumsModule = module;
+         InitialContext ctx = new InitialContext();
+         tm = (TransactionManager)ctx.lookup("java:TransactionManager");
+         executor = new QueuedExecutor(new LinkedQueue());
+         userProfileModule = forumsModule.getUserProfileModule();
+      }
+      catch (NamingException e)
+      {
+         log.error("Cannot create notification interceptor", e);
+      }
+   }
+
+   public void stop()
+   {
+      executor.shutdownAfterProcessingCurrentTask();
+      executor = null;
+      forumsModule = null;
+      tm = null;
+   }
+
+   public void setFrom(String from)
+   {
+      this.from = from;
+   }
+
+   public TemplateLoader getMailTemplates()
+   {
+      return mailTemplates;
+   }
+   
+   public void scheduleForNotification(Integer postId, int mode) {
+       Object responseObj = FacesContext.getCurrentInstance().getExternalContext().getResponse();
+       
+       if (responseObj instanceof ActionResponse) {
+           
+           ActionResponse response = (ActionResponse)responseObj;
+           response.setRenderParameter(Constants.p_notified_post_id, postId.toString());
+           response.setRenderParameter(Constants.p_notified_watch_type, Integer.toString(mode));
+           
+       } else {
+           // TODO: IMPLEMENT NOTIFICATION FOR STANDALONE VERSION OF FORUMS.
+           log.warn("NOTIFICATION FOR STANDALONE HAS NOT BEEN YET IMPLEMENTED");
+       }
+       
+   }
+
+   public void schedule(Integer postId, int mode, String absViewURL , String absReplyURL )
+   {
+      try
+      {
+         
+          if (postId==null || mode == -1) {
+              log.warn("Request didn't have needed parameters.");
+              return;
+          }
+          
+         // Getting ResourceBundle with current Locale
+         // Too bad for now we support notifications sent in the locale of the poster :-(
+         
+         FacesContext ctx = FacesContext.getCurrentInstance();
+         UIViewRoot uiRoot = ctx.getViewRoot();
+         Locale locale = uiRoot.getLocale();
+         ClassLoader ldr = Thread.currentThread().getContextClassLoader();
+         ResourceBundle bundle = ResourceBundle.getBundle("ResourceJSF",locale,ldr);
+
+         // Getting Authorization realm
+         AuthorizationInterface realm = Authorization.getProvider();
+         
+         // Create task
+         NotificationTask task = new NotificationTask(tm, absViewURL, absReplyURL ,
+                 postId, mode, bundle , realm );
+
+         //Register at the end of the current tx to broadcast notifications
+         Transaction tx = tm.getTransaction();
+         tx.registerSynchronization(task);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   private String getFrom(Post post)
+   { 
+       StringBuffer fromBuf = null;
+       try {
+          if ( (userProfileModule.getProperty(post.getPoster().getUser(),User.INFO_USER_NAME_GIVEN) != null)
+             && (userProfileModule.getProperty(post.getPoster().getUser(),User.INFO_USER_NAME_FAMILY) != null))
+          {
+             fromBuf = new StringBuffer(userProfileModule.getProperty(post.getPoster().getUser(),User.INFO_USER_NAME_GIVEN)
+                + " " + userProfileModule.getProperty(post.getPoster().getUser(),User.INFO_USER_NAME_FAMILY) + " <");
+          }
+          else
+          {
+             fromBuf = new StringBuffer(post.getPoster().getUser().getUserName() + " <");
+          }
+      fromBuf.append(from + ">");
+       } catch (IdentityException e) {
+           log.error(e);
+       }
+      return fromBuf.toString();
+   }
+
+   /**
+    * The notification task.
+    */
+   class NotificationTask implements Transactions.Runnable, Synchronization
+   {
+
+      private final TransactionManager tm;
+      private final int mode;
+      private final Integer postId;
+      private final ResourceBundle bundle;
+      private final String viewURL;
+      private final String replyURL;
+      private final AuthorizationInterface realm;
+
+      NotificationTask(TransactionManager tm, String viewURL, String replyURL,
+              final Integer postId, int mode, ResourceBundle bundle , AuthorizationInterface realm)
+      {
+         this.tm = tm;
+         this.mode = mode;
+         this.postId = postId;
+         this.viewURL = viewURL;
+         this.replyURL = replyURL;
+         this.bundle = bundle;
+         this.realm = realm;
+      }
+
+      public Object run() throws Exception
+      {
+         try
+         {
+            Post post = forumsModule.findPostById(postId);
+            Topic topic = post.getTopic();
+            Forum forum = topic.getForum();
+            Category category = forum.getCategory();
+            
+            Message message = post.getMessage();
+            String from = getFrom(post);
+            // Hold the notified users to avoid duplicated
+            Set notifieds = new HashSet();
+
+            // If this is not an anonymous post, put the user in the notified list
+            // he won't be notified of his own action
+            User poster = post.getPoster().getUser();
+            if (poster != null)
+            {
+               notifieds.add(poster.getId());
+            }
+
+            char[] chars = message.getText().toCharArray();
+            StringWriter out = new StringWriter();
+            ToTextRenderer renderer = new ToTextRenderer();
+            renderer.setWriter(out);
+            renderer.render(chars, 0, chars.length);
+            
+            String forumEmbededArgsSubject = "[" + forum.getName() + "] - "
+               + message.getSubject()
+               + (mode == MODE_REPOST ? " (Repost)" : "");
+            
+            String forumEmbededArgsText = out.toString() + "<br /><br />\n"
+               + bundle.getString("EMAIL_VIEWORIGINAL") + " : "
+               + "<a href=\""+viewURL.toString() + "\">" + viewURL.toString() + "</a>\n"
+               + "<br /><br />\n"
+               + bundle.getString("EMAIL_REPLY") + " : "
+               + "<a href=\""+replyURL.toString() + "\">" + replyURL.toString() + "</a>"
+               + "<br /><br />\n";
+            
+            // For now it is just a copy from embeded mode maybe in future we will differentiate it.
+            String forumLinkedArgsSubject = forumEmbededArgsSubject;
+            
+            String forumLinkedArgsText = bundle.getString("EMAIL_LINKED_MODE_INFO")+" <b>"+forum.getName()+"</b> <br /><br />\n"
+                + bundle.getString("EMAIL_VIEWORIGINAL") + " : "
+                + "<a href=\""+viewURL.toString() + "\">" + viewURL.toString() + "</a>\n"
+                + "<br /><br />\n"
+                + bundle.getString("EMAIL_REPLY") + " : "
+                + "<a href=\""+replyURL.toString() + "\">" + replyURL.toString() + "</a>"
+                + "<br /><br />\n";
+            
+            // Notify the forum watchers
+            for (Iterator i = forum.getWatches().iterator(); i.hasNext();)
+            {
+               try
+               {
+                  Watch watch = (Watch)i.next();
+                  
+                  // If user don't want to be notified by e-mail then continue with next watch.
+                  if (watch.getMode()==ForumsConstants.WATCH_MODE_NONE)
+                  {
+                      continue;
+                  }
+                  
+                  User watcher = watch.getPoster().getUser();
+                  Object watcherId = watcher.getId();
+                  
+                  if (!notifieds.contains(watcherId) && !watcherId.equals(PortalUtil.getUserNA().getId()))
+                  {
+                     
+                     boolean securityFlag = true;
+                      
+                     // Creating security context for the user
+                     JSFUIContext securityContext = new JSFUIContext(watcher,FacesContext.getCurrentInstance());
+                     
+                     // Checking if user has privileges to read category
+                     securityContext.setFragment("acl://readCategory");
+                     securityContext.setContextData(new Object[]{category});
+                     securityFlag = realm.hasAccess(securityContext) && securityFlag;
+                     
+                     // Checking if user has privileges to read forum
+                     securityContext.setFragment("acl://readForum");
+                     securityContext.setContextData(new Object[]{forum});
+                     securityFlag = realm.hasAccess(securityContext) && securityFlag;
+                     
+                     if (securityFlag)
+                     {
+                        notifieds.add(watcherId);
+                        String subject = null;
+                        String text = null;
+                        
+                        if (watch.getMode() == ForumsConstants.WATCH_MODE_EMBEDED)
+                        {
+                            subject = forumEmbededArgsSubject;
+                            text = forumEmbededArgsText; 
+                        }
+                        else if (watch.getMode()==ForumsConstants.WATCH_MODE_LINKED)
+                        {
+                           subject = forumLinkedArgsSubject;
+                           text = forumLinkedArgsText;
+                        }
+                        
+                        notify ( watcher, from , subject, text );
+
+                     }
+                     else
+                     {
+                        // Not authorized anymore, we remove the watch
+                        forumsModule.removeWatch(watch);
+                     }
+                  }
+               }
+               catch (Exception e)
+               {
+                  log.error("Cannot send an email notification", e);
+               }
+            }
+            
+            
+            String topicEmbededArgsSubject = "[" + forum.getName() + "] - "
+                + message.getSubject()
+                + (mode == MODE_REPOST ? " (Repost)" : "");
+            
+            String topicEmbededArgsText = out.toString() + "<br /><br />\n"
+                + bundle.getString("EMAIL_VIEWORIGINAL") + " : "
+                + "<a href=\""+viewURL.toString() + "\">" + viewURL.toString() + "</a>\n"
+                + "<br /><br />\n"
+                + bundle.getString("EMAIL_REPLY") + " : "
+                + "<a href=\""+replyURL.toString() + "\">" + replyURL.toString() + "</a>"
+                + "<br /><br />\n";
+             
+            // For now it is just a copy from embeded mode maybe in future we will differentiate it.
+            String topicLinkedArgsSubject = topicEmbededArgsSubject;
+             
+            String topicLinkedArgsText = bundle.getString("EMAIL_LINKED_MODE_INFO")+": <b>"+topic.getSubject()+"</b><br /><br />\n"
+                + bundle.getString("EMAIL_VIEWORIGINAL") + " : "
+                + "<a href=\""+viewURL.toString() + "\">" + viewURL.toString() + "</a>\n"
+                + "<br /><br />\n"
+                + bundle.getString("EMAIL_REPLY") + " : "
+                + "<a href=\""+replyURL.toString() + "\">" + replyURL.toString() + "</a>"
+                + "<br /><br />\n";
+            
+            // Notify the topic watchers
+            if (mode == MODE_REPLY)
+            {
+                // Notify the reply watchers
+                for (Iterator i = topic.getWatches().iterator(); i.hasNext();)
+                {
+                   try
+                   {
+                      TopicWatch watch = (TopicWatch)i.next();
+                      
+                      // If user don't want to be notified by e-mail then continue with next watch.
+                      if (watch.getMode()==ForumsConstants.WATCH_MODE_NONE)
+                      {
+                          continue;
+                      }
+                      
+                      User watcher = watch.getPoster().getUser();
+                      Object watcherId = watcher.getId();
+                      if (!notifieds.contains(watcherId) && !watcherId.equals(PortalUtil.getUserNA().getId()))
+                      {
+                          boolean securityFlag = true;
+                          
+                          // Creating security context for the user
+                          JSFUIContext securityContext = new JSFUIContext(watcher,FacesContext.getCurrentInstance());
+                          
+                          // Checking if user has privileges to read category
+                          securityContext.setFragment("acl://readCategory");
+                          securityContext.setContextData(new Object[]{category});
+                          securityFlag = realm.hasAccess(securityContext) && securityFlag;
+                          
+                          // Checking if user has privileges to read forum
+                          securityContext.setFragment("acl://readForum");
+                          securityContext.setContextData(new Object[]{forum});
+                          securityFlag = realm.hasAccess(securityContext) && securityFlag;
+                          
+                          if (securityFlag)
+                          {
+                              // Authorized
+                              notifieds.add(watcherId);
+                              String subject = null;
+                              String text = null;
+                              
+                              if (watch.getMode() == ForumsConstants.WATCH_MODE_EMBEDED)
+                              {
+                                  subject = topicEmbededArgsSubject;
+                                  text = topicEmbededArgsText; 
+                              }
+                              else if (watch.getMode()==ForumsConstants.WATCH_MODE_LINKED)
+                              {
+                                 subject = topicLinkedArgsSubject;
+                                 text = topicLinkedArgsText;
+                              }
+                              
+                              notify( watcher, from , subject , text );
+                          }
+                          else
+                          {
+                              // Not authorized anymore, we remove the watch
+                              forumsModule.removeWatch(watch);
+                          }
+                       }
+                   }
+                   catch (Exception e)
+                   {
+                      log.error("Cannot send email notification", e);
+                   }
+                }
+            }
+         }
+         catch (IllegalArgumentException e)
+         {
+            log.error("", e);
+         }
+
+         return null;
+      }
+
+      public void beforeCompletion()
+      {
+      }
+      
+      private void notify (User watcher, String from , String subject, String text) {
+
+          Session session = null;
+
+          try {
+              session = (Session) PortableRemoteObject
+                      .narrow(new InitialContext().lookup("java:Mail"),
+                              Session.class);
+              try {
+                                              
+                  StringBuffer buffer = null;
+                  Address[] to = null;
+                  MimeMessage m = new MimeMessage(session);
+                  String email = userProfileModule.getProperty(watcher,User.INFO_USER_EMAIL_REAL).toString(); 
+                  if ( email != null ) {
+                      m.setFrom(new InternetAddress(from));
+                      to = new InternetAddress[] { new InternetAddress(
+                              email) };
+                      m.setRecipients(RecipientType.TO, to);
+                      m.setSubject(subject);
+
+                      m.setSentDate(new Date());
+                      buffer = new StringBuffer();
+
+                      buffer.append(text);
+                      buffer.append(bundle.getString("EMAIL_FOOTER_MESSAGE"));
+
+                      m.setContent(buffer.toString(),
+                              "text/html; charset=\"UTF-8\"");
+                      Transport.send(m);
+                      
+                  }
+              } catch (javax.mail.MessagingException e) {
+                  log.error(e);
+              } catch (IdentityException e2) {
+                  log.error(e2);
+              }
+          } catch (javax.naming.NamingException e) {
+              log.error(e);
+          }
+      }
+
+      public void afterCompletion(int status)
+      {
+         // When transaction succesfully commits broadcast the notification
+         if (status == Status.STATUS_COMMITTED)
+         {
+            try
+            {
+               // Do it asynch
+               executor.execute(new Runnable()
+               {
+                  public void run()
+                  {
+                     try
+                     {
+                        // Wrap with a tx
+                        Transactions.required(tm, NotificationTask.this);
+                     }
+                     catch (Exception e)
+                     {
+                        log.error("Cannot broadcast nofication for post id", e);
+                     }
+                  }
+               });
+            }
+            catch (InterruptedException ignored)
+            {
+            }
+         }
+      }
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,265 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+import org.jboss.portlet.test.forums.TestConstants;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+public class AdminEditTopicTypeCase extends WebTestCase implements TestConstants
+{
+
+   private String topicName = "new admin edit topic type test topic";
+   private String message = "admin edit topic type test message";
+   private int msgNum = 1;
+   private String replyMessage = "admin edit topic type reply message";
+
+   public AdminEditTopicTypeCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl(PORTAL_URL);
+   }
+
+   public void waitFlood()
+   {
+      try
+      {
+         Thread.sleep(FLOOD_INTERVAL * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void loginAdminUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "admin");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "admin");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void loginStandartUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "user");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "user");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void logoutUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGOUT_TEXT_LINK);
+      assertTextPresent("Don't have an account yet?");
+   }
+
+   public void testPostNormalTopic()
+   {
+      loginAdminUser();
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      //set topic as normal type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testEditToSickyTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum + "edited");
+      assertTextPresent(topicName + " " + msgNum + "edited");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "1");
+      submit("post");
+      //check if its sticky type
+      assertTextPresent("Sticky:");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+
+   }
+
+   public void testEditToAnnouncementTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum + "edited");
+      assertTextPresent(topicName + " " + msgNum + "edited");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "2");
+      submit("post");
+      //check if its sticky type
+      assertTextNotPresent("Sticky:");
+      assertTextPresent("Announcement:");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testEditBackToNormalTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum + "edited");
+      assertTextPresent(topicName + " " + msgNum + "edited");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      //check if its sticky type
+      assertTextNotPresent("Sticky:");
+      assertTextNotPresent("Announcement:");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testCleanUp()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      for (int i = 1; i <= 1; i++)
+      {
+         assertTextPresent(topicName + " " + i + "edited");
+         clickLinkWithText(topicName + " " + i + "edited");
+         assertTextPresent(topicName + " " + i + "edited");
+         assertTextPresent("Author");
+         assertTextPresent("Message");
+         clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+         submit("confirm");
+         waitFlood();
+         //navigation is broken so after deleting post we go to main forum window
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         assertTextNotPresent(topicName + " " + i + "edited");
+      }
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,270 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+import org.jboss.portlet.test.forums.TestConstants;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+public class AdminEditTopicTypeTestCase extends WebTestCase implements TestConstants
+{
+
+   private String topicName = "new admin edit topic type test topic";
+   private String message = "admin edit topic type test message";
+   private int msgNum = 1;
+   private String replyMessage = "admin edit topic type reply message";
+
+   public AdminEditTopicTypeTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl(PORTAL_URL);
+   }
+
+   public void waitFlood()
+   {
+      try
+      {
+         Thread.sleep(FLOOD_INTERVAL * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void loginAdminUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "admin");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "admin");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void loginStandartUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "user");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "user");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void logoutUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGOUT_TEXT_LINK);
+      assertTextPresent("Don't have an account yet?");
+   }
+
+   public void testPostNormalTopic()
+   {
+      loginAdminUser();
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      //set topic as normal type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testEditToSickyTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(message + " " + msgNum);
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(topicName + " " + msgNum);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      //assertTextPresent(message + " " + msgNum + "edited");
+      assertTextPresent(topicName + " " + msgNum + "edited");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "1");
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if its sticky type
+      assertTextPresent("Sticky:");
+      assertTextPresent(topicName + " " + msgNum + "edited");
+      logoutUser();
+
+   }
+
+   public void testEditToAnnouncementTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum + "edited");
+      //assertTextPresent(message + " " + msgNum + "edited");
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(topicName + " " + msgNum + "edited");
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited2");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited2");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      //assertTextPresent(message + " " + msgNum + "edited2");
+      assertTextPresent(topicName + " " + msgNum + "edited2");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "2");
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if its sticky type
+      assertTextNotPresent("Sticky:");
+      assertTextPresent("Announcement:");
+      assertTextPresent(topicName + " " + msgNum + "edited2");
+      logoutUser();
+   }
+
+   public void testEditBackToNormalTypeTopic()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum + "edited2");
+      //assertTextPresent(message + " " + msgNum + "edited2");
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(topicName + " " + msgNum + "edited2");
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum + "edited3");
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum + "edited3");
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      //assertTextPresent(message + " " + msgNum + "edited3");
+      assertTextPresent(topicName + " " + msgNum + "edited3");
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if its sticky type
+      assertTextNotPresent("Sticky:");
+      assertTextNotPresent("Announcement:");
+      assertTextPresent(topicName + " " + msgNum + "edited3");
+      logoutUser();
+   }
+
+   public void testCleanUp()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      for (int i = 1; i <= 1; i++)
+      {
+         assertTextPresent(topicName + " " + i + "edited3");
+         clickLinkWithText(topicName + " " + i + "edited3");
+         assertTextPresent(topicName + " " + i + "edited3");
+         assertTextPresent("Author");
+         assertTextPresent("Message");
+         clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+         submit("confirm");
+         waitFlood();
+         //navigation is broken so after deleting post we go to main forum window
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         assertTextNotPresent(topicName + " " + i + "edited3");
+      }
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminEditTopicTypeTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminFullTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminFullTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminFullTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,387 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+import org.jboss.portlet.test.forums.TestConstants;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:">Martin Giljohann</a>
+ * @version $Revision: 2058 $
+ */
+public class AdminFullTestCase extends WebTestCase implements TestConstants
+{
+
+   public AdminFullTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl(PORTAL_URL);
+   }
+
+   public void waitFlood()
+   {
+      try
+      {
+         Thread.sleep(FLOOD_INTERVAL * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void loginAdminUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "admin");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "admin");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void loginStandartUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "user");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "user");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void logoutUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGOUT_TEXT_LINK);
+      assertTextPresent("Don't have an account yet?");
+   }
+/*
+   public void testManyPostsAndTopicsAddRemove()
+   {
+      loginAdminUser();
+      //clickLinkWithText(PORTAL_FORUMS_TEXT_LINK);
+      //if window not maximized
+
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //set Preferences to display max number of topics/posts/per page
+      beginAt(PORTAL_FORUMS_MAIN_EDIT_URL);
+      assertTextPresent("Preferences");
+      assertTextPresent("Information");
+      setFormElement(PREFERENCES_TOPIC_PER_FORUM_FORM_ELEMENT, "30");
+      setFormElement(PREFERENCES_POST_PER_TOPIC_FORM_ELEMENT, "30");
+      //clickButton("submit");
+      submit("submit");
+      
+      //we should be on main forum page:
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      String topicName = "new test topic";
+      String message = "test message";
+      String replyMessage = "test reply message";
+
+      int numOfTopics = 2;
+      int numOfReplies = 2;
+      int topicType = 0;
+      // we do 30 topics and 29 replies for each
+      for (int i = 1; i <= numOfTopics; i++)
+      {
+
+         clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+         setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + i);
+         setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + i);
+         if (topicType > 2)
+         {
+            topicType = 0;
+         }
+         setFormElement(TOPIC_TYPE_FORM_ELEMENT, "" + topicType);
+         topicType++;
+         //clickButton("Submit");
+         submit("post");
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         assertTextPresent(FORUM_1_TEXT_LINK);
+         assertTextPresent(message + " " + i);
+         for (int j = 1; j <= numOfReplies; j++)
+         {
+            clickLinkWithImage(POST_REPLY_IMAGE_LINK);
+            setFormElement(POST_MESSAGE_FORM_ELEMENT, replyMessage + " " + j);
+            waitFlood();
+            //clickButton("Submit");
+            submit("preview");
+            assertTextPresent("Preview");
+            assertTextPresent(replyMessage + " " + j);
+            submit("post");
+            assertTextPresent(replyMessage + " " + j);
+         }
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         waitFlood();
+      }
+      for (int i = 1; i <= numOfTopics; i++)
+      {
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         for (int j = 1; j <= numOfReplies + 1; j++)
+         {
+            assertTextPresent(topicName + " " + i);
+            assertTextPresent("Author");
+            assertTextPresent("Message");
+            clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+            submit("confirm");
+            waitFlood();
+            //navigation is broken so after deleting post we go to main forum window
+            clickLinkWithText(FORUM_1_TEXT_LINK);
+            if (j != (numOfReplies + 1))
+            {
+               clickLinkWithText(topicName + " " + i);
+            }
+         }
+         assertTextNotPresent(topicName + " " + i);
+      }
+      logoutUser();
+   }*/
+
+   /*public void testPostInstantReply()
+   {
+      loginAdminUser();
+      //clickLinkWithText(PORTAL_FORUMS_TEXT_LINK);
+      //if window not maximized
+
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      String topicName = "new test topic";
+      String message = "test message";
+      String replyMessage = "test reply message";
+
+      int numOfTopics = 3;
+      int numOfReplies = 2;
+      int topicType = 0;
+      // we do 30 topics and 29 replies for each
+      for (int i = 1; i <= numOfTopics; i++)
+      {
+
+         clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+         setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + i);
+         setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + i);
+         if (topicType > 2)
+         {
+            topicType = 0;
+         }
+         setFormElement(TOPIC_TYPE_FORM_ELEMENT, "" + topicType);
+         topicType++;
+         //clickButton("Submit");
+         submit("post");
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         assertTextPresent(FORUM_1_TEXT_LINK);
+         assertTextPresent(message + " " + i);
+         for (int j = 1; j <= numOfReplies; j++)
+         {
+            setFormElement(INSTANT_REPLY_MESSAGE_FORM_ELEMENT, replyMessage + " " + j);
+            waitFlood();
+            //clickButton("Submit");
+            submit("preview");
+            assertTextPresent("Preview");
+            assertTextPresent(replyMessage + " " + j);
+            submit("post");
+            assertTextPresent(replyMessage + " " + j);
+         }
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         waitFlood();
+      }
+      for (int i = 1; i <= numOfTopics; i++)
+      {
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         for (int j = 1; j <= numOfReplies + 1; j++)
+         {
+            assertTextPresent(topicName + " " + i);
+            assertTextPresent("Author");
+            assertTextPresent("Message");
+            clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+            submit("confirm");
+            waitFlood();
+            //navigation is broken so after deleting post we go to main forum window
+            clickLinkWithText(FORUM_1_TEXT_LINK);
+            if (j != (numOfReplies + 1))
+            {
+               clickLinkWithText(topicName + " " + i);
+            }
+         }
+         assertTextNotPresent(topicName + " " + i);
+      }
+
+      logoutUser();
+   }*/
+
+   /** First category cannot be renamed with admin interface */
+   public void testRename1stCat() {
+      String renamed = "yummy demo category";
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText("Admin Panel");
+      assertTextPresent("Forum Administration");
+      // the link to edit the first category
+      beginAt("/auth/index.html?ctrl:cmd=action&ctrl:window=default.forums.ForumsPortletWindow&op=admin_forums&c=1&mode=editcat");
+      assertTextPresent("Edit Category");
+      setFormElement("cat_title", renamed);
+      submit();
+      assertLinkPresentWithText(renamed);
+   }
+
+   /**
+    *
+    * @param subject
+    * @param radioOption:
+    * 		"0" >Normal
+    * 		1"/>Sticky
+    * 		2"/>Announcement
+    */
+   private void fillPost(String subject, String message, String radioOption) {
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText("Forum Index");
+      clickLinkWithText("Second forum");
+      clickLinkWithImage("post.gif");
+      assertTextPresent("Subject");
+      setFormElement("subject", subject);
+      setFormElement("message", message);
+      setFormElement("topictype", radioOption);
+   }
+   /**
+    * After preview of a sticky post, the "post as" normal radio
+    * button is selected rather than the sticky one. Definitely a smaller bug...
+    * TODO probably same issue with annoucements
+    */
+   public void testPreviewStickyPost() {
+      loginAdminUser();
+      String subj = "PreviewStickyPost";
+      String radioOp="1";
+      fillPost(subj, "message", radioOp);
+      submit("preview");
+      assertTextPresent(subj);
+      assertRadioOptionSelected("topictype", radioOp);
+   }
+
+   /**
+    * @see testPreviewStickyPost
+    * if user wants to edit a post, exception is throwm after preview
+    */
+   public void testEditPreviewPost() {
+      String subj = "EditPreviewStickyPost";
+      loginAdminUser();
+      fillPost(subj, "message", "0");
+      submit("post");
+      assertTextPresent("Your message has been entered successfully.");
+      clickLinkWithText("Second forum");
+      clickLinkWithText(subj);
+      assertTextPresent(subj);
+
+      // now change edit and preview
+      clickLinkWithImage("icon_edit.gif");
+      assertTextPresent(subj);
+      submit("preview");
+   }
+
+   /**
+    * adding a 2nd poll option is not considered, if admin clicks
+    * immediately on submit/preview after adding the 2nd option
+    *
+    */
+
+   /*String pollSubj = "It's raining too much here";
+   String pollMessage = "I've definitely had enough now";
+   String pollTitle = "When will I see the sun again?";
+   String pollOption1 = "In 2005";
+   String pollOption2 = "In 2006";*/
+
+   /* public void testCreatePoll() {
+      loginUser();
+      fillPost(pollSubj, pollMessage, "0");
+
+      // fill poll
+      setFormElement("poll_title", pollTitle);
+      setFormElement("add_poll_option_text", pollOption1);
+      submit("add_poll_option");
+      setFormElement("add_poll_option_text", pollOption2);
+      //submit("add_poll_option"); --> this works, but in this case I just want to submit the poll, not a 3rd option
+      submit("post");
+      assertTextPresent("Your message has been entered successfully.");
+      // check poll
+      clickLinkWithText("Second forum");
+      clickLinkWithText(pollSubj);
+      assertTextPresent(pollOption1);
+      assertTextPresent(pollOption2);
+      setFormElement("vote_id", "0");
+      setFormElement("vote_id", "1");
+
+   }*/
+
+   /**
+    * a poll cannot be edited
+    *
+    */
+   /*public void testEditPoll() {
+      loginUser();
+      beginAt("/index.html?ctrl:id=page.default.forums");
+      clickLinkWithText("Forum Index");
+      clickLinkWithText("Second forum");
+      clickLinkWithText(pollSubj);
+      clickLinkWithImage("icon_edit.gif");
+
+      assertTextPresent(pollOption1);
+      assertTextPresent(pollOption2);
+   }*/
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminFullTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPollPostEditTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPollPostEditTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPollPostEditTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,253 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+import org.jboss.portlet.test.forums.TestConstants;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+public class AdminPollPostEditTestCase extends WebTestCase implements TestConstants
+{
+
+   private String topicName = "new admin post edit poll test topic";
+   private String message = "admin post edit poll test message";
+   private int msgNum = 1;
+   private String replyMessage = "admin post edit poll test reply message";
+   private String pollQuestion = "admin post edit poll test poll question";
+   private String pollOption1 = "admin post edit poll test poll option 1";
+   private String pollOption2 = "admin post edit poll test poll option 2";
+   private String pollOption3 = "admin post edit poll test poll option 3";
+   private String pollOption4 = "admin post edit poll test poll option 4";
+
+   public AdminPollPostEditTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl(PORTAL_URL);
+   }
+
+   public void waitFlood()
+   {
+      try
+      {
+         Thread.sleep(FLOOD_INTERVAL * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void loginAdminUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "admin");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "admin");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void loginStandartUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "user");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "user");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void logoutUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGOUT_TEXT_LINK);
+      assertTextPresent("Don't have an account yet?");
+   }
+
+   public void testPostNormalTopic()
+   {
+      loginAdminUser();
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      //poll
+      setFormElement(POLL_TITLE_FORM_ELEMENT, pollQuestion);
+      setFormElement(POLL_ADD_OPTION_FORM_ELEMENT, pollOption1);
+      submit(POLL_ADD_OPTION_SUBMIT);
+      setFormElement(POLL_ADD_OPTION_FORM_ELEMENT, pollOption2);
+      submit(POLL_ADD_OPTION_SUBMIT);
+      setFormElement(POLL_ADD_OPTION_FORM_ELEMENT, pollOption3);
+      submit(POLL_ADD_OPTION_SUBMIT);
+      setFormElement(POLL_ADD_OPTION_FORM_ELEMENT, pollOption4);
+      submit(POLL_ADD_OPTION_SUBMIT);
+
+      //set topic as normal type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(pollQuestion);
+      assertTextPresent(pollOption1);
+      assertTextPresent(pollOption2);
+      assertTextPresent(pollOption3);
+      assertTextPresent(pollOption4);
+      //assertButtonPresent(POLL_VOTE_SUBMIT_SUBMIT);
+      //assertTextInElement(POLL_VOTE_SUBMIT_SUBMIT,"Submit Vote");
+      assertLinkPresentWithText("View Results");
+      logoutUser();
+   }
+
+   public void testPollEdit()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(message + " " + msgNum);
+      clickLinkWithImage(POST_EDIT_IMAGE_LINK);
+      assertTextPresent(topicName + " " + msgNum);
+      setFormElement(POLL_TITLE_FORM_ELEMENT, pollQuestion + "edited");
+
+      //assertFormElementNotPresentWithLabel(POLL_OPTION_4_DELETE_SUBMIT);
+      setFormElement(POLL_OPTION_1_TEXT_FORM_ELEMENT, pollOption1 + "edited");
+      setFormElement(POLL_OPTION_2_TEXT_FORM_ELEMENT, pollOption2 + "edited");
+      setFormElement(POLL_OPTION_3_TEXT_FORM_ELEMENT, pollOption3 + "edited");
+      //do preview - which will submit all changes to poll form
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      //assertTextPresent(message + " " + msgNum + "edited");
+      assertTextPresent(topicName + " " + msgNum);
+      assertFormElementPresent(POLL_OPTION_4_DELETE_SUBMIT);
+      submit(POLL_OPTION_4_DELETE_SUBMIT);
+      submit("post");
+      waitFlood();
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      clickLinkWithText(topicName + " " + msgNum);
+      //assertTextPresent(msgNum + " " + msgNum);
+      assertTextPresent(pollQuestion + "edited");
+      assertTextPresent(pollOption1 + "edited");
+      assertTextPresent(pollOption2 + "edited");
+      assertTextPresent(pollOption3 + "edited");
+      assertTextNotPresent(pollOption4);
+      //assertButtonPresent(POLL_VOTE_SUBMIT_SUBMIT);
+      assertLinkPresentWithText("View Results");
+      logoutUser();
+   }
+
+   public void testPollVote()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(message + " " + msgNum);
+      setFormElement(POLL_VOTE_RADIO_FORM_ELEMENT, "0");
+      submit(POLL_VOTE_SUBMIT_SUBMIT);
+      assertTextPresent(topicName + " " + msgNum);
+      assertTextPresent(pollQuestion + "edited");
+      assertTextPresent(pollOption1 + "edited");
+      assertTextPresent(pollOption2 + "edited");
+      assertTextPresent(pollOption3 + "edited");
+      assertTextNotPresent(pollOption4);
+      //assertTextPresent("1.0  [ 1 ]");
+      assertTextPresent("Total Votes : 1");
+      //assertButtonNotPresent(POLL_VOTE_SUBMIT_SUBMIT);
+      assertLinkNotPresentWithText("View Results");
+      logoutUser();
+   }
+
+   public void testCleanUp()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      for (int i = 1; i <= 1; i++)
+      {
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         assertTextPresent(topicName + " " + i);
+         assertTextPresent("Author");
+         assertTextPresent("Message");
+         clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+         submit("confirm");
+         waitFlood();
+         //navigation is broken so after deleting post we go to main forum window
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         assertTextNotPresent(topicName + " " + i);
+      }
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPollPostEditTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPostTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPostTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPostTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,228 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+import org.jboss.portlet.test.forums.TestConstants;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 878 $
+ */
+public class AdminPostTestCase extends WebTestCase implements TestConstants
+{
+
+   private String topicName = "new admin post test topic";
+   private String message = "admin post test message";
+   private int msgNum;
+   private String replyMessage = "admin post test reply message";
+
+   public AdminPostTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl(PORTAL_URL);
+   }
+
+   public void waitFlood()
+   {
+      try
+      {
+         Thread.sleep(FLOOD_INTERVAL * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void loginAdminUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "admin");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "admin");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void loginStandartUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGIN_TEXT_LINK);
+      setFormElement(PORTAL_LOGIN_USERNAME_FORM_ELEMENT, "user");
+      setFormElement(PORTAL_LOGIN_PASSWORD_FORM_ELEMENT, "user");
+      submit();
+      assertTextPresent("Edit your profile");
+   }
+
+   public void logoutUser()
+   {
+      beginAt(PORTAL_MAIN_BEGIN);
+      clickLinkWithText(PORTAL_LOGOUT_TEXT_LINK);
+      assertTextPresent("Don't have an account yet?");
+   }
+
+   public void testPostNormalTopic()
+   {
+      msgNum = 1;
+      loginAdminUser();
+
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      //assert that we're on main category page
+      assertTextPresent("Forum");
+      assertTextPresent("Topics");
+      assertTextPresent("Posts");
+      assertTextPresent("Last Post");
+
+      //go to first forum
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      //set topic as normal type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "0");
+      submit("post");
+      waitFlood();
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testPostSickyTopic()
+   {
+      msgNum = 2;
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+      //do preview
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+
+      //set topic as sticky type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "1");
+      submit("post");
+      waitFlood();
+      //check if its sticky type
+      assertTextPresent("Sticky:");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+
+   }
+
+   public void testPostAnnouncementTopic()
+   {
+      msgNum = 3;
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      //so we post new topic
+      clickLinkWithImage(NEW_TOPIC_IMAGE_LINK);
+      setFormElement(POST_SUBJECT_FORM_ELEMENT, topicName + " " + msgNum);
+      setFormElement(POST_MESSAGE_FORM_ELEMENT, message + " " + msgNum);
+
+      submit("preview");
+      //check if we have preview frame
+      assertTextPresent("Preview");
+      assertTextPresent("Posted:");
+      assertTextPresent(message + " " + msgNum);
+      assertTextPresent(topicName + " " + msgNum);
+      //set topic as announcement type
+      setFormElement(TOPIC_TYPE_FORM_ELEMENT, "2");
+      submit("post");
+      waitFlood();
+      //check if its sticky type
+      assertTextPresent("Announcement:");
+      clickLinkWithText(topicName + " " + msgNum);
+      assertTextPresent(FORUM_1_TEXT_LINK);
+      assertTextPresent(message + " " + msgNum);
+      logoutUser();
+   }
+
+   public void testCleanUp()
+   {
+      loginAdminUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText(FORUM_1_TEXT_LINK);
+      //check if we are in forum 1 view;
+      assertTextPresent("Topics");
+      assertTextPresent("Replies");
+      assertTextPresent("Author");
+      assertTextPresent("Views");
+      assertTextPresent("Last Post");
+
+      for (int i = 1; i <= 3; i++)
+      {
+         assertTextPresent(topicName + " " + i);
+         clickLinkWithText(topicName + " " + i);
+         assertTextPresent(topicName + " " + i);
+         assertTextPresent("Author");
+         assertTextPresent("Message");
+         assertLinkPresentWithImage(POST_DELETE_IMAGE_LINK);
+         clickLinkWithImage(POST_DELETE_IMAGE_LINK);
+         submit("confirm");
+         waitFlood();
+         //navigation is broken so after deleting post we go to main forum window
+         clickLinkWithText(FORUM_1_TEXT_LINK);
+         assertTextNotPresent(topicName + " " + i);
+      }
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminPostTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,217 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import java.util.Random;
+
+import org.dbunit.database.IDatabaseConnection;
+import org.dbunit.dataset.IDataSet;
+import org.dbunit.operation.DatabaseOperation;
+import org.jboss.portal.test.core.Utils;
+
+import net.sourceforge.jwebunit.WebTestCase;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 2058 $
+ */
+public class AdminTestCase
+   extends WebTestCase implements TestConstants
+{
+
+   public static final int floodtime = 30;
+
+   public AdminTestCase(String name)
+   {
+      super(name);
+      //getTestContext().setBaseUrl("http://localhost.localdomain:8080/portal");
+      getTestContext().setBaseUrl("http://localhost:8080/portal");
+//      getTestContext().setUserAgent("Mozilla");
+   }
+
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      // initialize your database connection here
+      IDatabaseConnection connection = Utils.getConnection();
+
+      // initialize your dataset here
+      IDataSet dataSet = Utils.getDataSet("resources/test/forums.xml");
+
+      try
+      {
+         Utils.resetAutoIncrement();
+         DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
+      }
+      finally
+      {
+         connection.close();
+      }
+   }
+   
+   protected String getRandomTopicName () {
+       Random random = new Random ();
+       return "test topic"+Long.toString((long)(random.nextFloat()*10000000L));
+   }
+   
+    protected String getRandomMessage () {
+        Random random = new Random ();
+        return "my message"+Long.toString((long)(random.nextFloat()*10000000000L));
+    }
+
+   public void loginUser()
+   {
+      beginAt("/index.html");
+      clickLink("standardlogin");
+      setFormElement("j_username", "admin");
+      setFormElement("j_password", "admin");
+      submit();
+   }
+
+   public void testReadIndex()
+   {
+      loginUser();
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      assertLinkPresent("adminPanel");
+      assertTextPresent("Dummy demo category");
+      assertTextPresent("First forum");
+      assertTextPresent("Second forum");
+      assertLinkNotPresent("newTopic");
+   }
+
+   public void testReadForum()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      assertTextPresent("First forum");
+      assertTextPresent("Page <b>1</b> of");
+      assertLinkPresent("newTopic");
+   }
+
+   public void testPostTopic()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      String randomTopicName = getRandomTopicName();
+      setFormElement("subject",randomTopicName);
+      String randomMessage = getRandomMessage();
+      setFormElement("message", randomMessage);
+      submit("post");
+      assertTextPresent(randomTopicName);
+      clickLinkWithText(randomTopicName);
+      assertTextPresent(randomMessage);
+   }
+
+   public void testReplyTopic()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      String randomTopicName = getRandomTopicName();
+      String randomMessage = getRandomMessage();
+      setFormElement("subject", randomTopicName);
+      setFormElement("message", randomMessage);
+      submit("post");
+      clickLinkWithText("First forum");
+      clickLinkWithText(randomTopicName);
+      clickLink("postReply");
+      assertFormElementEquals("subject", "Re: "+randomTopicName);
+      String randomAnswerMessage = "my answer"+getRandomMessage();
+      setFormElement("message", randomAnswerMessage);
+      // For flood control
+      try
+      {
+         Thread.sleep(floodtime * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         // TODO Auto-generated catch block
+         e.printStackTrace();
+      }
+      submit("post");
+      assertTextPresent("Re: "+randomTopicName);
+      assertTextPresent(randomMessage);
+      assertTextPresent(randomAnswerMessage);
+   }
+
+    /* DOESN'T WORK!! */
+   /*public void testFlood()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      setFormElement("subject", "test topic");
+      setFormElement("message", "my message");
+      submit("post");
+      //clickLinkWithText("First forum");
+      clickLink("newTopic");
+      setFormElement("subject", "test topic");
+      setFormElement("message", "my message");
+      submit("post");
+      assertTextPresent("You cannot make another post so soon after your last; please try again in a short while");
+   }*/
+
+   public void testAddCategory()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLink("adminPanel");
+      setFormElement("categoryname", "newcategory");
+      submit("addcategory");
+      assertTextPresent("Forum and Category information updated successfully");
+      assertLinkPresentWithText("newcategory");
+   }
+
+   public void testAddForum()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLink("adminPanel");
+      setFormElement("forumname_1", "newforum");
+      submit("addforum_1");
+      assertFormElementEquals("forumname", "newforum");
+      setFormElement("forumname", "mynewforum");
+      setFormElement("forumdesc", "forumdesc");
+      submit();
+      assertTextPresent("Forum and Category information updated successfully");
+      assertLinkPresentWithText("mynewforum");
+      assertTextPresent("forumdesc");
+
+   }
+
+   public void testWatchForum()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("Watched Forums");
+      setFormElement("forum_id", "1");
+      assertLinkNotPresentWithText("First forum");
+      submit();
+      assertLinkPresentWithText("First forum");
+   }
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AdminTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AnonymousUserTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AnonymousUserTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AnonymousUserTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import net.sourceforge.jwebunit.WebTestCase;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 2058 $
+ */
+public class AnonymousUserTestCase
+   extends WebTestCase implements TestConstants
+{
+   public AnonymousUserTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl("http://localhost:8080/portal");
+//      getTestContext().setUserAgent("Mozilla");
+   }
+
+   public void testReadIndex()
+   {
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      assertTextPresent("Dummy demo category");
+      assertTextPresent("First forum");
+      assertTextPresent("Second forum");
+   }
+
+   public void testReadForum()
+   {
+      beginAt(PORTAL_FORUMS_MAIN_MAXIMIZED_URL);
+      clickLinkWithText("First forum");
+      assertTextPresent("First forum");
+      assertTextPresent("Page <b>1</b>");
+      assertLinkNotPresent("newTopic");
+   }
+
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/AnonymousUserTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/CategoryModelTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/CategoryModelTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/CategoryModelTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,186 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import org.jboss.portlet.forums.impl.TopicImpl;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+import org.jboss.portlet.forums.impl.CategoryImpl;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portal.core.modules.ModuleException;
+
+import java.util.Date;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.comboleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2408 $
+ */
+
+public class CategoryModelTestCase extends ForumsModelTestCase
+{
+   public CategoryModelTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testCategorySavedTestCase()
+   {
+      Set namesSet = new HashSet();
+      try
+      {
+         /* Luca Stancapiano - findCategories method need to a forumInstanceId argument 
+   	      to take only categories of a specific forum instance 
+  	     */
+         List categories = forumsModule.findCategories(new Integer(1));
+         for (Iterator ci = categories.iterator(); ci.hasNext();)
+         {
+            Category category = (Category)ci.next();
+            namesSet.add(category.getTitle());
+            List forums = category.getForums();
+            for (Iterator fi = forums.iterator(); fi.hasNext();)
+            {
+               Forum forum = (Forum)fi.next();
+               namesSet.add(forum.getName());
+               System.out.println("There are : " + forums.size() + " topics found");
+               List topics = forum.getTopics();
+               System.out.println("There are : " + topics.size() + " topics found");
+               for (Iterator ti = topics.iterator(); ti.hasNext();)
+               {
+                  Topic topic = (Topic)ti.next();
+                  System.out.println("Processing topic subject: " + topic.getSubject());
+                  Iterator pi = topic.getPosts().iterator();
+                  System.out.println("Number of posts in topic: " + topic.getPosts().size());
+                  for (; pi.hasNext();)
+                  {
+                     System.out.println("Processing post");
+
+                     Post post = (Post)pi.next();
+                     namesSet.add(post.getMessage().getSubject());
+                  }
+               }
+            }
+         }
+
+         Set expectedSubjectSet = new HashSet();
+         expectedSubjectSet.add("Sample Category");
+         expectedSubjectSet.add("Sample Forum");
+         expectedSubjectSet.add("subject1");
+         expectedSubjectSet.add("subject2");
+         assertEquals(expectedSubjectSet, namesSet);
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public void testCategoryDeleteTestCase()
+   {
+
+      try
+      {
+      	 /* Luca Stancapiano - findCategories method need to a forumInstanceId argument 
+ 	        to take only categories of a specific forum instance 
+	     */
+         List categories = forumsModule.findCategories(new Integer(1));
+         System.out.println("There are : " + categories.size() + " categories found");
+         for (Iterator ti = categories.iterator(); ti.hasNext();)
+         {
+            Category category = (Category)ti.next();
+            forumsModule.removeCategory(category);
+         }
+         /* Luca Stancapiano - findForums method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */ 
+         categories = forumsModule.findForums(new Integer(1));
+         assertEquals(categories.size(), 0);
+         /* Luca Stancapiano - findForums method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List forums = forumsModule.findForums(new Integer(1));
+         assertEquals(forums.size(), 0);
+         /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List topics = forumsModule.findTopics(new Integer(1));
+         assertEquals(topics.size(), 0);
+         /* Luca Stancapiano - findPosts method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List posts = forumsModule.findPosts(new Integer(1));
+         assertEquals(posts.size(), 0);
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   protected void populate() throws Exception
+   {
+      Topic topic1 = new TopicImpl();
+      //topic1.setPosts(new ArrayList());
+      topic1.setSubject("sample subject");
+
+      //topic1.set
+      Post post1 = new PostImpl();
+      post1.setCreateDate(new Date());
+      post1.setMessage(new MessageImpl());
+      Message message1 = new MessageImpl();
+      message1.setSubject("subject1");
+      post1.setMessage(message1);
+      Post post2 = new PostImpl();
+      post2.setCreateDate(new Date());
+      Message message2 = new MessageImpl();
+      message2.setSubject("subject2");
+      post2.setMessage(message2);
+
+      topic1.addPost(post1);
+      topic1.addPost(post2);
+
+      Forum forum1 = new ForumImpl();
+
+      forum1.addTopic(topic1);
+      forum1.setName("Sample Forum");
+
+      Category category1 = new CategoryImpl();
+      category1.addForum(forum1);
+      category1.setTitle("Sample Category");
+
+
+      session.save(category1);
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/CategoryModelTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumModelTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumModelTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumModelTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,169 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import org.jboss.portlet.forums.impl.TopicImpl;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portal.core.modules.ModuleException;
+
+
+import java.util.Date;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.comboleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2408 $
+ */
+
+public class ForumModelTestCase extends ForumsModelTestCase
+{
+   public ForumModelTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testForumSavedTestCase()
+   {
+      Set namesSet = new HashSet();
+      try
+      {
+     	 /* Luca Stancapiano - findForums method need to a forumInstanceId argument 
+	         to take only categories of a specific forum instance 
+	     */
+         List forums = forumsModule.findForums(new Integer(1));
+         
+         for (Iterator fi = forums.iterator(); fi.hasNext();)
+         {
+            Forum forum = (Forum)fi.next();
+            namesSet.add(forum.getName());
+            System.out.println("There are : " + forums.size() + " topics found");
+            List topics = forum.getTopics();
+            System.out.println("There are : " + topics.size() + " topics found");
+            for (Iterator ti = topics.iterator(); ti.hasNext();)
+            {
+               Topic topic = (Topic)ti.next();
+               System.out.println("Processing topic subject: " + topic.getSubject());
+               Iterator pi = topic.getPosts().iterator();
+               System.out.println("Number of posts in topic: " + topic.getPosts().size());
+               for (; pi.hasNext();)
+               {
+                  System.out.println("Processing post");
+
+                  Post post = (Post)pi.next();
+                  namesSet.add(post.getMessage().getSubject());
+               }
+            }
+         }
+         Set expectedSubjectSet = new HashSet();
+         expectedSubjectSet.add("Sample Forum");
+         expectedSubjectSet.add("subject1");
+         expectedSubjectSet.add("subject2");
+         assertEquals(expectedSubjectSet, namesSet);
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public void testForumDeleteTestCase()
+   {
+
+      try
+      {
+      	 /* Luca Stancapiano - findForums method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List forums = forumsModule.findForums(new Integer(1));
+         System.out.println("There are : " + forums.size() + " forums found");
+         for (Iterator ti = forums.iterator(); ti.hasNext();)
+         {
+            Forum forum = (Forum)ti.next();
+            forumsModule.removeForum(forum);
+         }
+    	 /* Luca Stancapiano - findForums method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         forums = forumsModule.findForums(new Integer(1));
+         assertEquals(forums.size(), 0);
+    	 /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List topics = forumsModule.findTopics(new Integer(1));
+         assertEquals(topics.size(), 0);
+    	 /* Luca Stancapiano - findPosts method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List posts = forumsModule.findPosts(new Integer(1));
+         assertEquals(posts.size(), 0);
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   protected void populate() throws Exception
+   {
+      Topic topic1 = new TopicImpl();
+      //topic1.setPosts(new ArrayList());
+      topic1.setSubject("sample subject");
+
+      //topic1.set
+      Post post1 = new PostImpl();
+      post1.setCreateDate(new Date());
+      post1.setMessage(new MessageImpl());
+      Message message1 = new MessageImpl();
+      message1.setSubject("subject1");
+      post1.setMessage(message1);
+      Post post2 = new PostImpl();
+      post2.setCreateDate(new Date());
+      Message message2 = new MessageImpl();
+      message2.setSubject("subject2");
+      post2.setMessage(message2);
+
+      topic1.addPost(post1);
+      topic1.addPost(post2);
+
+      Forum forum1 = new ForumImpl();
+
+      forum1.addTopic(topic1);
+      forum1.setName("Sample Forum");
+
+
+      session.save(forum1);
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumModelTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumsModelTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumsModelTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumsModelTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,146 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.tool.hbm2ddl.SchemaExport;
+import org.hibernate.cfg.Configuration;
+
+import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.impl.ForumsModuleImpl;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet </a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2408 $
+ */
+public abstract class ForumsModelTestCase
+   extends TestCase
+{
+   public ForumsModelTestCase(String name)
+   {
+      super(name);
+   }
+
+   protected SessionFactory factory;
+   protected Session session;
+   protected Transaction tx;
+   protected ForumsModule forumsModule;
+
+
+   public void setUp() throws Exception
+   {
+      Configuration cfg = new Configuration();
+      //Configuration excfg = new Configuration();
+
+      cfg.addResource("org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/ForumImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/PollImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/PosterImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/PostImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/TopicImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/WatchImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+      cfg.addResource("org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml", Thread.currentThread().getContextClassLoader());
+
+      Properties props = new Properties();
+      props.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
+      props.setProperty("hibernate.connection.driver_class", "org.gjt.mm.mysql.Driver");
+      props.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false");
+      props.setProperty("hibernate.connection.username", "portal");
+      props.setProperty("hibernate.connection.password", "portalpassword");
+      props.setProperty("hibernate.connection.pool_size", "1");
+      props.setProperty("hibernate.cache.provider_class", "org.hibernate.cache.HashtableCacheProvider");
+      //props.setProperty("hibernate.hbm2ddl.text", "no");
+      cfg.setProperties(props);
+
+      //
+      SchemaExport export = new SchemaExport(cfg);
+      export.create(false, true);
+
+      factory = cfg.buildSessionFactory();
+
+      /*List lst = new ArrayList();
+      Dialect dialect = Dialect.getDialect(props);
+      lst.addAll(Arrays.asList(cfg.generateDropSchemaScript(dialect)));
+      lst.addAll(Arrays.asList(cfg.generateSchemaCreationScript(dialect)));
+
+      // Open session and execute all create table statements
+      Session tmp = factory.openSession();
+      Connection conn = tmp.connection();
+      Statement st = conn.createStatement();
+      for (int i = 0; i < lst.size(); i++)
+      {
+         String s = (String) lst.get(i);
+         if (!s.startsWith("alter table"))
+         {
+            st.executeQuery(s);
+         }
+      }
+      tmp.close();*/
+
+      // Set up session and tx
+      session = factory.openSession();
+      tx = session.beginTransaction();
+
+      // Populate
+      populate();
+      nextSession();
+
+      // Setup forums module
+      forumsModule = new ForumsModuleImpl()
+      {
+         protected Session getSession()
+         {
+            return session;
+         }
+      };
+
+
+   }
+
+   protected void tearDown() throws Exception
+   {
+      tx.commit();
+      session.close();
+      factory.close();
+   }
+
+   protected void nextSession() throws Exception
+   {
+      tx.commit();
+      session.close();
+      session = factory.openSession();
+      tx = session.beginTransaction();
+   }
+
+   protected void populate() throws Exception
+   {
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/ForumsModelTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/PostModelTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/PostModelTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/PostModelTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,183 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import org.jboss.portlet.forums.impl.TopicImpl;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+import org.jboss.portlet.forums.impl.CategoryImpl;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Category;
+import org.jboss.portal.core.modules.ModuleException;
+
+
+import java.util.Date;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.comboleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2408 $
+ */
+
+public class PostModelTestCase extends ForumsModelTestCase
+{
+   public PostModelTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testWholeTreeSavedTestCase()
+   {
+      Set namesSet = new HashSet();
+      try
+      {
+      	 /* Luca Stancapiano - findCategories method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List categories = forumsModule.findCategories(new Integer(1));
+         for (Iterator ci = categories.iterator(); ci.hasNext();)
+         {
+            Category category = (Category)ci.next();
+            namesSet.add(category.getTitle());
+            List forums = category.getForums();
+            for (Iterator fi = forums.iterator(); fi.hasNext();)
+            {
+               Forum forum = (Forum)fi.next();
+               namesSet.add(forum.getName());
+               System.out.println("There are : " + forums.size() + " forums found");
+               List topics = forum.getTopics();
+               System.out.println("There are : " + topics.size() + " topics found");
+               for (Iterator ti = topics.iterator(); ti.hasNext();)
+               {
+                  Topic topic = (Topic)ti.next();
+                  System.out.println("Processing topic subject: " + topic.getSubject());
+                  Iterator pi = topic.getPosts().iterator();
+                  System.out.println("Number of posts in topic: " + topic.getPosts().size());
+                  for (; pi.hasNext();)
+                  {
+                     System.out.println("Processing post");
+
+                     Post post = (Post)pi.next();
+                     namesSet.add(post.getMessage().getSubject());
+                  }
+               }
+            }
+         }
+
+         Set expectedSubjectSet = new HashSet();
+         expectedSubjectSet.add("Sample Category");
+         expectedSubjectSet.add("Sample Forum");
+         expectedSubjectSet.add("subject1");
+         expectedSubjectSet.add("subject2");
+         assertEquals(expectedSubjectSet, namesSet);
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+
+   public void testOnlyPostDeleteTestCase()
+   {
+
+      try
+      {
+       	 /* Luca Stancapiano - findPosts method need to a forumInstanceId argument 
+	        to take only categories of a specific forum instance 
+	     */
+         List posts = forumsModule.findPosts(new Integer(1));
+         System.out.println("There are : " + posts.size() + " posts found");
+         for (Iterator ti = posts.iterator(); ti.hasNext();)
+         {
+            Post post = (Post)ti.next();
+            forumsModule.removePost(post);
+         }
+     	 /* Luca Stancapiano - findPosts method need to a forumInstanceId argument 
+            to take only categories of a specific forum instance 
+         */
+         posts = forumsModule.findPosts(new Integer(1));
+         assertEquals(posts.size(), 0);
+         //clean up
+     	 /* Luca Stancapiano - findCategories method need to a forumInstanceId argument 
+           to take only categories of a specific forum instance 
+         */
+         List categories = forumsModule.findCategories(new Integer(1));
+         for (Iterator ci = categories.iterator(); ci.hasNext();)
+         {
+            Category category = (Category)ci.next();
+            forumsModule.removeCategory(category);
+         }
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   protected void populate() throws Exception
+   {
+      Topic topic1 = new TopicImpl();
+      //topic1.setPosts(new ArrayList());
+      topic1.setSubject("sample subject");
+
+      //topic1.set
+      Post post1 = new PostImpl();
+      post1.setCreateDate(new Date());
+      post1.setMessage(new MessageImpl());
+      Message message1 = new MessageImpl();
+      message1.setSubject("subject1");
+      post1.setMessage(message1);
+      Post post2 = new PostImpl();
+      post2.setCreateDate(new Date());
+      Message message2 = new MessageImpl();
+      message2.setSubject("subject2");
+      post2.setMessage(message2);
+
+      topic1.addPost(post1);
+      topic1.addPost(post2);
+
+      Forum forum1 = new ForumImpl();
+
+      forum1.addTopic(topic1);
+      forum1.setName("Sample Forum");
+
+      Category category1 = new CategoryImpl();
+      category1.addForum(forum1);
+      category1.setTitle("Sample Category");
+
+
+      session.save(category1);
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/PostModelTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TestConstants.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TestConstants.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TestConstants.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,140 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:">Martin Giljohann</a>
+ * @version $Revision: 2058 $
+ */
+
+public interface TestConstants
+{
+   int FLOOD_INTERVAL = 30;
+
+   String PORTAL_URL = "http://localhost:8080/portal";
+
+   String PORTAL_MAIN_BEGIN = "/index.html";
+
+   String PORTAL_LOGIN_TEXT_LINK = "Standard Login";
+
+   String PORTAL_LOGOUT_TEXT_LINK = "Logout";
+
+   String PORTAL_FORUMS_TEXT_LINK = "forums";
+   
+   String PORTAL_FORUMS_MAIN_MAXIMIZED_URL = PORTAL_URL +"/index.html?ctrl:cmd=nav&ctrl:windowstate=maximized&ctrl:window=default.forums.ForumsPortletWindow";
+   
+   String PORTAL_FORUMS_MAIN_MINIMIZED_URL = PORTAL_URL +"/index.html?ctrl:cmd=nav&ctrl:windowstate=minimized&ctrl:window=default.forums.ForumsPortletWindow";
+   
+   String PORTAL_FORUMS_MAIN_EDIT_URL = PORTAL_URL +"/index.html?ctrl:cmd=nav&ctrl:mode=edit&ctrl:window=default.forums.ForumsPortletWindow";
+   
+   String PORTAL_FORUMS_MAIN_NORMAL_URL = PORTAL_URL +"/index.html?ctrl:cmd=nav&ctrl:windowstate=normal&ctrl:window=default.forums.ForumsPortletWindow";
+
+   String PORTAL_LOGIN_USERNAME_FORM_ELEMENT = "j_username";
+
+   String PORTAL_LOGIN_PASSWORD_FORM_ELEMENT = "j_password";
+
+   String ADMIN_PANEL_TEXT_LINK = "Go to Administration Panel";
+
+   String FORUM_1_TEXT_LINK = "First forum";
+
+   String FORUM_2_TEXT_LINK = "Second forum";
+
+   String MODE_EDIT_IMAGE_LINK = "edit.gif";
+
+   String MODE_VIEW_IMAGE_LINK = "view.gif";
+
+   String MODE_NORMAL_IMAGE_LINK = "normal.gif";
+
+   String MODE_MAXIMIZE_IMAGE_LINK = "maximize.gif";
+
+   String MODE_MINIMIZE_IMAGE_LINK = "minimize.gif";
+
+   String PREFERENCES_POST_PER_TOPIC_FORM_ELEMENT = "postspertopic";
+
+   String PREFERENCES_TOPIC_PER_FORUM_FORM_ELEMENT = "topicsperforum";
+
+   String WATCHED_FORUMS_TEXT_LINK = "Watched Forums";
+
+   String CATEGORY_1_TEXT_LINK = "Dummy demo category";
+
+   String NEW_TOPIC_IMAGE_LINK = "post.gif";
+
+   String POST_REPLY_IMAGE_LINK = "reply.gif";
+
+   String POST_QUOTE_IMAGE_LINK = "icon_quote.gif";
+
+   String POST_EDIT_IMAGE_LINK = "icon_edit.gif";
+
+   String POST_DELETE_IMAGE_LINK = "icon_delete.gif";
+
+   String POST_SUBJECT_FORM_ELEMENT = "subject";
+
+   String POST_MESSAGE_FORM_ELEMENT = "message";
+
+   String POST_SUBMIT = "post";
+
+   String TOPIC_TYPE_FORM_ELEMENT = "topictype";
+
+   String INSTANT_REPLY_MESSAGE_FORM_ELEMENT = "message";
+
+   String POLL_TITLE_FORM_ELEMENT = "poll_title";
+
+   String POLL_ADD_OPTION_FORM_ELEMENT = "add_poll_option_text";
+
+   String POLL_ADD_OPTION_SUBMIT = "add_poll_option";
+
+   String POLL_OPTION_UPDATE_SUBMIT = "edit_poll_option";
+
+   String POLL_OPTION_1_DELETE_SUBMIT = "del_poll_option[0]";
+
+   String POLL_OPTION_2_DELETE_SUBMIT = "del_poll_option[1]";
+
+   String POLL_OPTION_3_DELETE_SUBMIT = "del_poll_option[2]";
+
+   String POLL_OPTION_4_DELETE_SUBMIT = "del_poll_option[3]";
+
+   String POLL_OPTION_1_TEXT_FORM_ELEMENT = "poll_option_text[0]";
+
+   String POLL_OPTION_2_TEXT_FORM_ELEMENT = "poll_option_text[1]";
+
+   String POLL_OPTION_3_TEXT_FORM_ELEMENT = "poll_option_text[2]";
+
+   String POLL_OPTION_4_TEXT_FORM_ELEMENT = "poll_option_text[3]";
+
+   String POLL_VOTE_RADIO_FORM_ELEMENT = "vote_id";
+
+   String POLL_VIEW_RESULTS_TEXT_LING = "View Results";
+
+   String POLL_VOTE_SUBMIT_SUBMIT = "submit";
+
+   String ADMIN_CATEGORY_1_EDIT_URL = PORTAL_URL + "/auth/index.html?ctrl:id=window.default.ForumsPortletWindow&ctrl:type=action&op=admin_forums&c=1&mode=editcat";
+
+   String ADMIN_CATEGORY_EDIT_SUBMIT = "submit";
+
+   String ADMIN_CATEGORY_EDIT_NAME_FORM_ELEMENT = "cat_title";
+
+   String ADMIN_FORUM_1_EDIT_URL = PORTAL_URL + "/auth/index.html?ctrl:id=window.default.ForumsPortletWindow&ctrl:type=render&op=showAddEditForum&f=1&mode=editforum";
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TestConstants.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TopicModelTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TopicModelTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TopicModelTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import org.jboss.portlet.forums.impl.TopicImpl;
+import org.jboss.portlet.forums.impl.PostImpl;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.model.Post;
+import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.model.Message;
+import org.jboss.portal.core.modules.ModuleException;
+
+import java.util.Date;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.comboleslaw.dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 2408 $
+ */
+
+public class TopicModelTestCase extends ForumsModelTestCase
+{
+   public TopicModelTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testTopicSavedTestCase()
+   {
+      Set subjectSet = new HashSet();
+      try
+      {
+       	 /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+            to take only categories of a specific forum instance 
+         */
+         List topics = forumsModule.findTopics(new Integer(1));
+         System.out.println("There are : " + topics.size() + " topics found");
+         for (Iterator ti = topics.iterator(); ti.hasNext();)
+         {
+            Topic topic = (Topic)ti.next();
+            System.out.println("Processing topic subject: " + topic.getSubject());
+            Iterator pi = topic.getPosts().iterator();
+            System.out.println("Number of posts in topic: " + topic.getPosts().size());
+            for (; pi.hasNext();)
+            {
+               System.out.println("Processing post");
+
+               Post post = (Post)pi.next();
+               subjectSet.add(post.getMessage().getSubject());
+            }
+
+         }
+         Set expectedSubjectSet = new HashSet();
+         expectedSubjectSet.add("subject1");
+         expectedSubjectSet.add("subject2");
+         assertEquals(expectedSubjectSet, subjectSet);
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public void testLastPostTestCase()
+   {
+      try
+      {
+         /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+            to take only categories of a specific forum instance 
+         */
+         List topics = forumsModule.findTopics(new Integer(1));
+         //won't do it cleanl as there should be only one topic in db
+         Topic topic = (Topic)topics.iterator().next();
+         String subject = topic.getLastPost().getMessage().getSubject();
+         String expectedSubject = "subject2";
+         assertEquals(subject, expectedSubject);
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public void testTopicDeleteTestCase()
+   {
+
+      try
+      {
+         /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+            to take only categories of a specific forum instance 
+         */
+         List topics = forumsModule.findTopics(new Integer(1));
+         System.out.println("There are : " + topics.size() + " topics found");
+         for (Iterator ti = topics.iterator(); ti.hasNext();)
+         {
+            Topic topic = (Topic)ti.next();
+            forumsModule.removeTopic(topic);
+         }
+      	 /* Luca Stancapiano - findTopics method need to a forumInstanceId argument 
+           to take only categories of a specific forum instance 
+         */
+         topics = forumsModule.findTopics(new Integer(1));
+         assertEquals(topics.size(), 0);
+
+      }
+      catch (ModuleException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   protected void populate() throws Exception
+   {
+      Topic topic1 = new TopicImpl();
+      //topic1.setPosts(new ArrayList());
+      topic1.setSubject("sample subject");
+
+      //topic1.set
+      Post post1 = new PostImpl();
+      post1.setCreateDate(new Date());
+      post1.setMessage(new MessageImpl());
+      Message message1 = new MessageImpl();
+      message1.setSubject("subject1");
+      post1.setMessage(message1);
+      Post post2 = new PostImpl();
+      post2.setCreateDate(new Date());
+      Message message2 = new MessageImpl();
+      message2.setSubject("subject2");
+      post2.setMessage(message2);
+
+      topic1.addPost(post1);
+      topic1.addPost(post2);
+
+      session.save(topic1);
+   }
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/TopicModelTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/UserTestCase.java
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/UserTestCase.java	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/UserTestCase.java	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,198 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.test.forums;
+
+import java.util.Random;
+
+import org.dbunit.database.IDatabaseConnection;
+import org.dbunit.dataset.IDataSet;
+import org.dbunit.operation.DatabaseOperation;
+import org.jboss.portal.test.core.Utils;
+
+import net.sourceforge.jwebunit.WebTestCase;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
+ * @version $Revision: 2058 $
+ */
+public class UserTestCase
+   extends WebTestCase implements TestConstants
+{
+   public UserTestCase(String name)
+   {
+      super(name);
+      getTestContext().setBaseUrl("http://localhost:8080/portal");
+//      getTestContext().setUserAgent("Mozilla");
+   }
+
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      // initialize your database connection here
+      IDatabaseConnection connection = Utils.getConnection();
+
+      // initialize your dataset here
+      IDataSet dataSet = Utils.getDataSet("resources/test/forums.xml");
+
+      try
+      {
+         Utils.resetAutoIncrement();
+         DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
+      }
+      finally
+      {
+         connection.close();
+      }
+   }
+
+    protected String getRandomSubject () {
+        Random random = new Random ();
+        return "test topic"+Long.toString((long)(random.nextFloat()*10000000L));
+    }
+    
+     protected String getRandomMessage () {
+         Random random = new Random ();
+         return "my message"+Long.toString((long)(random.nextFloat()*10000000000L));
+     }
+
+   public void loginUser()
+   {
+      beginAt("/index.html");
+      clickLink("standardlogin");
+      setFormElement("j_username", "user");
+      setFormElement("j_password", "user");
+      submit();
+   }
+
+   public void testReadIndex()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      assertTextPresent("Dummy demo category");
+      assertTextPresent("First forum");
+      assertTextPresent("Second forum");
+      assertLinkNotPresent("newTopic");
+   }
+
+   public void testReadForum()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      assertTextPresent("First forum");
+      assertTextPresent("Page <b>1</b> of");
+      assertLinkPresent("newTopic");
+   }
+
+   public void testPostTopic()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      String newRandomSubject = getRandomSubject();
+      String newRandomMessage = getRandomMessage();
+      setFormElement("subject", newRandomSubject);
+      setFormElement("message", newRandomMessage);
+      submit("post");
+      assertLinkPresentWithText(newRandomSubject);
+      clickLinkWithText(newRandomSubject);
+      assertTextPresent(newRandomMessage);
+   }
+
+   /**
+    * Test page navigation
+    * This test suppose that there are 10 topics per page
+    */
+   public void testPost11Topics()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      String newRandomSubject = getRandomSubject();
+      String newRandomMessage = getRandomMessage();
+      setFormElement("subject", newRandomSubject);
+      setFormElement("message", newRandomMessage);
+      submit("post");
+      
+      for (int i = 0; i < 10; i++)
+      {
+         String newRandomSubjectT =  getRandomSubject();
+         String newRandomMessageT = getRandomMessage();
+         clickLink("newTopic");
+         setFormElement("subject", newRandomSubjectT);
+         setFormElement("message", newRandomMessageT);
+         /*try  IT DOESN'T WORK WITH FLOOD INTERCEPTOR TURNED ON
+         {
+            Thread.sleep(30 * 1000);
+         }
+         catch (InterruptedException e)
+         {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+         }*/
+         submit("post");
+         
+      }
+      assertLinkPresentWithText("Next");
+      clickLinkWithText("Next");
+      assertTextPresent(newRandomSubject);
+      clickLinkWithText(newRandomSubject);
+      assertTextPresent(newRandomMessage);
+
+   }
+
+   public void testReplyTopic()
+   {
+      loginUser();
+      clickLinkWithText("forums");
+      clickLinkWithText("First forum");
+      clickLink("newTopic");
+      String newRandomSubject = getRandomSubject();
+      String newRandomMessage = getRandomMessage();
+      setFormElement("subject", newRandomSubject);
+      setFormElement("message", newRandomMessage);
+      submit("post");
+      clickLinkWithText(newRandomSubject);
+      clickLink("postReply");
+      newRandomMessage = getRandomMessage();
+      assertFormElementEquals("subject", "Re: "+newRandomSubject);
+      setFormElement("message", newRandomMessage);
+      // For flood control
+      /*try
+      {
+         Thread.sleep(30 * 1000);
+      }
+      catch (InterruptedException e)
+      {
+         // TODO Auto-generated catch block
+         e.printStackTrace();
+      }*/
+      submit("post");
+      assertTextPresent("Re: "+newRandomSubject);
+      assertTextPresent(newRandomMessage);
+   }
+
+
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/main/org/jboss/portlet/test/forums/UserTestCase.java
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/jboss-portal/default-object.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/jboss-portal/default-object.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/jboss-portal/default-object.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,519 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+   <deployment>
+      <parent-ref/>
+      <if-exists>keep</if-exists>
+      <portal>
+         <portal-name>default</portal-name>
+         <properties>
+            <!--
+              | Set the layout for the default portal, see also portal-layouts.xml.
+              -->
+            <property>
+               <name>layout.id</name>
+               <value>generic</value>
+            </property>
+            <!--
+              | Set the theme for the default portal, see also portal-themes.xml.
+              -->
+            <property>
+               <name>theme.id</name>
+               <value>Nphalanx</value>
+            </property>
+            <!--
+              | Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
+              -->
+            <property>
+               <name>theme.renderSetId</name>
+               <value>divRenderer</value>
+            </property>
+            <!--
+              | Set the default strategy name (used by the strategy interceptor), see also portal-strategies.xml
+              -->
+            <property>
+               <name>layout.strategyId</name>
+               <value>maximizedRegion</value>
+            </property>
+            <!--
+              | The default page name, if the property is not explicited then the default page name is "default"
+              -->
+            <property>
+               <name>portal.defaultObjectName</name>
+               <value>default</value>
+            </property>
+         </properties>
+         <supported-modes>
+            <mode>view</mode>
+            <mode>edit</mode>
+            <mode>help</mode>
+         </supported-modes>
+         <supported-window-states>
+            <window-state>normal</window-state>
+            <window-state>minimized</window-state>
+            <window-state>maximized</window-state>
+         </supported-window-states>
+         <page>
+            <page-name>default</page-name>
+            <window>
+               <window-name>NavigationPortletWindow</window-name>
+               <instance-ref>NavigationPortletInstance</instance-ref>
+               <region>navigation</region>
+               <height>0</height>
+               <!-- keep portal and page properties for this window -->
+               <properties>
+                  <!-- use the window renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.windowRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the decoration renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.decorationRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the portlet renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.portletRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+               </properties>
+            </window>
+            <window>
+               <window-name>DefaultCMSPortletWindow</window-name>
+               <instance-ref>DefaultCMSPortletInstance</instance-ref>
+               <region>center</region>
+               <height>0</height>
+            </window>
+            <window>
+               <window-name>UserPortletWindow</window-name>
+               <instance-ref>UserPortletInstance</instance-ref>
+               <region>left</region>
+               <height>0</height>
+            </window>
+            <window>
+               <window-name>CatalogPortletWindow</window-name>
+               <instance-ref>CatalogPortletInstance</instance-ref>
+               <region>left</region>
+               <height>1</height>
+            </window>
+            <window>
+               <window-name>ThemeSelectorWindow</window-name>
+               <instance-ref>ThemeSelectorInstance</instance-ref>
+               <region>left</region>
+               <height>2</height>
+            </window>
+         </page>
+         <page>
+            <page-name>forums</page-name>
+            <properties>
+            <!-- set a difference layout for this page -->
+               <!--
+                  <property>
+                     <name>theme.layout</name>
+                     <value>industrial</value>
+                  </property>
+                  <property>
+                     <name>theme.strategy</name>
+                     <value>maximizedRegion</value>
+                  </property>
+                  <property>
+                     <name>theme.theme</name>
+                     <value>industrial</value>
+                  </property>
+               -->
+            </properties>
+            <window>
+               <window-name>NavigationPortletWindow</window-name>
+               <instance-ref>NavigationPortletInstance</instance-ref>
+               <region>navigation</region>
+               <height>0</height>
+               <!-- overwrite portal and page properties for this window -->
+               <properties>
+                  <!-- use the window renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.windowRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the decoration renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.decorationRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the portlet renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.portletRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+               </properties>
+            </window>
+            <window>
+               <window-name>UserPortletWindow</window-name>
+               <instance-ref>UserPortletInstance</instance-ref>
+               <region>left</region>
+               <height>0</height>
+            </window>
+            <window>
+               <window-name>CatalogPortletWindow</window-name>
+               <instance-ref>CatalogPortletInstance</instance-ref>
+               <region>left</region>
+               <height>1</height>
+            </window>
+            <window>
+               <window-name>forums</window-name>
+               <instance-ref>ForumsPortletInstance</instance-ref>
+               <region>center</region>
+               <height>0</height>
+            </window>
+         </page>
+         <page>
+            <page-name>jsfForums</page-name>
+            <properties>
+            <!-- set a difference layout for this page -->
+               <!--
+                  <property>
+                     <name>theme.layout</name>
+                     <value>industrial</value>
+                  </property>
+                  <property>
+                     <name>theme.strategy</name>
+                     <value>maximizedRegion</value>
+                  </property>
+                  <property>
+                     <name>theme.theme</name>
+                     <value>industrial</value>
+                  </property>
+               -->
+            </properties>
+            <window>
+               <window-name>NavigationPortletWindow</window-name>
+               <instance-ref>NavigationPortletInstance</instance-ref>
+               <region>navigation</region>
+               <height>0</height>
+               <!-- overwrite portal and page properties for this window -->
+               <properties>
+                  <!-- use the window renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.windowRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the decoration renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.decorationRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+                  <!-- use the portlet renderer from the emptyRenderer renderSet -->
+                  <property>
+                     <name>theme.portletRendererId</name>
+                     <value>emptyRenderer</value>
+                  </property>
+               </properties>
+            </window>
+            <window>
+               <window-name>UserPortletWindow</window-name>
+               <instance-ref>UserPortletInstance</instance-ref>
+               <region>left</region>
+               <height>0</height>
+            </window>
+            <window>
+               <window-name>CatalogPortletWindow</window-name>
+               <instance-ref>CatalogPortletInstance</instance-ref>
+               <region>left</region>
+               <height>1</height>
+            </window>
+            <window>
+               <window-name>jsfForums</window-name>
+               <instance-ref>JSFForumsPortletInstance</instance-ref>
+               <region>center</region>
+               <height>0</height>
+            </window>
+         </page>
+      </portal>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <parent-ref>default</parent-ref>
+      <page>
+         <page-name>CMS Manager</page-name>
+         <window>
+            <window-name>NavigationPortletWindow</window-name>
+            <instance-ref>NavigationPortletInstance</instance-ref>
+            <region>navigation</region>
+            <height>0</height>
+            <!-- keep portal and page properties for this window -->
+            <properties>
+               <!-- use the window renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.windowRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the decoration renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.decorationRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the portlet renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.portletRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+            </properties>
+         </window>
+         <window>
+            <window-name>UserPortletWindow</window-name>
+            <instance-ref>UserPortletInstance</instance-ref>
+            <region>left</region>
+            <height>0</height>
+         </window>
+         <window>
+            <window-name>CatalogPortletWindow</window-name>
+            <instance-ref>CatalogPortletInstance</instance-ref>
+            <region>left</region>
+            <height>1</height>
+         </window>
+         <window>
+            <window-name>CMSAdminPortletWindow</window-name>
+            <instance-ref>CMSAdminPortletInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </page>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <parent-ref>default</parent-ref>
+      <page>
+         <page-name>management</page-name>
+         <window>
+            <window-name>NavigationPortletWindow</window-name>
+            <instance-ref>NavigationPortletInstance</instance-ref>
+            <region>navigation</region>
+            <height>0</height>
+            <!-- keep portal and page properties for this window -->
+            <properties>
+               <!-- use the window renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.windowRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the decoration renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.decorationRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the portlet renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.portletRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+            </properties>
+         </window>
+         <window>
+            <window-name>UserPortletWindow</window-name>
+            <instance-ref>UserPortletInstance</instance-ref>
+            <region>left</region>
+            <height>0</height>
+         </window>
+         <window>
+            <window-name>RolePortletWindow</window-name>
+            <instance-ref>RolePortletInstance</instance-ref>
+            <region>left</region>
+            <height>1</height>
+         </window>
+         <window>
+            <window-name>CatalogPortletWindow</window-name>
+            <instance-ref>CatalogPortletInstance</instance-ref>
+            <region>left</region>
+            <height>2</height>
+         </window>
+         <window>
+            <window-name>ManagementPortletWindow</window-name>
+            <instance-ref>ManagementPortletInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </page>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <parent-ref>default.default</parent-ref>
+      <page>
+         <page-name>Secure Policy Config</page-name>
+         <window>
+            <window-name>NavigationPortletWindow</window-name>
+            <instance-ref>NavigationPortletInstance</instance-ref>
+            <region>navigation</region>
+            <height>0</height>
+            <!-- keep portal and page properties for this window -->
+            <properties>
+               <!-- use the window renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.windowRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the decoration renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.decorationRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+               <!-- use the portlet renderer from the emptyRenderer renderSet -->
+               <property>
+                  <name>theme.portletRendererId</name>
+                  <value>emptyRenderer</value>
+               </property>
+            </properties>
+         </window>
+         <window>
+            <window-name>CatalogPortletWindow</window-name>
+            <instance-ref>CatalogPortletInstance</instance-ref>
+            <region>left</region>
+            <height>0</height>
+         </window>
+         <window>
+            <window-name>PolicyConfiguratorWindow</window-name>
+            <instance-ref>PolicyConfiguratorPortletInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </page>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <parent-ref>default.CMS Manager</parent-ref>
+      <window>
+         <window-name>CatalogPortletWindow</window-name>
+         <instance-ref>CatalogPortletInstance</instance-ref>
+         <region>left</region>
+         <height>1</height>
+      </window>
+   </deployment>
+
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>PolicyConfiguratorPortletInstance</instance-name>
+         <component-ref>portal.PolicyConfiguratorPortlet</component-ref>
+         <!-- allow access to this instance only to Admins -->
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>DefaultCMSPortletInstance</instance-name>
+         <component-ref>portal.CMSPortlet</component-ref>
+         <preferences>
+            <!-- Indicate that  -->
+            <preference>
+               <name>linkMode</name>
+               <value>cms</value>
+               <read-only>true</read-only>
+            </preference>
+         </preferences>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>CMSAdminPortletInstance</instance-name>
+         <component-ref>portal.CMSAdminPortlet</component-ref>
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>ManagementPortletInstance</instance-name>
+         <component-ref>portal.ManagementPortlet</component-ref>
+         <security-constraint>
+            <policy-permission>
+               <role-name>Admin</role-name>
+               <action-name>view</action-name>
+            </policy-permission>
+         </security-constraint>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>NavigationPortletInstance</instance-name>
+         <component-ref>portal.NavigationPortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>UserPortletInstance</instance-name>
+         <component-ref>portal.UserPortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>RolePortletInstance</instance-name>
+         <component-ref>portal.RolePortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>CatalogPortletInstance</instance-name>
+         <component-ref>portal.CatalogPortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>ThemePortletInstance</instance-name>
+         <component-ref>portal.ThemeManager</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>keep</if-exists>
+      <instance>
+         <instance-name>ThemeSelectorInstance</instance-name>
+         <component-ref>portal.ThemeSelectorPortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>overwrite</if-exists>
+      <instance>
+         <instance-name>ForumsPortletInstance</instance-name>
+         <component-ref>forums.ForumsPortlet</component-ref>
+      </instance>
+   </deployment>
+   <deployment>
+      <if-exists>overwrite</if-exists>
+      <instance>
+         <instance-name>JSFForumsPortletInstance</instance-name>
+         <component-ref>forums.JSFForumsPortlet</component-ref>
+      </instance>
+   </deployment>
+</deployments>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/application.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/application.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application>
+   <display-name>JBoss Forums</display-name>
+   <module>
+           <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+	   <java>jsf-facelets.jar</java>
+   </module>
+   <module>
+	   <java>el-api.jar</java>
+   </module>
+   <module>
+	   <java>el-ri.jar</java>
+   </module>
+   <module>
+	   <java>tomahawk.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-impl.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-api.jar</java>
+   </module>
+   
+   <module>
+       <java>lucene-core.jar</java>
+   </module>
+   <module>
+       <java>hibernate-search.jar</java>
+   </module>
+   <module>
+       <java>ejb3-persistence.jar</java>
+   </module>
+   <module>
+       <java>hibernate-commons-annotations.jar</java>
+   </module>
+   
+   <module>
+	   <java>commons-collections.jar</java>
+   </module>
+   <module>
+	   <java>commons-beanutils.jar</java>
+   </module>
+   <module>
+	   <java>commons-el.jar</java>
+   </module>
+   <module>
+	   <java>commons-digester-1.6.jar</java>
+   </module>
+   <module>
+	   <java>commons-codec.jar</java>
+   </module>
+   <module>
+	   <java>portal-faces-lib.jar</java>
+   </module>
+   <module>
+	   <java>jsf-example.jar</java>
+   </module>
+   <module>
+      <web>
+         <web-uri>portal-forums.war</web-uri>
+         <!--context-root>/forums</context-root-->
+      </web>
+   </module>   
+</application>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-app>
+   <loader-repository> 
+         forums.jboss.com:loader=jboss-forums-sar 
+      <loader-repository-config>
+         java2ParentDelegation=false
+      </loader-repository-config> 
+   </loader-repository>
+   <module>
+	   <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+      <service>portal-forums.sar</service>
+   </module>
+   <module>
+	   <service>portal-forums-authz-plugin.sar</service>
+   </module>
+   <module>
+      <service>jboss-service.xml</service>
+   </module>
+</jboss-app>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/security-config.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/security-config.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/META-INF/security-config.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,37 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+      "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The JAAS login configuration file for the java:/jaas/jbossweb-form-auth
+security domain used by the security-spec test case
+-->
+<!--<policy>
+    <application-policy name="forums">       
+       <authentication>
+	       <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
+            <module-option name="unauthenticatedIdentity">guest</module-option>
+            <module-option name="hashAlgorithm">MD5</module-option>
+            <module-option name="hashEncoding">HEX</module-option>
+            <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+            <module-option name="additionalRole">Authenticated</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+    </application-policy>
+</policy>-->
+<policy>
+	<application-policy name="forums">       
+       <authentication>
+          <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
+            <module-option name="unauthenticatedIdentity">guest</module-option>
+            <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+            <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+            <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule</module-option>
+            <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule</module-option>
+            <module-option name="additionalRole">Authenticated</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+       </authentication>
+    </application-policy>
+</policy>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ear/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>   
+   <!-- hooking in a login module for the standalone version of JSF Forums -->
+    <!-- The custom JAAS login configuration that installs 
+       a Configuration capable of dynamically updating the
+       config settings
+   -->
+   <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
+      name="jboss.security.tests:service=LoginConfig">
+      <attribute name="AuthConfig">META-INF/security-config.xml</attribute>
+      <depends optional-attribute-name="LoginConfigService">
+         jboss.security:service=XMLLoginConfig
+      </depends>
+      <depends optional-attribute-name="SecurityManagerService">
+         jboss.security:service=JaasSecurityManager
+      </depends>
+   </mbean>
+</server>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application>
+   <display-name>JBoss Forums</display-name>
+   <module>
+           <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+	   <java>jsf-facelets.jar</java>
+   </module>
+   <module>
+	   <java>el-api.jar</java>
+   </module>
+   <module>
+	   <java>el-ri.jar</java>
+   </module>
+   <module>
+	   <java>tomahawk.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-impl.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-api.jar</java>
+   </module>
+   <module>
+	   <java>commons-collections.jar</java>
+   </module>
+   <module>
+	   <java>commons-beanutils.jar</java>
+   </module>
+   <module>
+	   <java>commons-el.jar</java>
+   </module>
+   <module>
+	   <java>commons-digester-1.6.jar</java>
+   </module>
+   <module>
+	   <java>commons-codec.jar</java>
+   </module>
+   <module>
+	   <java>portal-faces-lib.jar</java>
+   </module>
+   <module>
+	   <java>jsf-example.jar</java>
+   </module>
+   <module>
+      <web>
+         <web-uri>portal-forums.war</web-uri>
+         <!--context-root>/forums</context-root-->
+      </web>
+   </module>   
+</application>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-app>
+   <loader-repository> 
+         forums.jboss.com:loader=jboss-forums-ha-sar 
+      <loader-repository-config>
+         java2ParentDelegation=false
+      </loader-repository-config> 
+   </loader-repository>
+   <module>
+	   <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+      <service>portal-forums-ha.sar</service>
+   </module>
+   <module>
+	   <service>portal-forums-authz-plugin.sar</service>
+   </module>
+   <module>
+	   <service>portal-forums-cache-plugin.sar</service>
+   </module>
+   <module>
+      <service>jboss-service.xml</service>
+   </module>
+</jboss-app>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,34 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+      "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The JAAS login configuration file for the java:/jaas/jbossweb-form-auth
+security domain used by the security-spec test case
+-->
+<!--<policy>
+    <application-policy name="forums">       
+       <authentication>
+	       <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
+            <module-option name="unauthenticatedIdentity">guest</module-option>
+            <module-option name="hashAlgorithm">MD5</module-option>
+            <module-option name="hashEncoding">HEX</module-option>
+            <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+            <module-option name="additionalRole">Authenticated</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+    </application-policy>
+</policy>-->
+<policy>
+	<application-policy name="forums">       
+       <authentication>
+<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             <module-option name="unauthenticatedIdentity">guest</module-option>
+	<module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+	<module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+	<module-option name="additionalRole">Authenticated</module-option>
+	<module-option name="password-stacking">useFirstPass</module-option>
+</login-module>
+</authentication>
+</application-policy>
+</policy>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>   
+   <!-- hooking in a login module for the standalone version of JSF Forums -->
+    <!-- The custom JAAS login configuration that installs 
+       a Configuration capable of dynamically updating the
+       config settings
+   -->
+   <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
+      name="jboss.security.tests:service=LoginConfig">
+      <attribute name="AuthConfig">META-INF/security-config.xml</attribute>
+      <depends optional-attribute-name="LoginConfigService">
+         jboss.security:service=XMLLoginConfig
+      </depends>
+      <depends optional-attribute-name="SecurityManagerService">
+         jboss.security:service=JaasSecurityManager
+      </depends>
+   </mbean>
+</server>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-ear/jboss-service.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application>
+   <display-name>JBoss Forums</display-name>
+   <module>
+           <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+	   <java>jsf-facelets.jar</java>
+   </module>
+   <module>
+	   <java>el-api.jar</java>
+   </module>
+   <module>
+	   <java>el-ri.jar</java>
+   </module>
+   <module>
+	   <java>tomahawk.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-impl.jar</java>
+   </module>
+   <module>
+	   <java>myfaces-api.jar</java>
+   </module>
+   <module>
+	   <java>commons-collections.jar</java>
+   </module>
+   <module>
+	   <java>commons-beanutils.jar</java>
+   </module>
+   <module>
+	   <java>commons-el.jar</java>
+   </module>
+   <module>
+	   <java>commons-digester-1.6.jar</java>
+   </module>
+   <module>
+	   <java>commons-codec.jar</java>
+   </module>
+   <module>
+	   <java>portal-faces-lib.jar</java>
+   </module>
+   <module>
+	   <java>jsf-example.jar</java>
+   </module>
+   <module>
+      <web>
+         <web-uri>portal-forums.war</web-uri>
+         <!--context-root>/forums</context-root-->
+      </web>
+   </module>   
+</application>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-app>
+   <loader-repository> 
+         forums.jboss.com:loader=jboss-forums-ha-sar 
+      <loader-repository-config>
+         java2ParentDelegation=false
+      </loader-repository-config> 
+   </loader-repository>
+   <module>
+	   <java>portal-forums-ui.jar</java>
+   </module>
+   <module>
+      <service>portal-forums-ha-jbp.sar</service>
+   </module>
+   <module>
+	   <service>portal-forums-authz-plugin.sar</service>
+   </module>
+   <module>
+      <service>jboss-service.xml</service>
+   </module>
+</jboss-app>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,34 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+      "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The JAAS login configuration file for the java:/jaas/jbossweb-form-auth
+security domain used by the security-spec test case
+-->
+<!--<policy>
+    <application-policy name="forums">       
+       <authentication>
+	       <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
+            <module-option name="unauthenticatedIdentity">guest</module-option>
+            <module-option name="hashAlgorithm">MD5</module-option>
+            <module-option name="hashEncoding">HEX</module-option>
+            <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+            <module-option name="additionalRole">Authenticated</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+    </application-policy>
+</policy>-->
+<policy>
+	<application-policy name="forums">       
+       <authentication>
+<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             <module-option name="unauthenticatedIdentity">guest</module-option>
+	<module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
+	<module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+	<module-option name="additionalRole">Authenticated</module-option>
+	<module-option name="password-stacking">useFirstPass</module-option>
+</login-module>
+</authentication>
+</application-policy>
+</policy>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>   
+   <!-- hooking in a login module for the standalone version of JSF Forums -->
+    <!-- The custom JAAS login configuration that installs 
+       a Configuration capable of dynamically updating the
+       config settings
+   -->
+   <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
+      name="jboss.security.tests:service=LoginConfig">
+      <attribute name="AuthConfig">META-INF/security-config.xml</attribute>
+      <depends optional-attribute-name="LoginConfigService">
+         jboss.security:service=XMLLoginConfig
+      </depends>
+      <depends optional-attribute-name="SecurityManagerService">
+         jboss.security:service=JaasSecurityManager
+      </depends>
+   </mbean>
+</server>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-ear/jboss-service.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean
+      code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+      name="portal.forums:service=Hibernate"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+      <attribute name="DoChecking">true</attribute>
+      <attribute name="ConfigLocation">conf/hibernate/hibernate.cfg.xml</attribute>
+      <attribute name="SetupLocation">conf/hibernate/setup.txt</attribute>
+   </mbean>
+   <mbean
+      code="org.jboss.portlet.forums.impl.ForumsModuleImpl"
+      name="portal.forums:service=Module,type=Forums"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <!-- Flood interval in seconds -->
+      <attribute name="FloodInterval">30</attribute>
+      <!-- Guest user -->
+      <attribute name="GuestUserName">guest</attribute>
+      <!-- Email address used for FROM field of email notification -->
+      <attribute name="FromAddress">portal at example.com</attribute>
+      <attribute name="JNDIName">java:portal/ForumsModule</attribute>
+      <depends optional-attribute-name="Hibernate" proxy-type="attribute">portal.forums:service=Hibernate</depends>
+   </mbean>
+<!-- configure the AuthorizationContext for this application -->
+<mbean name="portal.forums:service=AuthorizationContext"
+       code="org.jboss.portlet.forums.auth.AuthorizationContextImpl" 	
+       xmbean-dd=""
+       >
+	<!-- plug-in an AuthorizationProvider that implements the AuthorizationInterface here -->
+	<attribute name="providerImpl">org.jboss.forums.security.AuthorizationProvider</attribute>
+	<xmbean>
+		<class>org.jboss.portlet.forums.auth.AuthorizationContextImpl</class>
+		<constructor>      				
+			<name>org.jboss.portlet.forums.auth.AuthorizationContextImpl</name>
+		</constructor>
+		<attribute access="write" setMethod="setProviderImpl">
+			<name>providerImpl</name>
+			<type>java.lang.String</type>					 
+		</attribute>
+		<attribute access="read-only" >
+			<name>provider</name>
+			<type>org.jboss.portlet.forums.auth.AuthorizationInterface</type>					 
+		</attribute>
+		<operation impact="INFO">
+			<description>Method for getting Provider</description>
+			<name>provider</name>
+			<return-type>org.jboss.portlet.forums.auth.AuthorizationInterface</return-type>
+		</operation>
+		<operation>
+			<description>The start lifecycle operation</description>
+			<name>start</name>
+		</operation>
+		<operation>
+			<description>The stop lifecycle operation</description>
+			<name>stop</name>
+		</operation>		    
+	</xmbean>
+</mbean>   
+</server>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+   "-//Hibernate/Hibernate Configuration DTD//EN"
+   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+   <session-factory>
+      <property name="connection.datasource">java:@portal.datasource.name@</property>
+      <property name="show_sql">false</property>
+      <property name="format_sql">false</property>
+
+      <!-- Use the C3P0 connection pool provider --> 
+      <property name="hibernate.c3p0.min_size">5</property> 
+      <property name="hibernate.c3p0.max_size">20</property> 
+      <property name="hibernate.c3p0.timeout">300</property> 
+      <property name="hibernate.c3p0.max_statements">50</property> 
+      <property name="hibernate.c3p0.idle_test_period">3000</property> 
+
+      <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
+      <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
+         
+      <property name="hibernate.cache.use_query_cache">true</property>
+      <property name="hibernate.cache.use_second_level_cache">true</property>
+      <property name="hibernate.generate_statistics">true</property>
+      <property name="hibernate.cache.use_structured_entries">true</property>
+      <!-- Force the dialect instead of using autodetection -->
+      <!--
+      <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+      -->
+
+      <!-- Mapping files -->
+      <!-- Luca Stancapiano - I add ForumInstanceImpl to use with hibernate -->
+      <mapping resource="org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/WatchImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/Queries.hbm.xml"/>
+   </session-factory>
+</hibernate-configuration>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/setup.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/setup.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/setup.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,84 @@
+// This bsh script setup the default content of the portal.
+// It is called when the SessionFactoryBinder service has created a schema and needs to populate it
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portlet.forums.impl.CategoryImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+// Luca Stancapiano -- import
+import org.jboss.portlet.forums.impl.ForumInstanceImpl;
+
+try
+{
+   session = SessionFactory.openSession();
+   tx = session.beginTransaction();
+
+   /* Luca Stancapiano start - I add a new ForumInstanceImpl that contains all 
+      instances of categories.
+      It is the principal reference for a forum and it has the 
+      history of all forum instances in a portal */
+   ForumInstanceImpl fii = new ForumInstanceImpl();
+   fii.setId(new Integer(1));
+   fii.setName("First forum");
+   fii.setCategories(new java.util.ArrayList());
+   // Luca Stancapiano end
+
+   //
+   CategoryImpl cat = new CategoryImpl();
+   cat.setOrder(10);
+   cat.setTitle("Dummy demo category");
+   cat.setForums(new java.util.ArrayList());
+   /* Luca Stancapiano start - I add the reference of forum instance for a category. 
+      The only updates from old database to new database are this field to mark 
+      references for forum instance and the forum instance table managed by 
+      ForumInstanceImpl class through hibernate */ 
+   cat.setForumInstance(fii);
+   // Luca Stancapiano end
+
+   //
+   ForumImpl forum1 = new ForumImpl();
+   forum1.setDescription("First description");
+   forum1.setCategory(cat);
+   forum1.setLastPost(null);
+   forum1.setName("First forum");
+   forum1.setOrder(10);
+   forum1.setTopicCount(0);
+   forum1.setPostCount(0);
+   forum1.setPruneEnable(true);
+   forum1.setPruneNext(0);
+   forum1.setStatus(0);
+   //forum1.setType(0);
+   ForumImpl forum2 = new ForumImpl();
+   forum2.setDescription("Second description");
+   forum2.setCategory(cat);
+   forum2.setLastPost(null);
+   forum2.setName("Second forum");
+   forum2.setOrder(20);
+   forum2.setTopicCount(0);
+   forum2.setPostCount(0);
+   forum2.setPruneEnable(true);
+   forum2.setPruneNext(0);
+   forum2.setStatus(0);
+   //forum2.setType(0);
+
+   //
+   //cat.getForums().add(forum1);
+   //cat.getForums().add(forum2);
+   cat.addForum(forum1);
+   cat.addForum(forum2);
+
+   // Luca Stancapiano start - I save ForumInstance record and all his children records
+   fii.addCategory(cat);
+   session.save(fii);
+   session.flush();
+   // Luca Stancapiano end
+
+   //
+   session.save(cat);
+   session.flush();
+   //session.save(forum1);
+   //session.save(forum2);
+   tx.commit();
+}
+finally
+{
+   session.close();
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/setup.txt
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.AttachmentImpl"
+        table="jbp_forums_attachments"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_attachment_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-AttachmentImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="comment"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_comment"
+        />
+
+        <component
+            name="file"
+            class="org.jboss.portlet.forums.impl.UploadedFileImpl"
+        >
+        <property
+            name="contentType"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_content_type"
+        />
+
+        <property
+            name="size"
+            type="long"
+            update="true"
+            insert="true"
+            column="jbp_size"
+        />
+
+        <property
+            name="name"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_name"
+        />
+
+        <property
+            name="content"
+            type="blob"
+            update="true"
+            insert="true"
+            column="jbp_content"
+            length="100000000"
+        />
+
+        </component>
+
+        <many-to-one
+            name="post"
+            class="org.jboss.portlet.forums.impl.PostImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_post_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-AttachmentImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.CategoryImpl"
+        table="jbp_forums_categories"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-CategoryImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="forums"
+            table="jbp_forums_forums"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order asc"
+        >
+            <cache 
+                usage="transactional" 
+            />
+
+            <key
+                column="jbp_category_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumImpl"
+            />
+
+      </bag>
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+            unique="false"
+        />
+
+        <many-to-one
+            name="forumInstance"
+            class="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_instance_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-CategoryImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumImpl"
+        table="jbp_forums_forums"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="category"
+            class="org.jboss.portlet.forums.impl.CategoryImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_category_id"
+        />
+
+        <property
+            name="description"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_description"
+            unique="false"
+        />
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="topicCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_topic_count"
+            unique="false"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <bag
+            name="topics"
+            table="jbp_forums_topics"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_last_post_date asc"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="forumWatch"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+        table="jbp_forums_instances"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="assigned">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumInstanceImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <bag
+            name="categories"
+            table="jbp_forums_categories"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order"
+        >
+
+            <key
+                column="jbp_forum_instance_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.CategoryImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumInstanceImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollImpl"
+        table="jbp_forums_polls"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_poll_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <list
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <index
+                column="jbp_poll_option_position"
+            />
+
+            <composite-element
+                class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            >
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            not-null="true"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+            </composite-element>
+
+        </list>
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+        />
+
+        <property
+            name="length"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_length"
+            unique="false"
+        />
+
+        <set
+            name="voted"
+            table="jbp_forums_poll_voted"
+            lazy="true"
+            cascade="all"
+            sort="unsorted"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <element
+                column="jbp_poll_voted"
+                type="integer"
+                not-null="true"
+                unique="false"
+            />
+
+        </set>
+
+        <property
+            name="creationDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_creation_date"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PostImpl"
+        table="jbp_forums_posts"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PostImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        <property
+            name="editCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_edit_count"
+            unique="false"
+        />
+
+        <property
+            name="editDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_edit_date"
+            unique="false"
+        />
+
+        <property
+            name="createDate"
+            type="java.util.Date"
+            update="false"
+            insert="true"
+            column="jbp_create_date"
+            unique="false"
+        />
+
+        <component
+            name="message"
+            class="org.jboss.portlet.forums.impl.MessageImpl"
+        >
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+        />
+
+        <property
+            name="text"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_text"
+        />
+
+        </component>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <bag
+            name="attachments"
+            table="jbp_forums_attachments"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+        >
+
+            <key
+                column="jbp_post_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.AttachmentImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PostImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PosterImpl"
+        table="jbp_forums_posters"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PosterImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="userId"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_user_id"
+            unique="true"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PosterImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+
+	<query name="findForumByIdFetchTopics" cacheable="true"><![CDATA[select f
+                                        from ForumImpl f
+                                        left outer join fetch f.topics
+                                        where f.id = :forumId]]></query>
+	
+	<query name="findCategoryByIdFetchForums" cacheable="true"><![CDATA[from CategoryImpl as c
+                                        join fetch c.forums
+                                        where c.id=:categoryId]]></query>
+	
+	<query name="findPosterByUserId" cacheable="true"><![CDATA[from PosterImpl as u where u.userId=:userId]]></query>
+	
+	<query name="findCategories" cacheable="true"><![CDATA[from CategoryImpl as c
+							            where c.forumInstance.id = :forumInstanceId
+							            order by c.order asc]]></query>
+	
+	<query name="findCategoriesFetchForums" cacheable="true"><![CDATA[select c
+					                    from CategoryImpl as c
+					                    left outer join fetch c.forums
+					                    where c.forumInstance.id = :forumInstanceId
+					                    order by c.order asc]]></query>
+	
+	<query name="findForums" cacheable="true"><![CDATA[from ForumImpl as f
+							            where f.category.forumInstance.id = :forumInstanceId
+							            order by f.order asc]]></query>
+	
+	<query name="findForumsByCategoryId" cacheable="true"><![CDATA[from ForumImpl as f where f.category=:categoryId order by f.order asc]]></query>
+	
+	<query name="findAnnouncements" cacheable="true"><![CDATA[from TopicImpl as t where t.forum=:forumid and t.type = :type order by t.lastPostDate]]></query>
+	
+	<query name="findTopics" cacheable="true"><![CDATA[from TopicImpl as t
+					                    where t.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicsTypeasc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate asc]]></query>
+                                        
+	<query name="findTopicsTypedesc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsForumasc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate asc]]></query>
+	
+	<query name="findTopicsForumdesc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHot" cacheable="true"><![CDATA[from TopicImpl as t where t.replies > :replies
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsByLatestPosts" cacheable="true"><![CDATA[from TopicImpl as t where t.forum.category.forumInstance.id = :forumInstanceId order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHottest" cacheable="true"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.replies desc]]></query>
+	
+	<query name="findTopicsMostViewed" cacheable="true"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.viewCount desc]]></query>
+	
+	<query name="getLastCategoryOrder" cacheable="true"><![CDATA[select max(c.order) from CategoryImpl as c where c.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="getLastForumOrder" cacheable="true"><![CDATA[select max(f.order) from ForumImpl as f where f.category = :categoryId]]></query>
+	
+	<query name="findTopicsForumNoOrder" cacheable="true"><![CDATA[from TopicImpl as t where t.forum = :forumid]]></query>
+	
+	<query name="findPosts" cacheable="true"><![CDATA[from PostImpl as p
+					                    where p.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsByTopicIdasc" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate asc]]></query>
+	
+	<query name="findPostsByTopicIddesc" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate desc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersasc" cacheable="true"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersdesc" cacheable="true"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostIdsasc" cacheable="true"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostIdsdesc" cacheable="true"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostsByTopicIdNoOrder" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId]]></query>
+	
+	<query name="findLastPostDateForUser" cacheable="true"><![CDATA[select max(p.createDate) from PostImpl as p where p.poster.userId = :userId]]></query>
+	
+	<query name="findLastPost" cacheable="true"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.createDate = (
+                                           select DISTINCT MAX(topic.lastPostDate)
+                                           from TopicImpl as topic
+                                           where topic.forum = :forumId
+                                        )]]></query>
+	
+	<query name="findFirstPost" cacheable="true"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.topic = :topicId
+                                        AND p.createDate = :lastPostDate]]></query>
+	
+	<query name="findLastPostOrder" cacheable="true"><![CDATA[from PostImpl as p where p.topic  = :topicId order by p.createDate desc]]></query>
+	
+	<query name="findLastPostsOfTopics" cacheable="true"><![CDATA[select topic.lastPostDate as maxDate , topic.id
+                                        from TopicImpl as topic
+                                        where topic.forum.id = :forumId]]></query>
+	
+	<query name="findLastPostsOfTopicsCreateDate" cacheable="true"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findLastPostsOfForums" cacheable="true"><![CDATA[select MAX(topic.lastPostDate) as maxDate , topic.forum.id
+                                        from TopicImpl as topic
+      							        where topic.forum.category.forumInstance.id = :forumInstanceId
+                                        group by topic.forum.id]]></query>
+	
+	<query name="findLastPostsOfForumsCreateDate" cacheable="true"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findForumWatchByUser" cacheable="true"><![CDATA[from ForumWatchImpl as f where f.poster.userId = :userId
+					                    and f.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchedByUser" cacheable="true"><![CDATA[select f
+					                    from ForumImpl as f where f.id IN (
+					                    select fw.forum.id from ForumWatchImpl fw
+					                    where fw.poster.userId = :userId )
+					                    and f.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicWatchedByUser" cacheable="true"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatchedByUserCreateDate" cacheable="true"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and (t.lastPostDate > :datePoint)
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatches" cacheable="true"><![CDATA[select tw.topic.id , tw
+					                    from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId
+					                    and tw.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsFromForumasc" cacheable="true"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromForumdesc" cacheable="true"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsFromCategoryasc" cacheable="true"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromCategorydesc" cacheable="true"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsOrderasc" cacheable="true"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsOrderdesc" cacheable="true"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findForumWatchById" cacheable="true"><![CDATA[from ForumWatchImpl as f where f.id = :forumWatchId]]></query>
+	
+	<query name="findForumWatches" cacheable="true"><![CDATA[select fw.forum.id , fw
+                                        from ForumWatchImpl fw
+                                        where fw.poster.userId = :userId
+			                            and fw.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchByUserAndForum" cacheable="true"><![CDATA[from ForumWatchImpl as fw
+                                        where fw.poster.userId = :userId
+                                        and fw.forum.id= :forumId]]></query>
+	
+	<query name="findTopicWatchByUserAndTopic" cacheable="true"><![CDATA[from TopicWatchImpl as tw
+                                        where tw.poster.userId = :userId
+                                        and tw.topic.id= :topicId]]></query>
+	
+	<query name="findTopicWatchById" cacheable="true"><![CDATA[from TopicWatchImpl as f where f.id = :topicWatchId]]></query>
+	
+	
+</hibernate-mapping>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.TopicImpl"
+        table="jbp_forums_topics"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-TopicImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="posts"
+            table="jbp_forums_posts"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_create_date asc"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PostImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        <property
+            name="viewCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_view_count"
+            unique="false"
+        />
+
+        <property
+            name="replies"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_replies"
+            unique="false"
+        />
+
+        <property
+            name="lastPostDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_last_post_date"
+            unique="false"
+        />
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster"
+        />
+
+        <property
+            name="type"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_type"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+            unique="false"
+        />
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll"
+            not-null="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-TopicImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.WatchImpl"
+        table="jbp_forums_watch"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-WatchImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <property
+            name="mode"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_mode"
+            unique="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-WatchImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            table="jbp_forums_topicswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        </joined-subclass>
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            table="jbp_forums_forumswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        </joined-subclass>
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean
+      code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+      name="portal.forums:service=Hibernate"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+      <attribute name="DoChecking">true</attribute>
+      <attribute name="ConfigLocation">conf/hibernate/hibernate.cfg.xml</attribute>
+      <attribute name="SetupLocation">conf/hibernate/setup.txt</attribute>
+   </mbean>
+   <mbean
+      code="org.jboss.portlet.forums.impl.ForumsModuleImpl"
+      name="portal.forums:service=Module,type=Forums"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <!-- Flood interval in seconds -->
+      <attribute name="FloodInterval">30</attribute>
+      <!-- Guest user -->
+      <attribute name="GuestUserName">guest</attribute>
+      <!-- Email address used for FROM field of email notification -->
+      <attribute name="FromAddress">portal at example.com</attribute>
+      <attribute name="JNDIName">java:portal/ForumsModule</attribute>
+      <depends optional-attribute-name="Hibernate" proxy-type="attribute">portal.forums:service=Hibernate</depends>
+   </mbean>
+<!-- configure the AuthorizationContext for this application -->
+<mbean name="portal.forums:service=AuthorizationContext"
+       code="org.jboss.portlet.forums.auth.AuthorizationContextImpl" 	
+       xmbean-dd=""
+       >
+	<!-- plug-in an AuthorizationProvider that implements the AuthorizationInterface here -->
+	<attribute name="providerImpl">org.jboss.forums.security.AuthorizationProvider</attribute>
+	<xmbean>
+		<class>org.jboss.portlet.forums.auth.AuthorizationContextImpl</class>
+		<constructor>      				
+			<name>org.jboss.portlet.forums.auth.AuthorizationContextImpl</name>
+		</constructor>
+		<attribute access="write" setMethod="setProviderImpl">
+			<name>providerImpl</name>
+			<type>java.lang.String</type>					 
+		</attribute>
+		<attribute access="read-only" >
+			<name>provider</name>
+			<type>org.jboss.portlet.forums.auth.AuthorizationInterface</type>					 
+		</attribute>
+		<operation impact="INFO">
+			<description>Method for getting Provider</description>
+			<name>provider</name>
+			<return-type>org.jboss.portlet.forums.auth.AuthorizationInterface</return-type>
+		</operation>
+		<operation>
+			<description>The start lifecycle operation</description>
+			<name>start</name>
+		</operation>
+		<operation>
+			<description>The stop lifecycle operation</description>
+			<name>stop</name>
+		</operation>		    
+	</xmbean>
+</mbean>   
+</server>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+   "-//Hibernate/Hibernate Configuration DTD//EN"
+   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+   <session-factory>
+      <property name="connection.datasource">java:@portal.datasource.name@</property>
+      <property name="show_sql">false</property>
+      <property name="format_sql">false</property>
+
+      <!-- Use the C3P0 connection pool provider --> 
+      <property name="hibernate.c3p0.min_size">5</property> 
+      <property name="hibernate.c3p0.max_size">20</property> 
+      <property name="hibernate.c3p0.timeout">300</property> 
+      <property name="hibernate.c3p0.max_statements">50</property> 
+      <property name="hibernate.c3p0.idle_test_period">3000</property> 
+
+      <property name="cache.provider_class">org.jboss.portlet.forums.util.cache.JMXTreeCacheProvider</property>
+      <property name="cache.object_name">forums:service=TreeCacheProvider,type=hibernate</property>
+         
+      <property name="hibernate.cache.use_query_cache">true</property>
+      <property name="hibernate.cache.use_second_level_cache">true</property>
+      <property name="hibernate.generate_statistics">true</property>
+      <property name="hibernate.cache.use_structured_entries">true</property>
+      <!-- Force the dialect instead of using autodetection -->
+      <!--
+      <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+      -->
+
+      <!-- Mapping files -->
+      <!-- Luca Stancapiano - I add ForumInstanceImpl to use with hibernate -->
+      <mapping resource="org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/WatchImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/Queries.hbm.xml"/>
+   </session-factory>
+</hibernate-configuration>


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/setup.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/setup.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/setup.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,84 @@
+// This bsh script setup the default content of the portal.
+// It is called when the SessionFactoryBinder service has created a schema and needs to populate it
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portlet.forums.impl.CategoryImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+// Luca Stancapiano -- import
+import org.jboss.portlet.forums.impl.ForumInstanceImpl;
+
+try
+{
+   session = SessionFactory.openSession();
+   tx = session.beginTransaction();
+
+   /* Luca Stancapiano start - I add a new ForumInstanceImpl that contains all 
+      instances of categories.
+      It is the principal reference for a forum and it has the 
+      history of all forum instances in a portal */
+   ForumInstanceImpl fii = new ForumInstanceImpl();
+   fii.setId(new Integer(1));
+   fii.setName("First forum");
+   fii.setCategories(new java.util.ArrayList());
+   // Luca Stancapiano end
+
+   //
+   CategoryImpl cat = new CategoryImpl();
+   cat.setOrder(10);
+   cat.setTitle("Dummy demo category");
+   cat.setForums(new java.util.ArrayList());
+   /* Luca Stancapiano start - I add the reference of forum instance for a category. 
+      The only updates from old database to new database are this field to mark 
+      references for forum instance and the forum instance table managed by 
+      ForumInstanceImpl class through hibernate */ 
+   cat.setForumInstance(fii);
+   // Luca Stancapiano end
+
+   //
+   ForumImpl forum1 = new ForumImpl();
+   forum1.setDescription("First description");
+   forum1.setCategory(cat);
+   forum1.setLastPost(null);
+   forum1.setName("First forum");
+   forum1.setOrder(10);
+   forum1.setTopicCount(0);
+   forum1.setPostCount(0);
+   forum1.setPruneEnable(true);
+   forum1.setPruneNext(0);
+   forum1.setStatus(0);
+   //forum1.setType(0);
+   ForumImpl forum2 = new ForumImpl();
+   forum2.setDescription("Second description");
+   forum2.setCategory(cat);
+   forum2.setLastPost(null);
+   forum2.setName("Second forum");
+   forum2.setOrder(20);
+   forum2.setTopicCount(0);
+   forum2.setPostCount(0);
+   forum2.setPruneEnable(true);
+   forum2.setPruneNext(0);
+   forum2.setStatus(0);
+   //forum2.setType(0);
+
+   //
+   //cat.getForums().add(forum1);
+   //cat.getForums().add(forum2);
+   cat.addForum(forum1);
+   cat.addForum(forum2);
+
+   // Luca Stancapiano start - I save ForumInstance record and all his children records
+   fii.addCategory(cat);
+   session.save(fii);
+   //session.flush();
+   // Luca Stancapiano end
+
+   //
+   session.save(cat);
+   //session.flush();
+   //session.save(forum1);
+   //session.save(forum2);
+   tx.commit();
+}
+finally
+{
+   session.close();
+}


Property changes on: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/conf/hibernate/setup.txt
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.AttachmentImpl"
+        table="jbp_forums_attachments"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_attachment_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-AttachmentImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="comment"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_comment"
+        />
+
+        <component
+            name="file"
+            class="org.jboss.portlet.forums.impl.UploadedFileImpl"
+        >
+        <property
+            name="contentType"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_content_type"
+        />
+
+        <property
+            name="size"
+            type="long"
+            update="true"
+            insert="true"
+            column="jbp_size"
+        />
+
+        <property
+            name="name"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_name"
+        />
+
+        <property
+            name="content"
+            type="blob"
+            update="true"
+            insert="true"
+            column="jbp_content"
+            length="100000000"
+        />
+
+        </component>
+
+        <many-to-one
+            name="post"
+            class="org.jboss.portlet.forums.impl.PostImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_post_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-AttachmentImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.CategoryImpl"
+        table="jbp_forums_categories"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-CategoryImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="forums"
+            table="jbp_forums_forums"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order asc"
+        >
+            <cache 
+                usage="transactional" 
+            />
+
+            <key
+                column="jbp_category_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumImpl"
+            />
+
+      </bag>
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+            unique="false"
+        />
+
+        <many-to-one
+            name="forumInstance"
+            class="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_instance_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-CategoryImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumImpl"
+        table="jbp_forums_forums"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="category"
+            class="org.jboss.portlet.forums.impl.CategoryImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_category_id"
+        />
+
+        <property
+            name="description"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_description"
+            unique="false"
+        />
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="topicCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_topic_count"
+            unique="false"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <bag
+            name="topics"
+            table="jbp_forums_topics"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_last_post_date asc"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="forumWatch"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+        table="jbp_forums_instances"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="assigned">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumInstanceImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <bag
+            name="categories"
+            table="jbp_forums_categories"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order"
+        >
+
+            <key
+                column="jbp_forum_instance_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.CategoryImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumInstanceImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollImpl"
+        table="jbp_forums_polls"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_poll_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <list
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <index
+                column="jbp_poll_option_position"
+            />
+
+            <composite-element
+                class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            >
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            not-null="true"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+            </composite-element>
+
+        </list>
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+        />
+
+        <property
+            name="length"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_length"
+            unique="false"
+        />
+
+        <set
+            name="voted"
+            table="jbp_forums_poll_voted"
+            lazy="true"
+            cascade="all"
+            sort="unsorted"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <element
+                column="jbp_poll_voted"
+                type="integer"
+                not-null="true"
+                unique="false"
+            />
+
+        </set>
+
+        <property
+            name="creationDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_creation_date"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PostImpl"
+        table="jbp_forums_posts"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PostImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        <property
+            name="editCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_edit_count"
+            unique="false"
+        />
+
+        <property
+            name="editDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_edit_date"
+            unique="false"
+        />
+
+        <property
+            name="createDate"
+            type="java.util.Date"
+            update="false"
+            insert="true"
+            column="jbp_create_date"
+            unique="false"
+        />
+
+        <component
+            name="message"
+            class="org.jboss.portlet.forums.impl.MessageImpl"
+        >
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+        />
+
+        <property
+            name="text"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_text"
+        />
+
+        </component>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <bag
+            name="attachments"
+            table="jbp_forums_attachments"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+        >
+
+            <key
+                column="jbp_post_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.AttachmentImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PostImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PosterImpl"
+        table="jbp_forums_posters"
+    >
+        <cache usage="transactional" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PosterImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="userId"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_user_id"
+            unique="true"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PosterImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+
+	<query name="findForumByIdFetchTopics" cacheable="true"><![CDATA[select f
+                                        from ForumImpl f
+                                        left outer join fetch f.topics
+                                        where f.id = :forumId]]></query>
+	
+	<query name="findCategoryByIdFetchForums" cacheable="true"><![CDATA[from CategoryImpl as c
+                                        join fetch c.forums
+                                        where c.id=:categoryId]]></query>
+	
+	<query name="findPosterByUserId" cacheable="true"><![CDATA[from PosterImpl as u where u.userId=:userId]]></query>
+	
+	<query name="findCategories" cacheable="true"><![CDATA[from CategoryImpl as c
+							            where c.forumInstance.id = :forumInstanceId
+							            order by c.order asc]]></query>
+	
+	<query name="findCategoriesFetchForums" cacheable="true"><![CDATA[select c
+					                    from CategoryImpl as c
+					                    left outer join fetch c.forums
+					                    where c.forumInstance.id = :forumInstanceId
+					                    order by c.order asc]]></query>
+	
+	<query name="findForums" cacheable="true"><![CDATA[from ForumImpl as f
+							            where f.category.forumInstance.id = :forumInstanceId
+							            order by f.order asc]]></query>
+	
+	<query name="findForumsByCategoryId" cacheable="true"><![CDATA[from ForumImpl as f where f.category=:categoryId order by f.order asc]]></query>
+	
+	<query name="findAnnouncements" cacheable="true"><![CDATA[from TopicImpl as t where t.forum=:forumid and t.type = :type order by t.lastPostDate]]></query>
+	
+	<query name="findTopics" cacheable="true"><![CDATA[from TopicImpl as t
+					                    where t.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicsTypeasc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate asc]]></query>
+                                        
+	<query name="findTopicsTypedesc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsForumasc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate asc]]></query>
+	
+	<query name="findTopicsForumdesc" cacheable="true"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHot" cacheable="true"><![CDATA[from TopicImpl as t where t.replies > :replies
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsByLatestPosts" cacheable="true"><![CDATA[from TopicImpl as t where t.forum.category.forumInstance.id = :forumInstanceId order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHottest" cacheable="true"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.replies desc]]></query>
+	
+	<query name="findTopicsMostViewed" cacheable="true"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.viewCount desc]]></query>
+	
+	<query name="getLastCategoryOrder" cacheable="true"><![CDATA[select max(c.order) from CategoryImpl as c where c.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="getLastForumOrder" cacheable="true"><![CDATA[select max(f.order) from ForumImpl as f where f.category = :categoryId]]></query>
+	
+	<query name="findTopicsForumNoOrder" cacheable="true"><![CDATA[from TopicImpl as t where t.forum = :forumid]]></query>
+	
+	<query name="findPosts" cacheable="true"><![CDATA[from PostImpl as p
+					                    where p.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsByTopicIdasc" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate asc]]></query>
+	
+	<query name="findPostsByTopicIddesc" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate desc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersasc" cacheable="true"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersdesc" cacheable="true"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostIdsasc" cacheable="true"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostIdsdesc" cacheable="true"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostsByTopicIdNoOrder" cacheable="true"><![CDATA[from PostImpl as p where p.topic=:topicId]]></query>
+	
+	<query name="findLastPostDateForUser" cacheable="true"><![CDATA[select max(p.createDate) from PostImpl as p where p.poster.userId = :userId]]></query>
+	
+	<query name="findLastPost" cacheable="true"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.createDate = (
+                                           select DISTINCT MAX(topic.lastPostDate)
+                                           from TopicImpl as topic
+                                           where topic.forum = :forumId
+                                        )]]></query>
+	
+	<query name="findFirstPost" cacheable="true"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.topic = :topicId
+                                        AND p.createDate = :lastPostDate]]></query>
+	
+	<query name="findLastPostOrder" cacheable="true"><![CDATA[from PostImpl as p where p.topic  = :topicId order by p.createDate desc]]></query>
+	
+	<query name="findLastPostsOfTopics" cacheable="true"><![CDATA[select topic.lastPostDate as maxDate , topic.id
+                                        from TopicImpl as topic
+                                        where topic.forum.id = :forumId]]></query>
+	
+	<query name="findLastPostsOfTopicsCreateDate" cacheable="true"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findLastPostsOfForums" cacheable="true"><![CDATA[select MAX(topic.lastPostDate) as maxDate , topic.forum.id
+                                        from TopicImpl as topic
+      							        where topic.forum.category.forumInstance.id = :forumInstanceId
+                                        group by topic.forum.id]]></query>
+	
+	<query name="findLastPostsOfForumsCreateDate" cacheable="true"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findForumWatchByUser" cacheable="true"><![CDATA[from ForumWatchImpl as f where f.poster.userId = :userId
+					                    and f.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchedByUser" cacheable="true"><![CDATA[select f
+					                    from ForumImpl as f where f.id IN (
+					                    select fw.forum.id from ForumWatchImpl fw
+					                    where fw.poster.userId = :userId )
+					                    and f.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicWatchedByUser" cacheable="true"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatchedByUserCreateDate" cacheable="true"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and (t.lastPostDate > :datePoint)
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatches" cacheable="true"><![CDATA[select tw.topic.id , tw
+					                    from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId
+					                    and tw.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsFromForumasc" cacheable="true"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromForumdesc" cacheable="true"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsFromCategoryasc" cacheable="true"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromCategorydesc" cacheable="true"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsOrderasc" cacheable="true"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsOrderdesc" cacheable="true"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findForumWatchById" cacheable="true"><![CDATA[from ForumWatchImpl as f where f.id = :forumWatchId]]></query>
+	
+	<query name="findForumWatches" cacheable="true"><![CDATA[select fw.forum.id , fw
+                                        from ForumWatchImpl fw
+                                        where fw.poster.userId = :userId
+			                            and fw.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchByUserAndForum" cacheable="true"><![CDATA[from ForumWatchImpl as fw
+                                        where fw.poster.userId = :userId
+                                        and fw.forum.id= :forumId]]></query>
+	
+	<query name="findTopicWatchByUserAndTopic" cacheable="true"><![CDATA[from TopicWatchImpl as tw
+                                        where tw.poster.userId = :userId
+                                        and tw.topic.id= :topicId]]></query>
+	
+	<query name="findTopicWatchById" cacheable="true"><![CDATA[from TopicWatchImpl as f where f.id = :topicWatchId]]></query>
+	
+	
+</hibernate-mapping>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.TopicImpl"
+        table="jbp_forums_topics"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-TopicImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="posts"
+            table="jbp_forums_posts"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_create_date asc"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PostImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        <property
+            name="viewCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_view_count"
+            unique="false"
+        />
+
+        <property
+            name="replies"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_replies"
+            unique="false"
+        />
+
+        <property
+            name="lastPostDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_last_post_date"
+            unique="false"
+        />
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster"
+        />
+
+        <property
+            name="type"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_type"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+            unique="false"
+        />
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll"
+            not-null="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-TopicImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.WatchImpl"
+        table="jbp_forums_watch"
+    >
+        <cache usage="transactional" />
+        
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-WatchImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <property
+            name="mode"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_mode"
+            unique="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-WatchImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            table="jbp_forums_topicswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        </joined-subclass>
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            table="jbp_forums_forumswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        </joined-subclass>
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/META-INF/jboss-service.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean
+      code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+      name="portal.forums:service=Hibernate"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+      <attribute name="DoChecking">true</attribute>
+      <attribute name="ConfigLocation">conf/hibernate/hibernate.cfg.xml</attribute>
+      <attribute name="SetupLocation">conf/hibernate/setup.txt</attribute>
+   </mbean>
+   <mbean
+      code="org.jboss.portlet.forums.impl.ForumsModuleImpl"
+      name="portal.forums:service=Module,type=Forums"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <!-- Flood interval in seconds -->
+      <attribute name="FloodInterval">30</attribute>
+      <!-- Guest user -->
+      <attribute name="GuestUserName">guest</attribute>
+      <!-- Email address used for FROM field of email notification -->
+      <attribute name="FromAddress">portal at example.com</attribute>
+      <attribute name="JNDIName">java:portal/ForumsModule</attribute>
+      <depends optional-attribute-name="Hibernate" proxy-type="attribute">portal.forums:service=Hibernate</depends>
+   </mbean>
+   <mbean
+      code="org.jboss.portlet.forums.search.ForumsSearchModuleImpl"
+      name="portal.forums:service=Module,type=Search"
+      xmbean-dd=""
+      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+      <xmbean/>
+      <attribute name="JNDIName">java:portal/ForumsSearchModule</attribute>
+      <depends optional-attribute-name="Hibernate" proxy-type="attribute">portal.forums:service=Hibernate</depends>
+   </mbean>
+   <mbean
+      code="org.jboss.portlet.forums.search.ForumsIndexBuilder"
+      name="portal.forums:service=Module,type=IndexBuilder">
+      <xmbean/>
+      <depends optional-attribute-name="Hibernate" proxy-type="attribute">portal.forums:service=Hibernate</depends>
+   </mbean>
+<!-- configure the AuthorizationContext for this application -->
+<mbean name="portal.forums:service=AuthorizationContext"
+       code="org.jboss.portlet.forums.auth.AuthorizationContextImpl" 	
+       xmbean-dd=""
+       >
+	<!-- plug-in an AuthorizationProvider that implements the AuthorizationInterface here -->
+	<attribute name="providerImpl">org.jboss.forums.security.AuthorizationProvider</attribute>
+	<xmbean>
+		<class>org.jboss.portlet.forums.auth.AuthorizationContextImpl</class>
+		<constructor>      				
+			<name>org.jboss.portlet.forums.auth.AuthorizationContextImpl</name>
+		</constructor>
+		<attribute access="write" setMethod="setProviderImpl">
+			<name>providerImpl</name>
+			<type>java.lang.String</type>					 
+		</attribute>
+		<attribute access="read-only" >
+			<name>provider</name>
+			<type>org.jboss.portlet.forums.auth.AuthorizationInterface</type>					 
+		</attribute>
+		<operation impact="INFO">
+			<description>Method for getting Provider</description>
+			<name>provider</name>
+			<return-type>org.jboss.portlet.forums.auth.AuthorizationInterface</return-type>
+		</operation>
+		<operation>
+			<description>The start lifecycle operation</description>
+			<name>start</name>
+		</operation>
+		<operation>
+			<description>The stop lifecycle operation</description>
+			<name>stop</name>
+		</operation>		    
+	</xmbean>
+</mbean>   
+</server>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,60 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+   "-//Hibernate/Hibernate Configuration DTD//EN"
+   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+   <session-factory>
+      <property name="connection.datasource">java:@portal.datasource.name@</property>
+      <property name="show_sql">false</property>
+      <property name="format_sql">false</property>
+
+      <!-- Use the C3P0 connection pool provider --> 
+      <property name="hibernate.c3p0.min_size">5</property> 
+      <property name="hibernate.c3p0.max_size">20</property> 
+      <property name="hibernate.c3p0.timeout">300</property> 
+      <property name="hibernate.c3p0.max_statements">50</property> 
+      <property name="hibernate.c3p0.idle_test_period">3000</property> 
+
+      <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+      <property name="hibernate.cache.use_query_cache">true</property>
+      <property name="hibernate.cache.use_second_level_cache">true</property>
+      <property name="hibernate.generate_statistics">true</property>
+      <property name="hibernate.cache.use_structured_entries">true</property>
+      <!-- Force the dialect instead of using autodetection -->
+      <!--
+      <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+      -->
+
+      <property name="hibernate.search.autoregister_listeners">false</property>
+      <property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</property>
+      <property name="hibernate.search.default.indexBase">/HibernateSearch/indexes</property>
+      <property name="hibernate.search.default.optimizer.operation_limit.max">2000</property>
+      
+      <property name="org.hibernate.worker.batch_size">2000</property>
+
+      <!-- Mapping files -->
+      <!-- Luca Stancapiano - I add ForumInstanceImpl to use with hibernate -->
+      <mapping resource="org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/WatchImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml"/>
+
+      <!-- Luca Stancapiano - I add Queries to put off queries inside java code -->
+      <mapping resource="org/jboss/portlet/forums/impl/Queries.hbm.xml"/>
+      
+      <event type="post-update">
+        <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+      </event>
+      <event type="post-insert">
+        <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+      </event>
+      <event type="post-delete">
+        <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+      </event>
+   </session-factory>
+</hibernate-configuration>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/setup.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/setup.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/conf/hibernate/setup.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,84 @@
+// This bsh script setup the default content of the portal.
+// It is called when the SessionFactoryBinder service has created a schema and needs to populate it
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portlet.forums.impl.CategoryImpl;
+import org.jboss.portlet.forums.impl.ForumImpl;
+// Luca Stancapiano -- import
+import org.jboss.portlet.forums.impl.ForumInstanceImpl;
+
+try
+{
+   session = SessionFactory.openSession();
+   tx = session.beginTransaction();
+
+   /* Luca Stancapiano start - I add a new ForumInstanceImpl that contains all 
+      instances of categories.
+      It is the principal reference for a forum and it has the 
+      history of all forum instances in a portal */
+   ForumInstanceImpl fii = new ForumInstanceImpl();
+   fii.setId(new Integer(1));
+   fii.setName("First forum");
+   fii.setCategories(new java.util.ArrayList());
+   // Luca Stancapiano end
+
+   //
+   CategoryImpl cat = new CategoryImpl();
+   cat.setOrder(10);
+   cat.setTitle("Dummy demo category");
+   cat.setForums(new java.util.ArrayList());
+   /* Luca Stancapiano start - I add the reference of forum instance for a category. 
+      The only updates from old database to new database are this field to mark 
+      references for forum instance and the forum instance table managed by 
+      ForumInstanceImpl class through hibernate */ 
+   cat.setForumInstance(fii);
+   // Luca Stancapiano end
+
+   //
+   ForumImpl forum1 = new ForumImpl();
+   forum1.setDescription("First description");
+   forum1.setCategory(cat);
+   forum1.setLastPost(null);
+   forum1.setName("First forum");
+   forum1.setOrder(10);
+   forum1.setTopicCount(0);
+   forum1.setPostCount(0);
+   forum1.setPruneEnable(true);
+   forum1.setPruneNext(0);
+   forum1.setStatus(0);
+   //forum1.setType(0);
+   ForumImpl forum2 = new ForumImpl();
+   forum2.setDescription("Second description");
+   forum2.setCategory(cat);
+   forum2.setLastPost(null);
+   forum2.setName("Second forum");
+   forum2.setOrder(20);
+   forum2.setTopicCount(0);
+   forum2.setPostCount(0);
+   forum2.setPruneEnable(true);
+   forum2.setPruneNext(0);
+   forum2.setStatus(0);
+   //forum2.setType(0);
+
+   //
+   //cat.getForums().add(forum1);
+   //cat.getForums().add(forum2);
+   cat.addForum(forum1);
+   cat.addForum(forum2);
+
+   // Luca Stancapiano start - I save ForumInstance record and all his children records
+   fii.addCategory(cat);
+   session.save(fii);
+   session.flush();   // Luca Stancapiano - it is required for clustering versions
+   // Luca Stancapiano end
+
+   //
+   session.save(cat);
+   session.flush();   // Luca Stancapiano - it is required for clustering versions
+   //session.save(forum1);
+   //session.save(forum2);
+   tx.commit();
+}
+finally
+{
+   session.close();
+}

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/ehcache.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/ehcache.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/ehcache.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,129 @@
+<ehcache>
+
+    <!-- Sets the path to the directory where cache .data files are created.
+
+         If the path is a Java System Property it is replaced by
+         its value in the running VM.
+
+         The following properties are translated:
+         user.home - User's home directory
+         user.dir - User's current working directory
+         java.io.tmpdir - Default temp file path -->
+    <diskStore path="java.io.tmpdir"/>
+
+
+    <!--Default Cache configuration. These will applied to caches programmatically created through
+        the CacheManager.
+
+        The following attributes are required for defaultCache:
+
+        maxInMemory       - Sets the maximum number of objects that will be created in memory
+        eternal           - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element
+                            is never expired.
+        timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
+                            if the element is not eternal. Idle time is now - last accessed time
+        timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
+                            if the element is not eternal. TTL is now - creation time
+        overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
+                            has reached the maxInMemory limit.
+
+        -->
+    <defaultCache
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="120"
+        timeToLiveSeconds="120"
+        overflowToDisk="true"
+        />
+
+    <!--Predefined caches.  Add your cache configuration settings here.
+        If you do not have a configuration for your cache a WARNING will be issued when the
+        CacheManager starts
+
+        The following attributes are required for defaultCache:
+
+        name              - Sets the name of the cache. This is used to identify the cache. It must be unique.
+        maxInMemory       - Sets the maximum number of objects that will be created in memory
+        eternal           - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element
+                            is never expired.
+        timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
+                            if the element is not eternal. Idle time is now - last accessed time
+        timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
+                            if the element is not eternal. TTL is now - creation time
+        overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
+                            has reached the maxInMemory limit.
+
+        -->
+
+    <!-- Sample cache named sampleCache1
+        This cache contains a maximum in memory of 10000 elements, and will expire
+        an element if it is idle for more than 5 minutes and lives for more than
+        10 minutes.
+
+        If there are more than 10000 elements it will overflow to the
+        disk cache, which in this configuration will go to wherever java.io.tmp is
+        defined on your system. On a standard Linux system this will be /tmp"
+        -->
+    <cache name="sampleCache1"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="300"
+        timeToLiveSeconds="600"
+        overflowToDisk="true"
+        />
+
+    <!-- Sample cache named sampleCache2
+        This cache contains 1000 elements. Elements will always be held in memory.
+        They are not expired. -->
+    <cache name="sampleCache2"
+        maxElementsInMemory="1000"
+        eternal="true"
+        timeToIdleSeconds="0"
+        timeToLiveSeconds="0"
+        overflowToDisk="false"
+        /> -->
+
+    <!-- Place configuration for your caches following -->
+
+    <cache name="org.jboss.portlet.forums.impl.CategoryImpl"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="3000"
+        timeToLiveSeconds="6000"
+        overflowToDisk="false"
+    />
+
+    <cache name="org.jboss.portlet.forums.impl.CategoryImpl.forums"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="3000"
+        timeToLiveSeconds="6000"
+        overflowToDisk="false"
+    />
+
+    <cache name="org.jboss.portlet.forums.impl.ForumImpl"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="3000"
+        timeToLiveSeconds="6000"
+        overflowToDisk="false"
+    />
+
+    <cache name="org.jboss.portlet.forums.impl.PostImpl"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="3000"
+        timeToLiveSeconds="6000"
+        overflowToDisk="false"
+    />
+
+    <cache name="org.jboss.portlet.forums.impl.PosterImpl"
+        maxElementsInMemory="10000"
+        eternal="false"
+        timeToIdleSeconds="3000"
+        timeToLiveSeconds="6000"
+        overflowToDisk="false"
+    />
+
+
+</ehcache>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/AttachmentImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.AttachmentImpl"
+        table="jbp_forums_attachments"
+    >
+
+        <id
+            name="id"
+            column="jbp_attachment_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-AttachmentImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="comment"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_comment"
+        />
+
+        <component
+            name="file"
+            class="org.jboss.portlet.forums.impl.UploadedFileImpl"
+        >
+        <property
+            name="contentType"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_content_type"
+        />
+
+        <property
+            name="size"
+            type="long"
+            update="true"
+            insert="true"
+            column="jbp_size"
+        />
+
+        <property
+            name="name"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_name"
+        />
+
+        <property
+            name="content"
+            type="blob"
+            update="true"
+            insert="true"
+            column="jbp_content"
+            length="100000000"
+        />
+
+        </component>
+
+        <many-to-one
+            name="post"
+            class="org.jboss.portlet.forums.impl.PostImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_post_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-AttachmentImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.CategoryImpl"
+        table="jbp_forums_categories"
+    >
+        <cache usage="read-write" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-CategoryImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="forums"
+            table="jbp_forums_forums"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order asc"
+        >
+            <cache 
+                usage="read-write" 
+            />
+
+            <key
+                column="jbp_category_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumImpl"
+            />
+
+      </bag>
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+            unique="false"
+        />
+
+        <many-to-one
+            name="forumInstance"
+            class="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_instance_id"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-CategoryImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumImpl"
+        table="jbp_forums_forums"
+    >
+        <cache usage="read-write" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="category"
+            class="org.jboss.portlet.forums.impl.CategoryImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_category_id"
+        />
+
+        <property
+            name="description"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_description"
+            unique="false"
+        />
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <property
+            name="order"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_order"
+            unique="false"
+        />
+
+        <property
+            name="topicCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_topic_count"
+            unique="false"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <bag
+            name="topics"
+            table="jbp_forums_topics"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_last_post_date asc"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="forumWatch"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_forum_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/ForumInstanceImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.ForumInstanceImpl"
+        table="jbp_forums_instances"
+    >
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="assigned">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-ForumInstanceImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="name"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_name"
+            unique="false"
+        />
+
+        <bag
+            name="categories"
+            table="jbp_forums_categories"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_order"
+        >
+
+            <key
+                column="jbp_forum_instance_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.CategoryImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-ForumInstanceImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollImpl"
+        table="jbp_forums_polls"
+    >
+
+        <id
+            name="id"
+            column="jbp_poll_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <list
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <index
+                column="jbp_poll_option_position"
+            />
+
+            <composite-element
+                class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            >
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            not-null="true"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+            </composite-element>
+
+        </list>
+
+        <property
+            name="title"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_title"
+        />
+
+        <property
+            name="length"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_length"
+            unique="false"
+        />
+
+        <set
+            name="voted"
+            table="jbp_forums_poll_voted"
+            lazy="true"
+            cascade="all"
+            sort="unsorted"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <element
+                column="jbp_poll_voted"
+                type="integer"
+                not-null="true"
+                unique="false"
+            />
+
+        </set>
+
+        <property
+            name="creationDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_creation_date"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PostImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PostImpl"
+        table="jbp_forums_posts"
+    >
+        <cache usage="read-write" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PostImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        <property
+            name="editCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_edit_count"
+            unique="false"
+        />
+
+        <property
+            name="editDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_edit_date"
+            unique="false"
+        />
+
+        <property
+            name="createDate"
+            type="java.util.Date"
+            update="false"
+            insert="true"
+            column="jbp_create_date"
+            unique="false"
+        />
+
+        <component
+            name="message"
+            class="org.jboss.portlet.forums.impl.MessageImpl"
+        >
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+        />
+
+        <property
+            name="text"
+            type="text"
+            update="true"
+            insert="true"
+            column="jbp_text"
+        />
+
+        </component>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <bag
+            name="attachments"
+            table="jbp_forums_attachments"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+        >
+
+            <key
+                column="jbp_post_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.AttachmentImpl"
+            />
+
+      </bag>
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PostImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PosterImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PosterImpl"
+        table="jbp_forums_posters"
+    >
+        <cache usage="read-write" />
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PosterImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <property
+            name="userId"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_user_id"
+            unique="true"
+        />
+
+        <property
+            name="postCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_post_count"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PosterImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/Queries.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+
+	<query name="findForumByIdFetchTopics"><![CDATA[select f
+                                        from ForumImpl f
+                                        left outer join fetch f.topics
+                                        where f.id = :forumId]]></query>
+	
+	<query name="findCategoryByIdFetchForums"><![CDATA[from CategoryImpl as c
+                                        join fetch c.forums
+                                        where c.id=:categoryId]]></query>
+	
+	<query name="findPosterByUserId"><![CDATA[from PosterImpl as u where u.userId=:userId]]></query>
+	
+	<query name="findCategories" cacheable="true"><![CDATA[from CategoryImpl as c
+							            where c.forumInstance.id = :forumInstanceId
+							            order by c.order asc]]></query>
+	
+	<query name="findCategoriesFetchForums" cacheable="true"><![CDATA[select c
+					                    from CategoryImpl as c
+					                    left outer join fetch c.forums
+					                    where c.forumInstance.id = :forumInstanceId
+					                    order by c.order asc]]></query>
+	
+	<query name="findForums"><![CDATA[from ForumImpl as f
+							            where f.category.forumInstance.id = :forumInstanceId
+							            order by f.order asc]]></query>
+	
+	<query name="findForumsByCategoryId"><![CDATA[from ForumImpl as f where f.category=:categoryId order by f.order asc]]></query>
+	
+	<query name="findAnnouncements"><![CDATA[from TopicImpl as t where t.forum=:forumid and t.type = :type order by t.lastPostDate]]></query>
+	
+	<query name="findTopics"><![CDATA[from TopicImpl as t
+					                    where t.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicsTypeasc"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate asc]]></query>
+                                        
+	<query name="findTopicsTypedesc"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        and t.type = :type
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsForumasc"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate asc]]></query>
+	
+	<query name="findTopicsForumdesc"><![CDATA[from TopicImpl as t
+                                        join fetch t.poster
+                                        where t.forum = :forumid
+                                        order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHot"><![CDATA[from TopicImpl as t where t.replies > :replies
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsByLatestPosts"><![CDATA[from TopicImpl as t where t.forum.category.forumInstance.id = :forumInstanceId order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicsHottest"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.replies desc]]></query>
+	
+	<query name="findTopicsMostViewed"><![CDATA[from TopicImpl as t where t.lastPostDate > :after
+							            and t.forum.category.forumInstance.id = :forumInstanceId
+							            order by t.viewCount desc]]></query>
+	
+	<query name="getLastCategoryOrder"><![CDATA[select max(c.order) from CategoryImpl as c where c.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="getLastForumOrder"><![CDATA[select max(f.order) from ForumImpl as f where f.category = :categoryId]]></query>
+	
+	<query name="findTopicsForumNoOrder"><![CDATA[from TopicImpl as t where t.forum = :forumid]]></query>
+	
+	<query name="findPosts"><![CDATA[from PostImpl as p
+					                    where p.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsByTopicIdasc"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate asc]]></query>
+	
+	<query name="findPostsByTopicIddesc"><![CDATA[from PostImpl as p where p.topic=:topicId order by p.createDate desc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersasc"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostsByIdsFetchAttachmentsAndPostersdesc"><![CDATA[from PostImpl as p
+                                        join fetch p.poster
+                                        left outer join fetch p.attachments
+                                        where p.id IN ( :postIds )
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostIdsasc"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate asc]]></query>
+	
+	<query name="findPostIdsdesc"><![CDATA[select p.id
+                                        from PostImpl as p
+                                        where p.topic=:topicId
+                                        order by p.createDate desc]]></query>
+	
+	<query name="findPostsByTopicIdNoOrder"><![CDATA[from PostImpl as p where p.topic=:topicId]]></query>
+	
+	<query name="findLastPostDateForUser"><![CDATA[select max(p.createDate) from PostImpl as p where p.poster.userId = :userId]]></query>
+	
+	<query name="findLastPost"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.createDate = (
+                                           select DISTINCT MAX(topic.lastPostDate)
+                                           from TopicImpl as topic
+                                           where topic.forum = :forumId
+                                        )]]></query>
+	
+	<query name="findFirstPost"><![CDATA[select p
+                                        from PostImpl as p
+                                        join fetch p.poster
+                                        where p.topic = :topicId
+                                        AND p.createDate = :lastPostDate]]></query>
+	
+	<query name="findLastPostOrder"><![CDATA[from PostImpl as p where p.topic  = :topicId order by p.createDate desc]]></query>
+	
+	<query name="findLastPostsOfTopics"><![CDATA[select topic.lastPostDate as maxDate , topic.id
+                                        from TopicImpl as topic
+                                        where topic.forum.id = :forumId]]></query>
+	
+	<query name="findLastPostsOfTopicsCreateDate"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findLastPostsOfForums" cacheable="true"><![CDATA[select MAX(topic.lastPostDate) as maxDate , topic.forum.id
+                                        from TopicImpl as topic
+      							        where topic.forum.category.forumInstance.id = :forumInstanceId
+                                        group by topic.forum.id]]></query>
+	
+	<query name="findLastPostsOfForumsCreateDate" cacheable="true"><![CDATA[select post.createDate, post
+                                        from PostImpl as post
+                                        join fetch post.poster
+                                        where post.createDate IN (:dates)
+                                        order by post.createDate]]></query>
+	
+	<query name="findForumWatchByUser"><![CDATA[from ForumWatchImpl as f where f.poster.userId = :userId
+					                    and f.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchedByUser"><![CDATA[select f
+					                    from ForumImpl as f where f.id IN (
+					                    select fw.forum.id from ForumWatchImpl fw
+					                    where fw.poster.userId = :userId )
+					                    and f.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findTopicWatchedByUser"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatchedByUserCreateDate"><![CDATA[select t
+					                    from TopicImpl as t where t.id IN (
+					                    select tw.topic.id from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId )
+					                    and (t.lastPostDate > :datePoint)
+					                    and t.forum.category.forumInstance.id = :forumInstanceId
+					                    order by t.lastPostDate desc]]></query>
+	
+	<query name="findTopicWatches"><![CDATA[select tw.topic.id , tw
+					                    from TopicWatchImpl tw
+					                    where tw.poster.userId = :userId
+					                    and tw.topic.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findPostsFromForumasc"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromForumdesc"><![CDATA[select p from TopicImpl as t join t.posts as p where t.forum.id = :forumId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsFromCategoryasc"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsFromCategorydesc"><![CDATA[select p from ForumImpl as f join f.topics as t join t.posts as p where f.category.id = :categoryId order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findPostsOrderasc"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        asc]]></query>
+	
+	<query name="findPostsOrderdesc"><![CDATA[select p from PostImpl as p order by p.createDate
+                                        desc]]></query>
+	
+	<query name="findForumWatchById"><![CDATA[from ForumWatchImpl as f where f.id = :forumWatchId]]></query>
+	
+	<query name="findForumWatches"><![CDATA[select fw.forum.id , fw
+                                        from ForumWatchImpl fw
+                                        where fw.poster.userId = :userId
+			                            and fw.forum.category.forumInstance.id = :forumInstanceId]]></query>
+	
+	<query name="findForumWatchByUserAndForum"><![CDATA[from ForumWatchImpl as fw
+                                        where fw.poster.userId = :userId
+                                        and fw.forum.id= :forumId]]></query>
+	
+	<query name="findTopicWatchByUserAndTopic"><![CDATA[from TopicWatchImpl as tw
+                                        where tw.poster.userId = :userId
+                                        and tw.topic.id= :topicId]]></query>
+	
+	<query name="findTopicWatchById"><![CDATA[from TopicWatchImpl as f where f.id = :topicWatchId]]></query>
+	
+	
+</hibernate-mapping>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/TopicImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.TopicImpl"
+        table="jbp_forums_topics"
+    >
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-TopicImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <bag
+            name="posts"
+            table="jbp_forums_posts"
+            lazy="true"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_create_date asc"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PostImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        <property
+            name="viewCount"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_view_count"
+            unique="false"
+        />
+
+        <property
+            name="replies"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_replies"
+            unique="false"
+        />
+
+        <property
+            name="lastPostDate"
+            type="java.util.Date"
+            update="true"
+            insert="true"
+            column="jbp_last_post_date"
+            unique="false"
+        />
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster"
+        />
+
+        <property
+            name="type"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_type"
+            unique="false"
+        />
+
+        <property
+            name="status"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_status"
+            unique="false"
+        />
+
+        <property
+            name="subject"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_subject"
+            unique="false"
+        />
+
+        <bag
+            name="watches"
+            lazy="true"
+            inverse="true"
+            cascade="all"
+        >
+
+            <key
+                column="jbp_topic_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            />
+
+      </bag>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll"
+            not-null="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-TopicImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/WatchImpl.hbm.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.WatchImpl"
+        table="jbp_forums_watch"
+    >
+
+        <id
+            name="id"
+            column="jbp_id"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-WatchImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poster"
+            class="org.jboss.portlet.forums.impl.PosterImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poster_id"
+        />
+
+        <property
+            name="mode"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_mode"
+            unique="false"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-WatchImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.TopicWatchImpl"
+            table="jbp_forums_topicswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="topic"
+            class="org.jboss.portlet.forums.impl.TopicImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_topic_id"
+        />
+
+        </joined-subclass>
+        <joined-subclass
+            name="org.jboss.portlet.forums.impl.ForumWatchImpl"
+            table="jbp_forums_forumswatch"
+        >
+            <key
+                column="jbp_id"
+            />
+
+        <many-to-one
+            name="forum"
+            class="org.jboss.portlet.forums.impl.ForumImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_forum_id"
+        />
+
+        </joined-subclass>
+
+    </class>
+
+</hibernate-mapping>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,512 @@
+#
+# Common, these terms are used
+# extensively on several pages
+#
+Forum=Forum
+Category=Category
+Topics=Topics
+Replies=Replies
+Views=Views
+Posts=Posts
+L_POSTED=Posted
+Posted=Posted
+L_AUTHOR=Author
+Author=Author
+Message=Message
+Permalink=[ permalink ]
+Powered_by=Powered by
+Jump_to=Jump to
+
+period_1_Day=1 Day
+period_7_Days=7 Days
+period_2_Weeks=2 Weeks
+period_1_Month=1 Month
+period_3_Months=3 Months
+period_6_Months=6 Months
+period_1_Year=1 Year
+
+Go=Go
+Submit=Submit
+Cancel=Cancel
+Preview=Preview
+Confirm=Confirm
+Yes=Yes
+No=No
+Back=Back
+
+Next=Next
+Previous=Previous
+Goto_page=Goto page
+Last_page=Last page
+Last=Last
+First=First
+L_JOINED=Joined
+
+Select_forum=Select a forum
+# Replaces with: Page 1 of 2 for example
+PageNumber=Page {0} of {1}
+
+ICQ=ICQ Number
+AIM=AIM Address
+YIM=Yahoo Messenger
+
+# eg. sitename Forum Index, %s can be removed if you prefer
+
+Post_new_topic=Post new topic
+Reply_to_topic=Reply to topic
+
+# %s's here are for uris, do not remove!
+
+Admin_panel=Administration
+Home=Home
+My_Forums=My Forums
+
+#
+# Forums Preferences
+#
+L_LOGIN_REQUIRED=You must be logged in to manage your Forum Preferences
+L_EMAIL_ADDRESS=Email address
+L_ICQ_NUMBER=ICQ number
+L_AIM=AIM
+L_MESSENGER=Messanger
+L_YAHOO=Yahoo
+L_SKYPE=Skype
+L_WEBSITE=Website
+L_LOCATION=Location
+L_OCCUPATION=Occupation
+L_INTERESTS=Interests
+L_SIGNATURE=Signature
+L_SIGNATURE_EXPLAIN=Signature under your posts
+L_PREFERENCES=Preferences
+L_YES=Yes
+L_NO=No
+L_NOTIFY_ON_REPLY=Notify on reply
+L_NOTIFY_ON_REPLY_EXPLAIN=Notify when your post was replied
+L_ALWAYS_ADD_SIGNATURE=Always add signature
+L_ALWAYS_ALLOW_HTML=Always allow html
+L_DATE_FORMAT=Date format
+L_SUBMIT=Submit
+L_RESET=Reset
+L_POST_ORDER=Post Order
+L_POSTS_PER_TOPIC=Posts per page
+L_POSTS_PER_TOPIC_EXPLAIN=How many posts per page do you want to display
+L_ASCENDING=Ascending
+L_DESCENDING=Descending
+L_TOPICS_PER_FORUM=Topics per page
+L_TOPICS_PER_FORUM_EXPLAIN=How many topics per page do you want to display
+L_USER_INFO=Information
+L_MODE_HOT_TOPICS=Hot topics (above some number of replies)
+L_MODE_HOTTEST_TOPICS=Hottest topics (most replied)
+L_MODE_LATEST_POSTS=Latest posted topics
+L_MODE_MOST_VIEWED=Most viewed topics
+L_TOPICS_FOUND=topics found.
+L_TOPIC_SUMMARY=Topic summary
+L_MODE_CHOOSE=Choose summary mode
+L_MODE_CHOOSE_EXPLAIN=What you want to display in minimized portlet window
+L_TOPIC_SUMMARY_LIMIT=Topics limit
+L_TOPIC_SUMMARY_LIMIT_EXPLAIN=How many topics to display
+L_TOPIC_SUMMARY_DAYS=How old posts [in days]
+L_TOPIC_SUMMARY_DAYS_EXPLAIN=Posts age for displaying in "Hottest" and "Most viewed" modes.
+L_TOPIC_SUMMARY_REPLIES=How many replies in topic
+L_TOPIC_SUMMARY_REPLIES_EXPLAIN=Minimal number of topic replies for displaying in "Hot" mode.
+
+#
+# Global Header strings
+#
+Last_Post=Last Post
+By=by
+
+No_new_posts=No new posts
+New_posts=New posts
+No_new_posts_hot=No new posts [ Popular ]
+New_posts_hot=New posts [ Popular ]
+No_new_posts_locked=No new posts [ Locked ]
+New_posts_locked=New posts [ Locked ]
+No_new_posts_sticky=No new posts [ Sticky ]
+New_posts_sticky=New posts [ Sticky ]
+No_new_posts_annoucement=No new posts [ Annoucement ]
+New_posts_annoucement=New posts [ Annoucement ]
+Forum_is_locked=Forum is locked
+
+#
+# Index page
+#
+No_Posts=No Posts
+Private_Message=Private Message
+Who_is_Online=Who is Online
+Mark_all_forums=Mark all forums read
+
+#
+# Viewforum
+#
+Forum_not_exist=The forum you selected does not exist.
+Announcements=Announcements
+Sticky_Threads=Sticky Threads
+Normal_Threads=Normal Threads
+Topic_Announcement=Announcement:
+Topic_Sticky=Sticky:
+Topic_Moved=<b>Moved:</b>
+Rules_post_can=You <b>can</b> post new topics in this forum
+Rules_post_cannot=You <b>cannot</b> post new topics in this forum
+Rules_vote_can=You <b>can</b> vote in polls in this forum
+Rules_vote_cannot=You <b>cannot</b> vote in polls in this forum
+Rules_poll_can=You <b>can</b> create polls in this forum
+Rules_poll_cannot=You <b>cannot</b> create polls in this forum
+# %s replaced by a href links, do not remove!
+Forum_moderation=Forum Moderation
+Moderate=Moderate
+Rules_moderate_0=You <b>can</b>&nbsp;
+Rules_moderate_1=You <b>cannot</b>&nbsp;
+Rules_moderate_2=moderate this forum
+Forum_administration=Forum Administration
+Forum_lock=Lock this forum
+Forum_unlock=Unlock this forum
+No_topics_post_one=There are no posts in this forum.<br/><br/>Click on the <b>New Topic</b> link on this page to post one.
+
+#
+# Viewtopic
+#
+
+L_POST_SUBJECT=Post subject
+Post_subject=Post subject
+Submit_vote=Submit Vote
+View_results=View Results
+View_ballot=View Ballot
+No_posts_topic=No posts exist for this topic
+Display_posts=Display posts from previous
+Back_to_top=Back to top
+Read_profile=View user\'s profile
+Send_email=Send e-mail to user
+Visit_website=Visit poster\'s website
+Delete_post=Delete this post
+
+# proceeds the username and is followed by the quoted text
+# comes before bbcode quote output.
+# comes before bbcode code output.
+
+# Last edited by me on 12 Oct 2001; edited 1 time in total
+Edited_time_total=Last edited by {0} on {1}; edited {2} time in total.
+# Last edited by me on 12 Oct 2001; edited 2 times in total
+Edited_times_total=Last edited by {0} on {1}; edited {2} times in total.
+
+Thread_moderation=Thread Moderation
+Lock_topic=Lock this topic
+Unlock_topic=Unlock this topic
+Move_topic=Move this topic
+Delete_topic=Delete this topic
+Split_topic=Split this topic
+Instant_reply=Instant reply
+
+#
+# Posting/Replying (Not private messaging!)
+#
+Message_body=Message body
+
+# If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
+
+Post_a_new_topic=Post a new topic
+Post_a_reply=Post a reply
+Post_topic_as=Post topic as
+Edit_Post=Edit post
+Options=Options
+Compose_Message=Compose Message
+Posting_Description=Subject and Message body are required to post message. Use Message body controls to style your message, add links or images to your message.
+Post_Announcement=Announcement
+Post_Sticky=Sticky
+Post_Normal=Normal
+Confirm_delete=Are you sure you want to delete this post?
+Post_deletion_info=This will delete the {0} post.
+Topic_deletion_info=This will delete the {0} topic and the {1} messages beneath it. Are you sure you want to delete the topic?
+Confirm_delete_poll=Are you sure you want to delete this poll?
+Empty_subject=You must specify a subject when posting a new topic.
+Empty_message=You must enter a message when posting.
+Forum_locked=This forum is locked: you cannot post, reply to, or edit topics.
+Topic_locked=This topic is locked: you cannot edit posts or make replies.
+Empty_poll_title=You must enter a title for your poll.
+Empty_poll_option=You must enter a valid label for your poll option.
+To_few_poll_options=You must enter at least two poll options.
+To_many_poll_options=You have tried to enter too many poll options.
+Wrong_poll_duration=You must enter a valid poll duration time value.
+Add_poll=Add a Poll
+Add_poll_explain=If you do not want to add a poll to your topic, leave the fields blank.
+Poll_question=Poll question
+Poll_option=Poll option
+Add_option=Add option
+Update=Update
+Delete=Delete
+Poll_for=Run poll for
+# This is used for the Run poll for ... Days + in admin_forums for pruning
+Days=Days
+Poll_for_explain=[ Enter 0 or leave blank for a never-ending poll ]
+Delete_poll=Delete Poll
+Delete_post=Delete Post
+
+bbcode_b_help=Bold text: [b]text[/b]  (alt+b)
+bbcode_i_help=Italic text: [i]text[/i]  (alt+i)
+bbcode_u_help=Underline text: [u]text[/u]  (alt+u)
+bbcode_q_help=Quote text: [quote]text[/quote]  (alt+q)
+bbcode_c_help=Code display: [code]code[/code]  (alt+c)
+bbcode_l_help=List: [list]text[/list] (alt+l)
+bbcode_o_help=Ordered list: [list=]text[/list]  (alt+o)
+bbcode_p_help=Insert image: [img]http://image_url[/img]  (alt+p)
+bbcode_w_help=Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]  (alt+w)
+bbcode_a_help=Close all open bbCode tags
+bbcode_s_help=Font color: [color=red]text[/color]  Tip: you can also use color=#FF0000
+bbcode_f_help=Font size: [size=x-small]small text[/size]
+
+Font_color=Font colour
+color_default=Default
+color_dark_red=Dark Red
+color_red=Red
+color_orange=Orange
+color_brown=Brown
+color_yellow=Yellow
+color_green=Green
+color_olive=Olive
+color_cyan=Cyan
+color_blue=Blue
+color_dark_blue=Dark Blue
+color_indigo=Indigo
+color_violet=Violet
+color_white=White
+color_black=Black
+
+Font_size=Font size
+font_tiny=Tiny
+font_small=Small
+font_normal=Normal
+font_large=Large
+font_huge=Huge
+
+Close_Tags=Close Tags
+Styles_tip=Tip: Styles can be applied quickly to selected text.
+
+
+Subject=Subject
+
+No_such_user=Sorry, but no such user exists.
+
+#
+# Profiles/Registration
+#
+
+# %s is username
+L_VIEWING_PROFILE=View Profile
+# %s is username
+
+Preferences=Preferences
+
+L_TOTAL_POSTS=Total posts
+
+Send_email=Send e-mail
+
+Add_Subscribtion=Add Subscribtion
+
+
+Not_Moderator=You are not a moderator of this forum.
+
+
+#
+# Viewonline
+#
+Online_explain=This data is based on users active over the past five minutes
+
+#
+# Moderator Control Panel
+#
+Mod_CP=Forum Moderation
+Mod_CP_explain=From this panel you can lock, unlock, move or delete a single topic or multiple topics by checking the appropriate select boxes on topics.
+L_SELECT=Select
+Select=Select
+Delete=Delete
+Move=Move
+Lock=Lock
+Unlock=Unlock
+Topic_delete_confirm=Delete Topic(s)
+Topic_move_confirm=Move Topic(s)
+Confirm_move_topic=Selected topic(s) to be moved:
+Confirm_delete_topic=This permanently removes the topic(s) and cannot be undone. Are you sure you want to delete the selected topic(s)?
+Move_to_forum=Select a destination
+Leave_shadow_topic=Leave shadow topic in old forum.
+Topics_to_deletion=Selected topic(s) to be deleted:
+
+L_SPLIT_DESTINATION=Destination
+L_SPLIT_TOPIC=Split Topic Control Panel
+L_SPLIT_TOPIC_EXPLAIN=Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post
+L_SPLIT_SUBJECT=New topic title
+L_SPLIT_FORUM=Forum for new topic
+L_SPLIT_POSTS=Split selected posts
+L_SPLIT_AFTER=Split from selected post
+None_selected=You have not selected any topics to perform this operation on.
+ERR_NO_DEST_FORUM=You must select destination forum to perform move operations.
+ERR_INTERNAL=Internal data error - please try again.
+SUCC_TOPIC_MOVED=Move operation succeded!
+ERR_CANNOT_REMOVE_TOPIC=Remove operation failed! Try again!
+SUCC_TOPIC_REMOVED=Deletion succeded!
+SUCC_TOPIC_LOCKED=Lock succeded!
+SUCC_TOPIC_UNLOCKED=Unlock succeded!
+SUCC_TOPIC_SPLITTED=Split successfull!
+ERR_SPLIT_ONE_POST_TOPIC=Cannot split topic with only one post!
+ERR_SPLIT_ALL=Cannot move all posts from splited topic!
+ERR_DEST_FORUM=You have to select destination forum!
+ERR_PERMISSION_VIOLATION=You don't have proper perrmisions - STOP HACKING!!!
+ERR_NO_POST_SELECTED=You have not selected any posts to split.
+ERR_NO_SUBJECT_GIVEN=You have to give subject for new topic.
+
+Please_try_again=Please try again.
+
+#
+# Auth pages
+#
+
+Not_Moderator=Not Moderator
+
+# These are displayed in the drop down boxes for advanced
+# mode forum auth, try and keep them short!
+
+L_POST=Post
+Edit=Edit
+Delete=Delete
+Attachment=Attachment
+
+#
+# Forum Management
+#
+Forum_admin=Categories And Forums
+Forum_admin_explain=From this panel you can add, delete, edit, re-order and re-synchronise categories and forums
+Edit_forum=Edit Forum
+Create_forum=Add New Forum
+Forum_created_0=The Forum
+Forum_created_1=was successfully created.
+Forum_updated_0=The Forum
+Forum_updated_1=was successfully updated.
+Forum_deleted_0=The Forum
+Forum_deleted_1=was successfully deleted.
+Create_category=Add New Category
+Category_created_0=The Category
+Category_created_1=was successfully created.
+Category_updated_0=The Category
+Category_updated_1=was successfully updated.
+Category_deleted_0=The Category
+Category_deleted_1=was successfully deleted.
+Edit=Edit
+Create=Create
+Delete=Delete
+Move_up=Move up
+Move_down=Move down
+Delete_all_topics_posts=Delete All Topics/Posts
+Move_contents=Move all contents to - 
+Forum_delete=Delete Forum
+Forum_delete_explain=The form below will allow you to delete a forum (or category) and decide where you want to put all topics (or forums) it contained.
+Forum_locked=Forum locked
+Forum_unlocked=Forum unlocked
+Forum_name=Forum name
+Forum_desc=Description
+Forum_category=Forum category
+Category_name=Category name
+Edit_Category=Edit Category
+Delete_all_forums_topics_posts=Delete All Forums/Topics/Posts
+
+Download=Download
+
+#
+# MyForums View Messages
+#
+
+MyForums_title=MyForums
+MyForums_info=This is your personalized forum view. From here, you can view and manage your subscribed forums, subscribed topics and email notifications.
+Subscribed_topics_info=Subscribed Topics with New Posts
+Subscribed_forums_info=Subscribed Forums
+NoNewPosts=There are no new posts to your subscribed threads.
+ViewAllSubscribed=View All Subscribed Topics
+EditAllSubscribed=Edit Subscribed Forums Notifications
+NotSubscribingToAnyForum=You are not subscribing to any forum.
+Notification=Notification
+
+#
+# From the mod "Watched Topics List" (http://www.netclectic.com/)
+# plus some custom for the forum watches
+#
+Watch_Login_Requirement=You must be logged in to Watch Forums
+Subscribe_to_forum=Subscribe to forum
+Unsubscribe_from_forum=UnSubscribe from forum
+Subscribe_to_topic=Subscribe to topic
+Unsubscribe_from_topic=Unsubscribe from topic
+Selected_topic=Selected topic
+Selected_forum=Selected forum
+Notification_type=Notification type
+
+Attachment=Attachment
+
+// Viewtopic -> Display of Attachments
+Description=Description
+// used in Administration Panel too...
+Download=Download 
+// this Language Variable is defined in lang_admin.php too, but we are unable to access it from the main Language File
+Filesize=Filesize
+
+// Posting/PM -> Posting Attachments
+Add_attachment=Add Attachment
+Add_attachment_title=Add an Attachment
+Add_attachment_explain=If you do not want to add an Attachment to your Post, please leave the Fields blank
+File_name=Filename
+File_comment=File Comment
+
+// Posting/PM -> Posted Attachments
+Posted_attachments=Posted Attachments
+Options=Options
+Update_comment=Update Comment
+Delete_attachment=Delete Attachment
+
+EMAIL_VIEWORIGINAL=View the original post
+EMAIL_REPLY=Reply to the post
+EMAIL_LINKED_MODE_INFO=You are receiving this e-mail because you subscribed to
+EMAIL_FOOTER_MESSAGE=This message is generated automaticaly. Please do not reply.
+EMAIL_NO_NOTIFICATION=No Notification by Email
+EMAIL_LINKED_NOTIFICATION=Linked mode Email notification
+EMAIL_EMBEDED_NOTIFICATION=Embeded mode Email notification
+SELECT_NOTIFICATION_TYPE=Select notification type
+
+// BB Code variables
+Message_code=Code
+Message_quote=Quote
+Message_wrote=wrote
+
+Category_delete=Delete Category
+
+topiclockederr=This topic is locked. Modifying any posts or replying to this topic is not allowed
+
+Search_keywords=Keywords
+Search_keywords_note=You can use AND to define words which must be in the results, OR to define words which may be in the result and NOT to define words which should not be in the result. Use quotes to search for a specific phrase. Use * as a wildcard for partial matches.
+Search_author=Author
+Search_author_note=Use * as a wildcard for partial matches.
+Search_advanced=Advanced Search
+Search_category=Limit search within a specific Category:
+Search_forum=Limit search within a specific Forum:
+Search_time_period=Limit search to a time period:
+Search_all_posts=All Posts
+Search_1_day=1 Day
+Search_7_days=7 Days
+Search_2_weeks=2 Weeks
+Search_1_month=1 Month
+Search_3_months=3 Months
+Search_6_months=6 Months
+Search_1_year=1 Year
+Search_searching=Searching titles and message text:
+Search_title_message=Search topic title and message text
+Search_message=Search message text only
+Search_sort=Sort search results by:
+Search_post_time=Post Time
+Search_post_subject=Post Subject
+Search_author=Author
+Search_forum=Forum
+Search_ascending=Ascending
+Search_descending=Descending
+Search_search=Search
+Search_reset=Reset
+Search_found=Search found {0} matches
+Search_topics_not_found=No topics found
+Search_posts_not_found=No posts found
+Search_display_as=Display results as:
+Search_display_as_topics=Topics
+Search_display_as_posts=Posts

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_de.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_de.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_de.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,471 @@
+#
+# Common, these terms are used
+# extensively on several pages
+#
+Forum=Forum
+Category=Kategorie
+Topics=Themen
+Replies=Antworten
+Views=Aufrufe
+Posts=Beitr\u00e4ge
+L_POSTED=Verfasst am
+Posted=Verfasst am
+L_AUTHOR=Autor
+Author=Autor
+Message=Nachricht
+Permalink=[ permalink ]
+Powered_by=Powered by
+Jump_to=Gehe zu
+
+period_1_Day=1 Tag
+period_7_Days=7 Tage
+period_2_Weeks=2 Wochen
+period_1_Month=1 Monat
+period_3_Months=3 Monate
+period_6_Months=6 Monate
+period_1_Year=1 Jahr
+
+Go=Los
+Submit=Absenden
+Cancel=Zur\u00fccksetzen
+Preview=Vorschau
+Confirm=Best\u00e4tigung
+Yes=Ja
+No=Nein
+Back=Zur\u00fcck
+
+Next=Weiter
+Previous=Zur\u00fcck
+Goto_page=Gehe zu Seite
+Last_page=Letzte Seite
+Last=Letzte
+First=Erste
+L_JOINED=Anmeldedatum
+
+Select_forum=W\u00e4hle Forum
+# Replaces with: Page 1 of 2 for example
+PageNumber=Seite {0} von {1}
+
+ICQ=ICQ Nummer
+AIM=AIM Addresse
+YIM=Yahoo Messenger
+
+# eg. sitename Forum Index, %s can be removed if you prefer
+
+Post_new_topic=Neues Thema
+Reply_to_topic=Antwort erstellen
+
+# %s's here are for uris, do not remove!
+
+Admin_panel=Administrations-Bereich
+Home=Home
+My_Forums=Meine Foren
+
+#
+# Forums Preferences
+#
+L_LOGIN_REQUIRED=Du musst dich einloggen um deine Forumseinstellungen zu verwalten
+L_EMAIL_ADDRESS=Email Addresse
+L_ICQ_NUMBER=ICQ Nummer
+L_AIM=AIM
+L_MESSENGER=Messanger
+L_YAHOO=Yahoo
+L_SKYPE=Skype
+L_WEBSITE=Webseite
+L_LOCATION=Wohnort
+L_OCCUPATION=Beruf
+L_INTERESTS=Interessen
+L_SIGNATURE=Signatur
+L_SIGNATURE_EXPLAIN=Tekst unter jedem Beitrag
+L_PREFERENCES=Einstellungen
+L_YES=Ja
+L_NO=Nein
+L_NOTIFY_ON_REPLY=Bei Antworten benachrichtigen
+L_NOTIFY_ON_REPLY_EXPLAIN=Sendet eine E-Mail, wenn einer deiner Beitr\u00e4ge beantwortet wurde.
+L_ALWAYS_ADD_SIGNATURE=Signatur immer anh\u00e4ngen
+L_ALWAYS_ALLOW_HTML=HTML immer aktivieren
+L_DATE_FORMAT=Datums-Format
+L_SUBMIT=Absenden
+L_RESET=Zur\u00fccksetzen
+L_POST_ORDER=Reihenfolge der Beitr\u00e4ge
+L_POSTS_PER_TOPIC=Beitr\u00e4ge pro Seite
+L_POSTS_PER_TOPIC_EXPLAIN=Anzahl der Beitr\u00e4ge auf einer Seite
+L_ASCENDING=aufsteigend
+L_DESCENDING=absteigend
+L_TOPICS_PER_FORUM=Themen pro Seite
+L_TOPICS_PER_FORUM_EXPLAIN=Anzahl der Themen auf einer Seite
+L_USER_INFO=Informationen
+L_MODE_HOT_TOPICS=Hot topics (above some number of replies)
+L_MODE_HOTTEST_TOPICS=Hottest topics (most replied)
+L_MODE_LATEST_POSTS=Latest posted topics
+L_MODE_MOST_VIEWED=Most viewed topics
+L_TOPICS_FOUND=Themen gefunden.
+L_TOPIC_SUMMARY=Themen\u00fcbersicht
+L_MODE_CHOOSE=W\u00e4hle Modus f\u00fcr \u00dcbersicht
+L_MODE_CHOOSE_EXPLAIN=Wass soll im minimiertem Portlet-Fenster angezeigt werden
+L_TOPIC_SUMMARY_LIMIT=Maximale Anzahl
+L_TOPIC_SUMMARY_LIMIT_EXPLAIN=Anzahl der gezeigten Themen
+L_TOPIC_SUMMARY_DAYS=Alter der Beitr\u00e4ge [in Tagen]
+L_TOPIC_SUMMARY_DAYS_EXPLAIN=Alter der Beitr\u00e4ge um im "Hottest"- und "Most viewed"-modus gezeigt zu werden.
+L_TOPIC_SUMMARY_REPLIES=Anzahl der Beitr\u00e4ge
+L_TOPIC_SUMMARY_REPLIES_EXPLAIN=Beitr\u00e4ge, die ein Thema braucht, um als "Hot" gezeigt zu werden.
+
+#
+# Global Header strings
+#
+Last_Post=Letzter Beitrag
+By=von
+
+No_new_posts=Keine neuen Beitr\u00e4ge
+New_posts=Neue Beitr\u00e4ge
+No_new_posts_hot=Keine neuen Beitr\u00e4ge [ Top-Thema ]
+New_posts_hot=Neue Beitr\u00e4ge [ Top-Thema ]
+No_new_posts_locked= Keine neuen Beitr\u00e4ge [ Gesperrt ]
+New_posts_locked= Neue Beitr\u00e4ge [ Gesperrt ]
+No_new_posts_sticky= Keine neuen Beitr\u00e4ge [ Wichtig ]
+New_posts_sticky= Neue Beitr\u00e4ge [ Wichtig ]
+No_new_posts_annoucement= Keine neuen Beitr\u00e4ge [ Ank\u00fcndigung ]
+New_posts_annoucement= Neue Beitr\u00e4ge [ Ank\u00fcndigung ]
+Forum_is_locked=Forum ist gesperrt
+
+#
+# Index page
+#
+No_Posts=Keine Beitr\u00e4ge
+Private_Message=Private Nachricht
+Who_is_Online=Wer ist online
+Mark_all_forums=Alle Foren als gelesen markieren
+
+#
+# Viewforum
+#
+Forum_not_exist=Das ausgew\u00e4hlte Forum existiert nicht.
+Announcements=Ank\u00fcndigungen
+Sticky_Threads=Wichtige Themen
+Normal_Threads=Normale Themen
+Topic_Announcement=Ank\u00fcndigung:
+Topic_Sticky=Wichtig:
+Topic_Moved=<b>Verschoben:</b>
+Rules_post_can=Du <b>kannst</b> Beitr\u00e4ge in dieses Forum schreiben
+Rules_post_cannot=Du <b>kannst keine</b> Beitr\u00e4ge in dieses Forum schreiben
+Rules_vote_can=Du <b>kannst</b> an Umfragen in diesem Forum teilnehmen
+Rules_vote_cannot=Du <b>kannst</b> an Umfragen in diesem Forum <b>nicht</b> teilnehmen
+Rules_poll_can=Du <b>kannst</b> Umfragen in diesem Forum erstellen
+Rules_poll_cannot=Du <b>kannst</b> Umfragen in diesem Forum <b>nicht</b>erstellen
+# %s replaced by a href links, do not remove!
+Forum_moderation=Forum Moderation
+Moderate=Moderieren
+Rules_moderate_0=Du <b>kannst</b>&nbsp;
+Rules_moderate_1=Du <b>kannst nicht</b>&nbsp;
+Rules_moderate_2=dieses Forum moderieren
+Forum_administration=Forum Administration
+Forum_lock=Sperre dieses Forum
+Forum_unlock=Entsperre dieses Forum
+No_topics_post_one=In diesem Forum sind noch keine Beitr\u00e4ge vorhanden.<br/><br/>Klicke auf <b>Neues Thema</b>, um den ersten Beitrag zu erstellen .
+
+#
+# Viewtopic
+#
+
+L_POST_SUBJECT=Neues Thema
+Post_subject=Neues Thema
+Submit_vote=Stimme absenden
+View_results=Ergebniss anzeigen
+View_ballot=Umfrage anzeigen
+No_posts_topic=F\u00fcr dieses Thema sind noch keine Beitr\u00e4ge vorhanden
+Display_posts=Vorherige Beitr\u00e4ge anzeigen
+Back_to_top=Nach oben
+Read_profile=Benutzer-Profil anzeigen
+Send_email=E-mail senden
+Visit_website=Webseite dieses Benutzers besuchen
+Delete_post=Beitrag l\u00F6schen
+
+# proceeds the username and is followed by the quoted text
+# comes before bbcode quote output.
+# comes before bbcode code output.
+
+# Last edited by me on 12 Oct 2001; edited 1 time in total
+Edited_time_total=Zuletzt bearbeitet von {0} am {1}; insgesammt {2} mal bearbeitet.
+# Last edited by me on 12 Oct 2001; edited 2 times in total
+Edited_times_total= Zuletzt bearbeitet von {0} am {1}; insgesammt {2} mal bearbeitet.
+
+Thread_moderation=Thread Moderation
+Lock_topic=Thema sperren
+Unlock_topic=Thema entsperren
+Move_topic=Thema verschieben
+Delete_topic=Thema l\u00F6schen
+Split_topic=Thema teilen
+Instant_reply=Schnelle Antwort
+
+#
+# Posting/Replying (Not private messaging!)
+#
+Message_body=Nachrichtentext
+
+# If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
+
+Post_a_new_topic=Neues Thema erstellen
+Post_a_reply=Antwort erstellen
+Post_topic_as=Thema schreiben als
+Edit_Post=Beitrag bearbeiten
+Options=Optionen
+Compose_Message=Nachricht erstellen
+Posting_Description=Titel und Nachrichtentext m\u00fcssen angegeben werden. Benutze das Steuerungsmenu um den Schriftstiel zu ver\u00e4ndern, eine URL oder ein Bild einzuf\u00fcgen.
+Post_Announcement=Ank\u00fcundigung
+Post_Sticky=Wichtig
+Post_Normal=Normal
+Confirm_delete=Bist du sicher, dass dieser Beitrag gel\u00F6scht werden soll?
+Post_deletion_info=L\u00F6sche den Beitrag {0}.
+Topic_deletion_info=L\u00F6sche das Thema {0} und die darin enthaltenen {1} Nachrichten.
+Confirm_delete_poll=Bist du sicher, dass diese Umfrage gel\u00F6scht werden soll?
+Empty_subject=Du musst einen Titel beim neuen Thema angeben.
+Empty_message=Du musst zu deinem Beitrag einen Text angeben.
+Forum_locked=Dieses Forum ist gesperrt: du kannst keine Themen erstellen, editieren oder beantworten.
+Topic_locked=Dieses Thema ist gesperrt: du kannst keine Beitr\u00e4ge editieren oder beantworten.
+Empty_poll_title=Du musst einen Titel f\u00fcr deine Umgrage angeben.
+Empty_poll_option=Du musst einen richtigen Wert f\u00fcr die Etikette der Antwort angeben.
+To_few_poll_options=Du musst mindestens zwei Antworten f\u00fcr die Umfrage angeben.
+To_many_poll_options=Du hast zu viele Antworten angegeben.
+Wrong_poll_duration=Du musst einen richtigen Wert f\u00fcr die Dauer der Umfrage angeben.
+Add_poll=Umfrage hinzuf\u00fcgen
+Add_poll_explain=Wenn du keine Umfrage zum Thema hinzuf\u00fcgen willst, lasse das Feld bitte leer.
+Poll_question=Frage
+Poll_option=Antwort
+Add_option=Antwort hinzuf\u00fcgen
+Update=Aktualisieren
+Delete=L\u00F6schen
+Poll_for=Dauer der Umfrage
+# This is used for the Run poll for ... Days + in admin_forums for pruning
+Days=Tage
+Poll_for_explain=[ Gib 0 ein oder lasse dieses Feld leer, um die Umfrage auf unbeschr\u00e4nkte Zeit durchzuf\u00fchren ]
+Delete_poll=Umfrage l\u00F6schen
+Delete_post=Beitrag l\u00F6schen
+
+bbcode_b_help=Text in fett: [b]Text[/b]  (alt+b)
+bbcode_i_help=Text in kursiv: [i]Text[/i]  (alt+i)
+bbcode_u_help=Unterstrichener Text: [u]Text[/u]  (alt+u)
+bbcode_q_help=Zitat: [quote]Text[/quote]  (alt+q)
+bbcode_c_help=Code anzeigen: [code]Code[/code]  (alt+c)
+bbcode_l_help=Liste: [list]Text[/list] (alt+l)
+bbcode_o_help=Geordnete Liste: [list=]Text[/list]  (alt+o)
+bbcode_p_help=Bild einf\u00fcgen: [img]http://URL_des_Bildes[/img]  (alt+p)
+bbcode_w_help=URL einf\u00fcgen: [url]http://URL[/url] oder [url=http://url]URL Text[/url]  (alt+w)
+bbcode_a_help=Alle offenen BBCodes schlie\u00dfen
+bbcode_s_help=Schriftfarbe: [color=red]Text[/color]  Tipp: Du kannst ebenfalls color=#FF0000 benutzen
+bbcode_f_help=Schriftgr\u00F6\u00dfe: [size=x-small]Kleiner Text[/size]
+
+Font_color= Schriftfarbe
+color_default=Standard
+color_dark_red=Dunkelrot
+color_red=Rot
+color_orange=Orange
+color_brown=Braun
+color_yellow=Gelb
+color_green=Gr\u00fcn
+color_olive=Oliv
+color_cyan=Cyan
+color_blue=Blau
+color_dark_blue=Dunkelblau
+color_indigo=Indigo
+color_violet=Violett
+color_white=Wei\u00df
+color_black=Schwarz
+
+Font_size=Schriftgr\u00F6\u00dfe
+font_tiny=Winzig
+font_small= Klein
+font_normal=Normal
+font_large=Gro\u00df
+font_huge= Riesig
+
+Close_Tags=Tags schlie\u00dfen
+Styles_tip=Tipp: Schriftformatierung kann schnell an markiertem Text vorgenommen werden.
+
+
+Subject=Betreff
+
+No_such_user=Dieser Benutzer wurde nicht gefunden
+
+#
+# Profiles/Registration
+#
+
+# %s is username
+L_VIEWING_PROFILE=Profilansicht
+# %s is username
+
+Preferences=Einstellungen
+
+L_TOTAL_POSTS=Beitr\u00e4ge gesammt
+
+Send_email=E-Mail senden
+
+Add_Subscribtion=Abo hinzuf\u00fcgen
+Topic_delete_confirm=Themen l\u00F6schen
+
+Not_Moderator=You are not a moderator of this forum.
+
+
+#
+# Viewonline
+#
+Online_explain=Diese Daten zeigen an, wer in den letzten 5 Minuten online war
+
+#
+# Moderator Control Panel
+#
+Mod_CP=Moderator Kontrollzentrum
+Mod_CP_explain=Mit dem unteren Men\u00fc kannst du mehrere Moderatoren-Operationen gleichzeitig ausf\u00fchren. Du kannst Beitr\u00e4ge \u00F6ffnen, schlie\u00dfen, l\u00F6schen oder verschieben.
+L_SELECT=Ausw\u00e4hlen
+Select=Ausw\u00e4hlen
+Delete=L\u00F6schen
+Move=Verschieben
+Lock=Sperren
+Unlock=Entsperren
+Confirm_move_topic=Bist du sicher, dass die gew\u00e4hlten Themen verschoben werden sollen?
+Move_to_forum=Verschieben nach
+Leave_shadow_topic=Shadow Topic im alten Forum lassen.
+
+L_SPLIT_TOPIC=Split Topic Kontrollzentrum
+L_SPLIT_TOPIC_EXPLAIN=Mit den Eingabefeldern unten kannst du ein Thema in zwei teilen, indem du entweder die Beitr\u00e4ge manuell ausw\u00e4hlst oder ab einem gew\u00e4hlten Beitrag teilst
+L_SPLIT_SUBJECT=Titel des neuen Themas
+L_SPLIT_FORUM=Forum des neuen Themas
+L_SPLIT_POSTS=Gew\u00e4hlte Beitr\u00e4ge teilen
+L_SPLIT_AFTER=Ab gew\u00e4hltem Beitrag teilen
+ERR_NO_DEST_FORUM=Du hast keine Themen ausgew\u00e4hlt, auf denen diese Aktion ausgef\u00fchrt werden soll. Bitte w\u00e4hle mindestens eines aus.
+ERR_INTERNAL=Fehler ist aufgetreten - bitte versuche es noch einmal.
+SUCC_TOPIC_MOVED=Das gew\u00e4hlte Thema wurde verschoben!
+ERR_CANNOT_REMOVE_TOPIC=Das gew\u00e4hlte Thema wurde nicht verschoben! Versuche es noch einmal!
+SUCC_TOPIC_REMOVED=Das gew\u00e4hlte Thema wurde erfolgreich gel\u00F6scht!
+SUCC_TOPIC_LOCKED=Das gew\u00e4hlte Thema wurde erfolgreich gesperrt!
+SUCC_TOPIC_UNLOCKED=Das gew\u00e4hlte Thema wurde erfolgreich entsperrt!
+SUCC_TOPIC_SPLITTED=Das gew\u00e4hlte Thema wurde erfolgreich geteilt!
+ERR_SPLIT_ONE_POST_TOPIC=Es ist nicht m\u00F6glich Themen mit nur einem Beitrag zu teilen!
+ERR_SPLIT_ALL=Es ist nicht m\u00F6glich alle Beitr\u00e4ge vom geteilten Thema zu verschieben!
+ERR_DEST_FORUM=Du musst ein Forum ausw\u00e4hlen!
+ERR_PERMISSION_VIOLATION=Du hast keine entsprechenden Rechte - STOP HACKING!!!
+ERR_NO_POST_SELECTED=Du hast keine Beitr\u00e4ge ausgew\u00e4hlt, die geteilt werden sollen.
+ERR_NO_SUBJECT_GIVEN=Du musst einen Titel beim neuen Thema angeben.
+
+Please_try_again=Bitte versuche es noch einmal.
+
+#
+# Auth pages
+#
+
+Not_Moderator=Kein Moderator
+
+# These are displayed in the drop down boxes for advanced
+# mode forum auth, try and keep them short!
+
+L_POST=Posten
+Edit=Bearbeiten
+Delete=L\u00F6schen
+Attachment=Dateianhang
+
+#
+# Forum Management
+#
+Forum_admin=Kategorien und Foren
+Forum_admin_explain=Hier kannst du Kategorien und Foren hinzuf\u00fcgen, l\u00F6schen, bearbeiten und neu anordnen
+Edit_forum=Forum bearbeiten
+Create_forum=Neues Forum erstellen
+Forum_created_0=Das Forum
+Forum_created_1=wurde erfolgreich erstellt.
+Forum_updated_0=Das Forum
+Forum_updated_1=wurde erfolgreich aktualisiert.
+Forum_deleted_0=Das Forum
+Forum_deleted_1=wurde erfolgreich gel\u00F6scht.
+Create_category=Neue Kategorie erstellen
+Category_created_0=Die Kategorie
+Category_created_1=wurde erfolgreich erstellt.
+Category_updated_0=Die Kategorie
+Category_updated_1=wurde erfolgreich aktualisiert.
+Category_deleted_0=Die Kategorie
+Category_deleted_1=wurde erfolgreich gel\u00F6scht.
+Edit=Bearbeiten
+Create=
+Delete=L\u00F6schen
+Move_up=Nach oben
+Move_down=Nach unten
+Delete_all_topics_posts=Alle Themen/Beitr\u00e4ge l\u00F6schen
+Move_contents=Alle Inhalte verschieben - 
+Forum_delete=Forum l\u00F6schen
+Forum_delete_explain=Hier kannst du ein Forum oder eine Kategorie l\u00F6schen und entscheiden, wohin die enthaltenen Themen oder Foren verschoben werden sollen.
+Forum_locked=Forum gesperrt
+Forum_unlocked=Forum entsperrt
+Forum_name=Forumsname
+Forum_desc=Beschreibung
+Forum_category=Kategorie
+Category_name=Kategoriename
+Edit_Category=Kategorie bearbeiten
+Delete_all_forums_topics_posts=Alle Foren/Themen/Beitr\u00e4ge l\u00F6schen
+
+Download=Herunterladen
+
+#
+# MyForums View Messages
+#
+
+MyForums_title=MyForums
+MyForums_info=Hier kannst du Foren und Themen, die du abonnierst und Benachrichtigungen per E-Mail, verwalten.
+Subscribed_topics_info=Abonnierte Themen mit neuen Beitr\u00e4gen
+Subscribed_forums_info=Abonnierte Foren
+NoNewPosts=Keine neuen Beitr\u00e4ge in deinen abonnierten Themen.
+ViewAllSubscribed=Alle abonnierten Themen zeigen
+EditAllSubscribed=Abonnierte Foren Benachrichtigungen bearbeiten
+NotSubscribingToAnyForum=Du abonnierst zur Zeit kein Forum.
+Notification=Benachrichtigung
+
+#
+# From the mod "Watched Topics List" (http://www.netclectic.com/)
+# plus some custom for the forum watches
+#
+Watch_Login_Requirement=Du must dich einloggen, um ein Thema zu beobachten
+Subscribe_to_forum=Forum abonnieren
+Unsubscribe_from_forum=Forum-Abo abstellen
+Subscribe_to_topic=Thema abonnieren
+Unsubscribe_from_topic=Thema-Abo abstellen
+Selected_topic=Gew\u00e4hltes Thema
+Selected_forum= Gew\u00e4hltes Forum
+Notification_type=Benachrichtigungsmodus
+
+Attachment=Dateianhang
+
+// Viewtopic -> Display of Attachments
+Description=Beschreibung
+// used in Administration Panel too...
+Download=Herunterladen
+// this Language Variable is defined in lang_admin.php too, but we are unable to access it from the main Language File
+Filesize=Dateigr\u00F6\u00dfe
+
+// Posting/PM -> Posting Attachments
+Add_attachment=Dateianhang hinzuf\u00fcgen
+Add_attachment_title=F\u00fcgt einen Dateianhang hinzu
+Add_attachment_explain=Wenn du keinen Dateianhang zum Thema hinzuf\u00fcgen willst, lass das Feld bitte leer
+File_name=Dateiname
+File_comment=Kommentar
+
+// Posting/PM -> Posted Attachments
+Posted_attachments=Hinzugef\u00fcgte Dateianh\u00e4nge
+Options=Optionen
+Update_comment=Kommentar aktualisieren
+Delete_attachment=Dateianhang l\u00F6schen
+
+EMAIL_VIEWORIGINAL=Original-Nachricht zeigen
+EMAIL_REPLY=Neue Antwort erstellen
+EMAIL_LINKED_MODE_INFO=Du erh\u00e4lst diese E-Mail weil du abonnierst
+EMAIL_FOOTER_MESSAGE=Diese Nachricht wird automatisch erzeugt. Bitte nicht antworten.
+EMAIL_NO_NOTIFICATION=Keine E-Mail Benachrichtigung
+EMAIL_LINKED_NOTIFICATION=Linked mode E-Mail Benachrichtigung
+EMAIL_EMBEDED_NOTIFICATION=Embeded mode E-Mail Benachrichtigung
+SELECT_NOTIFICATION_TYPE=W\u00e4hle Benachrichtigungsmodus
+
+// BB Code variables
+Message_code=Code
+Message_quote=Zitat
+Message_wrote=hat Folgendes geschrieben
+
+Category_delete=Kategorie l\u00F6schen
+
+topiclockederr=Dieses Thema ist gesperrt, du kannst keine Beitr\u00e4ge bearbeiten oder beantworten

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,471 @@
+#
+# Common, these terms are used
+# extensively on several pages
+#
+Forum=Forum
+Category=Catégorie
+Topics=Sujets
+Replies=Réponses
+Views=Consultations
+Posts=Messages
+L_POSTED=Envoyé
+Posted=Envoyé
+L_AUTHOR=Auteur
+Author=Auteur
+Message=Message
+Permalink=[ lien permanent ]
+Powered_by=Alimenté par
+Jump_to=Aller à
+
+period_1_Day=1 jour
+period_7_Days=7 jours
+period_2_Weeks=2 semaines
+period_1_Month=1 mois
+period_3_Months=3 mois
+period_6_Months=6 mois
+period_1_Year=1 an
+
+Go=Go
+Submit=Soumettre
+Cancel=Annuler
+Preview=Visualiser
+Confirm=Confirmer
+Yes=Oui
+No=Non
+Back=Retour
+
+Next=Suivant
+Previous=Précédent
+Goto_page=Aller à la page
+Last_page=Dernière page
+Last=Dernier
+First=Premier
+L_JOINED=Enregistré
+
+Select_forum=Choisir un forum
+# Replaces with: Page 1 of 2 for example
+PageNumber=Page {0} de {1}
+
+ICQ=Numéro ICQ
+AIM=Adresse AIM
+YIM=Yahoo Messenger
+
+# eg. sitename Forum Index, %s can be removed if you prefer
+
+Post_new_topic=Publier un nouveau sujet
+Reply_to_topic=Répondre à ce sujet
+
+# %s's here are for uris, do not remove!
+
+Admin_panel=Administration
+Home=Accueil
+My_Forums=Mes Forums
+
+#
+# Forums Preferences
+#
+L_LOGIN_REQUIRED=Vous devez être authentifié afin de modifier vos préférences
+L_EMAIL_ADDRESS=Courriel
+L_ICQ_NUMBER=ICQ
+L_AIM=AIM
+L_MESSENGER=Messenger
+L_YAHOO=Yahoo
+L_SKYPE=Skype
+L_WEBSITE=Site web
+L_LOCATION=Lieu de résidence
+L_OCCUPATION=Occupation
+L_INTERESTS=Intérêts
+L_SIGNATURE=Signature
+L_SIGNATURE_EXPLAIN=Signature à la fin de vos messages
+L_PREFERENCES=Préférences
+L_YES=Oui
+L_NO=Non
+L_NOTIFY_ON_REPLY=M'aviser si réponse
+L_NOTIFY_ON_REPLY_EXPLAIN=M'aviser si une réponse est ajoutée à mon message
+L_ALWAYS_ADD_SIGNATURE=Toujours ajouter ma signature
+L_ALWAYS_ALLOW_HTML=Toujours autoriser le HTML
+L_DATE_FORMAT=Format de date
+L_SUBMIT=Soumettre
+L_RESET=Recommencer
+L_POST_ORDER=Ordre des messages
+L_POSTS_PER_TOPIC=Messages par page
+L_POSTS_PER_TOPIC_EXPLAIN=Combien de messages par page voulez-vous afficher à la fois
+L_ASCENDING=Croissant
+L_DESCENDING=Décroissant
+L_TOPICS_PER_FORUM=Sujets par page
+L_TOPICS_PER_FORUM_EXPLAIN=Combien de sujets par page voulez-vous afficher à la fois
+L_USER_INFO=Information
+L_MODE_HOT_TOPICS=Sujets populaires (plus qu'un certain nombre de messages)
+L_MODE_HOTTEST_TOPICS=Sujets les plus populaires (les plus répondus)
+L_MODE_LATEST_POSTS=Nouveaux sujets
+L_MODE_MOST_VIEWED=Sujets les plus vus
+L_TOPICS_FOUND=sujets trouvés.
+L_TOPIC_SUMMARY=Résumé du sujet
+L_MODE_CHOOSE=Choisissez le type de résumé
+L_MODE_CHOOSE_EXPLAIN=Que voulez-vous voir apparaître dans un portlet minimisé
+L_TOPIC_SUMMARY_LIMIT=Limite de sujets
+L_TOPIC_SUMMARY_LIMIT_EXPLAIN=Combien afficher de sujets
+L_TOPIC_SUMMARY_DAYS=Sujets de quel âge (en jours)
+L_TOPIC_SUMMARY_DAYS_EXPLAIN=Âge des sujets à inclure dans les plus populaires et les plus répondus.
+L_TOPIC_SUMMARY_REPLIES=Sujets ayant combien de réponses
+L_TOPIC_SUMMARY_REPLIES_EXPLAIN=Nombre minimal de réponses à un sujet pour l'inclure dans les plus répondus
+
+#
+# Global Header strings
+#
+Last_Post=Dernier message
+By=par
+
+No_new_posts=Aucun nouveau message
+New_posts=Nouveaux messages
+No_new_posts_hot=Aucun nouveau message [ Populaire ]
+New_posts_hot=Nouveaux messages [ Populaire ]
+No_new_posts_locked=Aucun nouveau message [ Vérouillé ]
+New_posts_locked=Nouveaux messages [ Vérouillé ]
+No_new_posts_sticky=Aucun nouveau message [ Permanent ]
+New_posts_sticky=Nouveaux messages [ Permanent ]
+No_new_posts_annoucement=Aucun nouveau message [ Avis ]
+New_posts_annoucement=Nouveaux messages [ Avis ]
+Forum_is_locked=Forum vérouillé
+
+#
+# Index page
+#
+No_Posts=Aucun message
+Private_Message=Message privé
+Who_is_Online=Qui est en ligne
+Mark_all_forums=Marquer les forums comme lus
+
+#
+# Viewforum
+#
+Forum_not_exist=Le forum choisi n'existe pas.
+Announcements=Avis
+Sticky_Threads=Sujets permanents
+Normal_Threads=Sujets réguliers
+Topic_Announcement=Avis:
+Topic_Sticky=Message permanent:
+Topic_Moved=<b>Déplacé:</b>
+Rules_post_can=Vous <b>pouvez</b> ajouter des sujets à ce forum
+Rules_post_cannot=Vous <b>ne pouvez pas</b> ajouter des sujets à ce forum
+Rules_vote_can=Vous <b>pouvez</b> voter sur les sondages de ce forum
+Rules_vote_cannot=Vous <b>ne pouvez pas</b> voter sur les sondages de ce forum
+Rules_poll_can=Vous <b>pouvez</b> créer des sondages dans ce forum
+Rules_poll_cannot=Vous <b>ne pouvez pas</b> créer de sondage dans ce forum
+# %s replaced by a href links, do not remove!
+Forum_moderation=Modération
+Moderate=Modérer
+Rules_moderate_0=Vous <b>pouvez</b>&nbsp;
+Rules_moderate_1=Vous <b>ne pouvez pas</b>&nbsp;
+Rules_moderate_2=modérer ce forum
+Forum_administration=Administration du forum
+Forum_lock=Vérouiller ce forum
+Forum_unlock=Dévérouiller ce forum
+No_topics_post_one=Il n'y a présentement pas de sujets dans ce forum. <br/><br/>Cliquez sur le lien <b>Nouveau sujet</b> au bas de la page pour en créer un.
+
+#
+# Viewtopic
+#
+
+L_POST_SUBJECT=Sujet du message
+Post_subject=Sujet du message
+Submit_vote=Voter
+View_results=Voir les résultats
+View_ballot=Voter
+No_posts_topic=Aucun message pour ce sujet
+Display_posts=Afficher les messages du précédent
+Back_to_top=Retour au haut
+Read_profile=Voir le profil de l'utilisateur
+Send_email=Envoyer un courriel à cet utilisateur
+Visit_website=Visiter le site web de cet utilisateur
+Delete_post=Supprimer ce message
+
+# proceeds the username and is followed by the quoted text
+# comes before bbcode quote output.
+# comes before bbcode code output.
+
+# Last edited by me on 12 Oct 2001; edited 1 time in total
+Edited_time_total=Dernière modification par {0}, {1}; modifié {2} fois au total.
+# Last edited by me on 12 Oct 2001; edited 2 times in total
+Edited_times_total=Dernière modification par {0}, {1}; modifié {2} fois au total.
+
+Thread_moderation=Modérer ce sujet
+Lock_topic=Vérouiller ce sujet
+Unlock_topic=Dévérouiller ce sujet
+Move_topic=Déplacer ce sujet
+Delete_topic=Supprimer ce sujet
+Split_topic=Séparer ce sujet
+Instant_reply=Réponse rapide
+
+#
+# Posting/Replying (Not private messaging!)
+#
+Message_body=Corps du message
+
+# If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
+
+Post_a_new_topic=Soumettre un nouveau sujet
+Post_a_reply=Répondre
+Post_topic_as=Soumettre un nouveau sujet en tant que
+Edit_Post=Modifier le message
+Options=Options
+Compose_Message=Composer un message
+Posting_Description=Vous devez ajouter un sujet et du contenu au message afin de le soumettre. Utilisez les contrôles prévus à cette fin afin d'ajouter des images et des liens.
+Post_Announcement=Avis
+Post_Sticky=Permanent
+Post_Normal=Normal
+Confirm_delete=Êtes-vous certain de vouloir supprimer ce message ?
+Post_deletion_info=Cette opération effacera {0} messages.
+Topic_deletion_info=Cette opération effacera {0} sujets et {1} messages qui y sont inclus.
+Confirm_delete_poll=Etes-vous certain de vouloir supprimer ce sondage ?
+Empty_subject=Vous devez obligatoirement donner un titre \u00E0 votre nouveau sujet.
+Empty_message=Vous devez inclure du texte au message avant de le soumettre.
+Forum_locked=Ce forum est vérouillé. Vous ne pouvez y modifier les messages ou y répondre.
+Topic_locked=Ce sujet est vérouillé. Vous ne pouvez y modifier les messages ou y répondre.
+Empty_poll_title=Vous devez donner un titre \u00E0 votre sondage.
+Empty_poll_option=Le libell\u00E9 de choix de r\u00E9ponse que vous avez indiqu\u00E9 n'est pas valide.
+To_few_poll_options=Vous devez inclure un minimum de deux choix de r\u00E9ponse \u00E0 votre sondage.
+To_many_poll_options=Vous avez atteint le nombre maximal de choix de r\u00E9ponses pour votre sondage.
+Wrong_poll_duration=Vous devez indiquer une valeur valide pour la dur\u00E9e de votre sondage.
+Add_poll=Ajouter un sondage
+Add_poll_explain=Si vous ne désirez pas créer de sondage, laissez les champs vides.
+Poll_question=Question
+Poll_option=Choix de réponses
+Add_option=Ajouter un choix de réponse
+Update=Modifier
+Delete=Supprimer
+Poll_for=Recueillir des votes pendant
+# This is used for the Run poll for ... Days + in admin_forums for pruning
+Days=jours
+Poll_for_explain=[ Indiquer la valeur 0 ou ne pas répondre pour un sondage à durée indéterminée ]
+Delete_poll=Supprimer le sondage
+Delete_post=Supprimer le message
+
+bbcode_b_help=Caractères gras: [b]texte[/b]  (alt+b)
+bbcode_i_help=Caractères italiques: [i]texte[/i]  (alt+i)
+bbcode_u_help=Caractères soulignés: [u]texte[/u]  (alt+u)
+bbcode_q_help=Citation: [quote]texte[/quote]  (alt+q)
+bbcode_c_help=Afficher du code: [code]code[/code]  (alt+c)
+bbcode_l_help=Liste: [list]texte[/list] (alt+l)
+bbcode_o_help=Liste ordonnée: [list=]texte[/list]  (alt+o)
+bbcode_p_help=Insérer une image: [img]http://adresse_image[/img]  (alt+p)
+bbcode_w_help=Insérer un hyperlien: [url]http://url[/url] ou [url=http://url]URL texte[/url] (alt+w)
+bbcode_a_help=Fermer les balises restées ouvertes
+bbcode_s_help=Couleur de la police: [color=red]texte[/color]  Truc: vous pouvez également utiliser color=#FF0000
+bbcode_f_help=taille de la police: [size=x-small]petits caractères[/size]
+
+Font_color=Couleur
+color_default=Défaut
+color_dark_red=Rouge foncé
+color_red=Rouge
+color_orange=Orange
+color_brown=Brun
+color_yellow=Jaune
+color_green=Vert
+color_olive=Olive
+color_cyan=Cyan
+color_blue=Bleu
+color_dark_blue=Bleu foncé
+color_indigo=Indigo
+color_violet=Violet
+color_white=Blanc
+color_black=Noir
+
+Font_size=Taille
+font_tiny=Minuscule
+font_small=Petit
+font_normal=Normal
+font_large=Grand
+font_huge=Énorme
+
+Close_Tags=Fermer les balises
+Styles_tip=Truc: Sélectionnez le texte à mettre en forme avant de choisir la mise en forme à l'aide des outils.
+
+
+Subject=Sujet
+
+No_such_user=Désolé, il n'y a pas d'utilisateur de ce nom
+
+#
+# Profiles/Registration
+#
+
+# %s is username
+L_VIEWING_PROFILE=Voir le profil
+# %s is username
+
+Preferences=Préférences
+
+L_TOTAL_POSTS=Nombre de messages
+
+Send_email=Envoyer un courriel
+
+Add_Subscribtion=Ajouter un abonnement
+Topic_delete_confirm=Supprimer les sujets
+
+Not_Moderator=Vous n'êtes pas autorisé à modérer ce forum.
+
+
+#
+# Viewonline
+#
+Online_explain=Les données sont basées sur les 5 dernières minutes d'activité.
+
+#
+# Moderator Control Panel
+#
+Mod_CP=Outils de modération
+Mod_CP_explain=En utilisant les contrôles ci-bas, vous pouvez modérer en lot les forums. Vous pouvez les vérouiller, les déplacer ou les supprimer.
+L_SELECT=Sélectionner
+Select=Sélectionner
+Delete=Supprimer
+Move=Déplacer
+Lock=Vérouiller
+Unlock=Dévérouiller
+Confirm_move_topic=Êtes-vous certain de vouloir déplacer le(s) sujet(s) sélectionné(s) ?
+Move_to_forum=Aller au forum
+Leave_shadow_topic=Laisser une copie fantôme dans ce forum
+
+L_SPLIT_TOPIC=Outils de division de sujet
+L_SPLIT_TOPIC_EXPLAIN=En utilisant les contrôles ci-bas, vous pouvez diviser un sujet en deux, soit en sélectionnant individuellement les messages individuellement, soit en choisissant un point de séparation arbitraire.
+L_SPLIT_SUBJECT=Titre du nouveau sujet
+L_SPLIT_FORUM=Forum du nouveau sujet
+L_SPLIT_POSTS=Séparer les messages sélectionnés
+L_SPLIT_AFTER=Séparer à partir du message sélectionné
+ERR_NO_DEST_FORUM=Vous devez indiquer un forum dans lequel déplacer votre sélection.
+ERR_INTERNAL=Erreur d'intégrité de données. Essayez encore.
+SUCC_TOPIC_MOVED=Déplacement effectué.
+ERR_CANNOT_REMOVE_TOPIC=La suppression a échouée. Essayez encore.
+SUCC_TOPIC_REMOVED=Supression effectuée
+SUCC_TOPIC_LOCKED=Vérouillage activé
+SUCC_TOPIC_UNLOCKED=Vérouillage désactivé
+SUCC_TOPIC_SPLITTED=Segmentation effectuée
+ERR_SPLIT_ONE_POST_TOPIC=Vous ne pouvez pas segmenter un sujet n'ayant qu'un seul message.
+ERR_SPLIT_ALL=Vous devez laisser un minimum de un (1) message dans le sujet original.
+ERR_DEST_FORUM=Vous devez indiquer un forum de destination.
+ERR_PERMISSION_VIOLATION=Vous n'avez pas la permission d'effectuer cette opération. Cessez de pirater !
+ERR_NO_POST_SELECTED=Vous n'avez pas indiqué de messages à déplacer dans le nouveau sujet.
+ERR_NO_SUBJECT_GIVEN=Vous devez indiquer le titre du nouveau sujet à créer.
+
+Please_try_again=Veuillez essayer encore
+
+#
+# Auth pages
+#
+
+Not_Moderator=Pas un modérateur
+
+# These are displayed in the drop down boxes for advanced
+# mode forum auth, try and keep them short!
+
+L_POST=Message
+Edit=Modifier
+Delete=Supprimer
+Attachment=Fichier joint
+
+#
+# Forum Management
+#
+Forum_admin=Catégories et Forums
+Forum_admin_explain=Les contrôles ci-bas vous permettent d'ajouter, modifier, organiser et synchroniser les catégories et forums.
+Edit_forum=Modifier le forum
+Create_forum=Ajouter un forum
+Forum_created_0=Le forum
+Forum_created_1=a été créé.
+Forum_updated_0=Le forum
+Forum_updated_1=a été modifié.
+Forum_deleted_0=Le forum
+Forum_deleted_1=a été supprimé.
+Create_category=Add New Category
+Category_created_0=La catégoie
+Category_created_1=a été créée.
+Category_updated_0=La catégoie
+Category_updated_1=a été modifiée.
+Category_deleted_0=La catégoie
+Category_deleted_1=a été supprimée.
+Edit=Modifier
+Create=
+Delete=Supprimer
+Move_up=Monter
+Move_down=Descendre
+Delete_all_topics_posts=Effacer tous les sujets/messages
+Move_contents=Déplacer tout le contenu vers -
+Forum_delete=Supprimer le forum
+Forum_delete_explain=Le formulaire ci-bas vous permet de supprimer un forum et de déplacer son contenu.
+Forum_locked=Forum vérouillé
+Forum_unlocked=Forum dévérouillé
+Forum_name=Nom du forum
+Forum_desc=Description
+Forum_category=Catégorie de forum
+Category_name=Nom de la catégorie
+Edit_Category=Modifier la catégorie
+Delete_all_forums_topics_posts=Supprimer tous les forums/sujets/messages
+
+Download=Téléchargement
+
+#
+# MyForums View Messages
+#
+
+MyForums_title=Mes Forums
+MyForums_info=Ceci est votre page personnalisée. Vous pouvez y voir et y modifier vos abonnements.
+Subscribed_topics_info=Sujets surveillés
+Subscribed_forums_info=Forums surveillés
+NoNewPosts=Il n'y a pas de nouveaux messages dans les sujets auxquels vous êtes abonnés.
+ViewAllSubscribed=Visualiser tous les abonnements aux sujets
+EditAllSubscribed=Modifier les avertissements des forums surveillés
+NotSubscribingToAnyForum=Vous n'êtes pas abonnés à des forums.
+Notification=Avertissements
+
+#
+# From the mod "Watched Topics List" (http://www.netclectic.com/)
+# plus some custom for the forum watches
+#
+Watch_Login_Requirement=Vous devez être authentifié afin de vous abonner à un forum
+Subscribe_to_forum=S'abonner au forum
+Unsubscribe_from_forum=Supprimer l'abonnement au forum
+Subscribe_to_topic=S'abonner au sujet
+Unsubscribe_from_topic=Supprimer l'abonnement au sujet
+Selected_topic=Sujet sélectionné
+Selected_forum=Forum sélectionné
+Notification_type=Type d'avertissement
+
+Attachment=Attachement
+
+// Viewtopic -> Display of Attachments
+Description=Description
+// used in Administration Panel too...
+Download=Télécharger 
+// this Language Variable is defined in lang_admin.php too, but we are unable to access it from the main Language File
+Filesize=Filesize
+
+// Posting/PM -> Posting Attachments
+Add_attachment=Attachement
+Add_attachment_title=Joindre un fichier
+Add_attachment_explain=Si vous ne désirez pas joindre de fichier à ce message, laissez les champs vides.
+File_name=Fichier à joindre
+File_comment=Commentaire
+
+// Posting/PM -> Posted Attachments
+Posted_attachments=Fichiers joints
+Options=Options
+Update_comment=Modifier le commentaire
+Delete_attachment=Supprimer le fichier joint
+
+EMAIL_VIEWORIGINAL=Voir le message original
+EMAIL_REPLY=Répondre à ce message
+EMAIL_LINKED_MODE_INFO=Vous recevez ce courriel parce que vous êtes abonné à
+EMAIL_FOOTER_MESSAGE=Ce message a été généré automatiquement. Veuillez ne pas y répondre.
+EMAIL_NO_NOTIFICATION=Pas d'avertissement par courriel
+EMAIL_LINKED_NOTIFICATION=Avertissement par courriel avec lien
+EMAIL_EMBEDED_NOTIFICATION=Avertissement par courriel avec message inséré
+SELECT_NOTIFICATION_TYPE=Choisir le type d'avertissement
+
+// BB Code variables
+Message_code=Code
+Message_quote=Quote
+Message_wrote=wrote
+
+Category_delete=Supprimer la catégorie
+
+topiclockederr=Ce sujet est vérouillé. Les modifications et les réponses ne sont pas permises.

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_it.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_it.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_it.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,473 @@
+#
+# Comunemente, questi termini sono usati
+# in modo esteso in molte pagine
+#
+Forum=Forum
+Category=Categoria
+Topics=Topics
+Replies=Risposte
+Views=Viste
+Posts=Posts
+L_POSTED=Inviato
+Posted=Inviato
+L_AUTHOR=Autore
+Author=Autore
+Message=Messaggio
+Permalink=[ link permanente ]
+Powered_by=Sviluppato da
+Jump_to=Salta a
+
+period_1_Day=1 Giorno
+period_7_Days=7 Giorni
+period_2_Weeks=2 Settimane
+period_1_Month=1 Mese
+period_3_Months=3 Mesi
+period_6_Months=6 Mesi
+period_1_Year=1 Anno
+
+Go=Vai
+Submit=Esegui
+Cancel=Annulla
+Preview=Anteprima
+Confirm=Conferma
+Yes=Si
+No=No
+Back=Indietro
+
+Next=Prossimo
+Previous=Precedente
+Last_page=Ultima pagina
+Last=Ultimo
+First=Primo
+Goto_page=Vai alla pagina
+L_JOINED=Assegnato
+
+Select_forum=Seleziona un forum
+# Replaces with: Page 1 of 2 for example
+PageNumber=Pagina {0} di {1}
+
+ICQ=Numero ICQ
+AIM=Indirizzo AIM
+YIM=Yahoo Messenger
+
+# eg. sitename Forum Index, %s can be removed if you prefer
+
+Post_new_topic=Crea un nuovo topic
+Reply_to_topic=Rispondi al topic
+
+# %s's here are for uris, do not remove!
+
+Admin_panel=Pannello di amministrazione
+Home=Home
+My_Forums=I miei Forums
+
+#
+# Preferenze del Forums
+#
+L_LOGIN_REQUIRED=Devi prima accedere per poter usare le preferenze del Forum
+L_EMAIL_ADDRESS=Indirizzo e-mail
+L_ICQ_NUMBER=Numero ICQ
+L_AIM=AIM
+L_MESSENGER=Messenger
+L_YAHOO=Yahoo
+L_SKYPE=Skype
+L_WEBSITE=Website
+L_LOCATION=Localit\u00e0
+L_OCCUPATION=Occupazione
+L_INTERESTS=Interessi
+L_SIGNATURE=Firma
+L_SIGNATURE_EXPLAIN=Firma sui tuoi posts
+L_PREFERENCES=Preferenze
+L_YES=Si
+L_NO=No
+L_NOTIFY_ON_REPLY=Notifica quando risposto
+L_NOTIFY_ON_REPLY_EXPLAIN=Notifica quando il tuo post \u00e8 stato corrisposto
+L_ALWAYS_ADD_SIGNATURE=Aggiungi sempre la firma
+L_ALWAYS_ALLOW_HTML=Permetti sempre l'html
+L_DATE_FORMAT=Formato data
+L_SUBMIT=Esegui
+L_RESET=Azzera
+L_POST_ORDER=Ordine del post
+L_POSTS_PER_TOPIC=Posts per pagina
+L_POSTS_PER_TOPIC_EXPLAIN=Quanti posts per pagina vuoi visualizzare
+L_ASCENDING=Ascendente
+L_DESCENDING=Discendente
+L_TOPICS_PER_FORUM=Topics per pagina
+L_TOPICS_PER_FORUM_EXPLAIN=Quanti topics per pagina vuoi visualizzare
+L_USER_INFO=Informationi
+L_MODE_HOT_TOPICS=topics rapidi (sopra alcuni numeri di repliche)
+L_MODE_HOTTEST_TOPICS=topics ancora pi\u00f9 rapidi (pi\u00f9 repliche)
+L_MODE_LATEST_POSTS=Ultimi topics inviati
+L_MODE_MOST_VIEWED=Pi\u00f9 topics visualizzati
+L_TOPICS_FOUND=topics trovati.
+L_TOPIC_SUMMARY=Indice del topic
+L_MODE_CHOOSE=Scegli la modalit\u00e0 di indice
+L_MODE_CHOOSE_EXPLAIN=Cosa vuoi visualizzare nella portlet minimizzata
+L_TOPIC_SUMMARY_LIMIT=Limite dei topics
+L_TOPIC_SUMMARY_LIMIT_EXPLAIN=Quanti topics visualizzare
+L_TOPIC_SUMMARY_DAYS=Quanti vecchi posts [in giorni]
+L_TOPIC_SUMMARY_DAYS_EXPLAIN=Et\u00e0 dei posts da visualizzare nelle modalit\u00e0 "Pi\u00f9 rapidi" e "Pi\u00f9 visti".
+L_TOPIC_SUMMARY_REPLIES=Quante risposte in un topic
+L_TOPIC_SUMMARY_REPLIES_EXPLAIN=Numero minimo di risposte nel topic per visualizzarlo in modalit\u00e0 "Rapido".
+
+#
+# Stringhe di intestazione globali
+#
+Last_Post=Ultimo Post
+By=da
+
+No_new_posts=Nessun nuovo post
+New_posts=Nuovi posts
+No_new_posts_hot=Nessun nuovo post [ Pubblico ]
+New_posts_hot=Nuovi posts [ Pubblici ]
+No_new_posts_locked=Nessun nuovo post [ Bloccato ]
+New_posts_locked=Nuovi posts [ Bloccati ]
+No_new_posts_sticky=Nessun nuovo post [ Adesivo ]
+New_posts_sticky=Nuovi posts [ Adesivo ]
+No_new_posts_annoucement=Nessun nuovo post [ Avviso ]
+New_posts_annoucement=Nuovi posts [ Avviso ]
+Forum_is_locked=Il forum \u00e8 bloccato
+
+#
+# Indice di pagina
+#
+No_Posts=Nessun Post
+Private_Message=Messaggio privato
+Who_is_Online=Chi \u00e8 online
+Mark_all_forums=Marca tutti i forums letti
+
+#
+# Viewforum
+#
+Forum_not_exist=Il forum che hai selezionato non esiste.
+Announcements=Avvisi
+Sticky_Threads=Threads attacati
+Normal_Threads=Threads normali
+Topic_Announcement=<b>Annuncio:</b>
+Topic_Sticky=<b>Incollato:</b>
+Topic_Moved=<b>Spostato:</b>
+Rules_post_can=<b>Puoi</b> creare nuovi topics in questo forum
+Rules_post_cannot=<b>Non puoi</b> creare nuovi topics in questo forum
+Rules_vote_can=<b>Puoi</b> votare nelle votazioni in questo forum
+Rules_vote_cannot=<b>Non puoi</b> votare nelle votazioni in questo forum
+Rules_poll_can=<b>Puoi</b> creare votazioni in questo forum
+Rules_poll_cannot=<b>Non puoi</b> creare votazioni in questo forum
+# %s replaced by a href links, do not remove!
+Forum_moderation=Moderazione del Forum
+Moderate=Modera
+Rules_moderate_0=<b>Puoi</b>&nbsp;
+Rules_moderate_1=<b>Non puoi</b>&nbsp;
+Rules_moderate_2=moderare questo forum
+Forum_administration=Amministrazione del Forum
+Forum_lock=Blocca questo forum
+Forum_unlock=Sblocca questo forum
+No_topics_post_one=Non ci sono posts in questo forum.<br />Clicca sul link <b>Crea nuovo Topic</b> su questa pagina per crearne.
+
+#
+# Viewtopic
+#
+
+L_POST_SUBJECT=Soggetto del post
+Post_subject=Soggetto del post
+Submit_vote=Esegui il voto
+View_results=Vedi i risultati
+View_ballot=Vedi lo scrutinio
+No_posts_topic=Non c'\u00e8 nessun post per questo topic
+Display_posts=Visualizza i posts dal precedente
+Back_to_top=Torna in alto
+Read_profile=Vedi il profilo dell\' utente
+Send_email=Manda un e-mail all\' utente
+Visit_website=Visita il sito web del mittente
+Delete_post=Cancella questo post
+
+# proceeds the username and is followed by the quoted text
+# comes before bbcode quote output.
+# comes before bbcode code output.
+
+# Last edited by me on 12 Oct 2001; edited 1 time in total
+Edited_time_total=Ultimo editato da {0} su {1}; editato {2} volta in tutto.
+# Last edited by me on 12 Oct 2001; edited 2 times in total
+Edited_times_total=Ultimo editato da {0} su {1}; editato {2} volte in tutto.
+
+Thread_moderation=Processo di Moderazione
+Lock_topic=Blocca questo topic
+Unlock_topic=Sblocca questo topic
+Move_topic=Sposta questo topic
+Delete_topic=Cancella questo topic
+Split_topic=Separa questo topic
+Instant_reply=Risposta istantanea
+
+#
+# Posting/Replying (Not private messaging!)
+#
+Message_body=Corpo del messaggio
+
+# If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly)
+
+Post_a_new_topic=Crea un nuovo topic
+Post_a_reply=Crea una replica
+Post_topic_as=Crea il topic come
+Edit_Post=Modifica il post
+Options=Opzioni
+Compose_Message=Scrivi il Messaggio
+Posting_Description=Il soggetto e il corpo del messaggio sono obbligatori per la spedizione. Usa i controlli dentro il corpo del messaggio per fare uno stile, aggiungere links o immagini al tuo messaggio.
+Post_Announcement=Avvisi
+Post_Sticky=Importante
+Post_Normal=Normale
+Confirm_delete=Sei sicuro di voler cancellare questo post?
+Post_deletion_info=Canceller\u00e0 il post {0}.
+Topic_deletion_info=Canceller\u00e0 il topic {0} e i messaggi {1} sotto a esso.
+Confirm_delete_poll=Sei sicuro di voler cancellare questa votazione?
+Empty_subject=Devi inserire un soggetto quando scrivi un nuovo topic
+Empty_message=Devi inserire un messaggio quando scrivi.
+Forum_locked=Questo forum \u00e8 bloccato: non puoi creare, rispondere o editare il topic.
+Topic_locked=Questo topic \u00e8 bloccato: non puoi editare post o rispondere.
+Empty_poll_title=Devi inserire un titolo per la votazione
+Empty_poll_option=Devi inserire un\'etichetta valida per l\'opzione di voto
+To_few_poll_options=Devi inserire almeno due opzioni per il voto
+To_many_poll_options=Hai inserito troppe opzioni per il voto
+Wrong_poll_duration=Devi inserire una durata valida per il voto
+Add_poll=Aggiungi una votazione
+Add_poll_explain=Se non vuoi aggiungere una votazione al tuo topic, lascia i campi bianchi.
+Poll_question=Domanda della votazione
+Poll_option=Opzione della votazione
+Add_option=Aggiungi un' opzione
+Update=Aggiorna
+Delete=Cancella
+Poll_for=Carica la votazione per
+# E' usato per caricare le votazioni ... Giorni
+Days=Giorni
+Poll_for_explain=[ Inserisci 0 o lascia vuoto per una votazione senza fine ]
+Delete_poll=Cancella la votazione
+Delete_post=Cancella questo post
+
+bbcode_b_help=Testo in grassetto: [b]testo[/b]  (alt+b)
+bbcode_i_help=Testo italico: [i]testo[/i]  (alt+i)
+bbcode_u_help=Test sottolineato: [u]testo[/u]  (alt+u)
+bbcode_q_help=Testo quotato: [quote]testo[/quote]  (alt+q)
+bbcode_c_help=Codice visualizzato: [code]codice[/code]  (alt+c)
+bbcode_l_help=Lista: [list]testo[/list] (alt+l)
+bbcode_o_help=Lista ordinata: [list=]testo[/list]  (alt+o)
+bbcode_p_help=Inserisci l'immagine: [img]http://image_url[/img]  (alt+p)
+bbcode_w_help=Inserisci l'URL: [url]http://url[/url] o [url=http://url]URL text[/url]  (alt+w)
+bbcode_a_help=Chiudi tutti i tags bbCode
+bbcode_s_help=Colore del font: [color=red]testo[/color]  Consiglio: puoi anche usare color=#FF0000
+bbcode_f_help=Grandezza del font: [size=x-small]testo piccolo[/size]
+
+Font_color=Colore del font
+color_default=Default
+color_dark_red=Rosso scuro
+color_red=Rosso
+color_orange=Arancione
+color_brown=Marrone
+color_yellow=Giallo
+color_green=Verde
+color_olive=Oliva
+color_cyan=Cianotico
+color_blue=Blu
+color_dark_blue=Blu scuro
+color_indigo=Indaco
+color_violet=Viola
+color_white=Bianco
+color_black=Nero
+
+Font_size=Grandezza del font
+font_tiny=Molto piccolo
+font_small=Piccolo
+font_normal=Normale
+font_large=Grande
+font_huge=Molto grande
+
+Close_Tags=Chiudi i tags
+Styles_tip=Consiglio: Gli stili possono essere applicati rapidamente al testo selezionato.
+
+
+Subject=Soggetto
+
+No_such_user=Mi dispiace, ma l'utente non esiste.
+
+#
+# Profili/Registrationi
+#
+
+# %s \u00e8 un nome utente
+L_VIEWING_PROFILE=Visualizzazione del profilo
+# %s is username
+
+Preferences=Preferenze
+
+L_TOTAL_POSTS=Totale dei posts
+
+Send_email=Manda una e-mail
+
+Add_Subscribtion=Aggiungi una sottoscrizione
+Topic_delete_confirm=Cancella Topics
+
+Not_Moderator=Non sei il moderatore di questo forum.
+
+
+#
+# Viewonline
+#
+Online_explain=Questi dati si basano sulle utenze attive negli ultimi cinque minuti
+
+#
+# Pannello di controllo del moderatore
+#
+Mod_CP=Pannello di controllo del moderatore
+Mod_CP_explain=Attraverso la form qui sotto puoi eseguire operazioni di moderatore su questo forum. Puoi bloccare, sbloccare, spostare o cancellare un qualunque numero di topics.
+L_SELECT=Seleziona
+Select=Seleziona
+Delete=Cancella
+Move=Sposta
+Lock=Blocca
+Unlock=Sblocca
+Confirm_move_topic=Sei sicuro di voler spostare i topics selezionati?
+Confirm_delete_topic=Sei sicuro di voler rimuovere i topics selezionati?
+Move_to_forum=Sposta al forum
+Leave_shadow_topic=Lascia un'ombra del topic nel vecchio forum.
+
+L_SPLIT_TOPIC=Separa il pannello di controllo del topic
+L_SPLIT_TOPIC_EXPLAIN=Attraverso la form qui sotto puoi suddividere un topic in due, sia selezionando i posts individualmente sia suddividendoli sul post selezionato
+L_SPLIT_SUBJECT=Nuovo titolo del topic
+L_SPLIT_FORUM=Forum per il nuovo topic
+L_SPLIT_POSTS=Suddividi i posts selezionati
+L_SPLIT_AFTER=Suddividi dal post selezionato
+None_selected=Non hai selezionato alcun topic per eseguire l'operazione.
+ERR_NO_DEST_FORUM=Devi selezionare la destinazione del forum per effettuare lo spostamento.
+ERR_INTERNAL=Errore interno - per favore riprova.
+SUCC_TOPIC_MOVED=Spostamento eseguito con successo!
+ERR_CANNOT_REMOVE_TOPIC=Rimozione fallita! Prova di nuovo!
+SUCC_TOPIC_REMOVED=Rimozione riuscita!
+SUCC_TOPIC_LOCKED=Blocco riuscito!
+SUCC_TOPIC_UNLOCKED=Sblocco riuscito!
+SUCC_TOPIC_SPLITTED=Separazione riuscita!
+ERR_SPLIT_ONE_POST_TOPIC=Non posso suddividere il topic con un solo post!
+ERR_SPLIT_ALL=Non posso spostare tutti i posts dal topic suddiviso!
+ERR_DEST_FORUM=Non hai selezionato il forum di destinazione!
+ERR_PERMISSION_VIOLATION=Non hai i permessi - BLOCCHIAMO L' HACKING!!!
+ERR_NO_POST_SELECTED=Non hai selezionato alcun post per suddividere.
+ERR_NO_SUBJECT_GIVEN=Devi mettere il soggetto al nuovo topic.
+
+Please_try_again=Per favore riprova.
+
+#
+# Auth pages
+#
+
+Not_Moderator=Non \u00e8 moderatore
+
+# These are displayed in the drop down boxes for advanced
+# mode forum auth, try and keep them short!
+
+L_POST=Invia
+Edit=Modifica
+Delete=Cancella
+Attachment=Attachment
+
+#
+# Forum Management
+#
+Forum_admin=Categorie e Forum
+Forum_admin_explain=Da questo pannello puoi aggiungere, modificare, cancellare, riordinare e ri-sincronizzare le categorie e i forum
+Edit_forum=Modifica forum
+Create_forum=Crea un nuovo forum
+Forum_created_0=Il Forum
+Forum_created_1=\u00e8 stato creato con successo.
+Forum_updated_0=Il Forum
+Forum_updated_1=\u00e8 stato aggiornato con successo.
+Forum_deleted_0=Il Forum
+Forum_deleted_1=\u00e8 stato cancellato con successo.
+Create_category=Crea una nuova categoria
+Category_created_0=La Categoria
+Category_created_1=\u00e8 stata creata con successo.
+Category_updated_0=La Categoria
+Category_updated_1=\u00e8 stata aggiornata con successo.
+Category_deleted_0=La Categoria
+Category_deleted_1=\u00e8 stata cancellata con successo.
+Edit=Modifica
+Create=Crea
+Delete=Cancella
+Move_up=Sposta su
+Move_down=Sposta giu
+Delete_all_topics_posts=Cancella tutti i topics/posts
+Move_contents=Sposta tutti i contenuti
+Forum_delete=Cancella forum
+Forum_delete_explain=Il modulo qui sotto ti permette di cancellare un forum (o una categoria) e decidere dove mettere tutti gli argomenti (o forum) in esso/a contenuti
+Forum_locked=Forum bloccato
+Forum_unlocked=Forum sbloccato
+Forum_name=Nome forum
+Forum_desc=Descrizione
+Forum_category=Categoria del forum
+Category_name=Nome della Categoria
+Edit_Category=Modifica categoria
+Delete_all_forums_topics_posts=Cancella tutti i Forums/Topics/Posts
+
+Download=Scarica
+
+#
+# MyForums View Messages
+#
+
+MyForums_title=I miei Forums
+MyForums_info=Questa \u00e8 la vista per personalizzare i forums. Da qui, da qui puoi vedere e gestire i forums a cui sei iscritto, i topics autorizzati e le notifiche per e-mail.
+Subscribed_topics_info=Topics autorizzati con nuovi Posts
+Subscribed_forums_info=Forums autorizzati
+NoNewPosts=Non ci sono nuovi posts nei tuoi threads autorizzati.
+ViewAllSubscribed=Vedi tutti i Topics autorizzati
+EditAllSubscribed=Modifica le Notifiche sui Forums autorizzati
+NotSubscribingToAnyForum=Non sei registrato in nessun Forum.
+Notification=Notifica
+
+#
+# From the mod "Watched Topics List" (http://www.netclectic.com/)
+# plus some custom for the forum watches
+#
+Watch_Login_Requirement=Devi essere loggato per osservare i Forums
+Subscribe_to_forum=Iscriviti al forum
+Unsubscribe_from_forum=Cancellati dal forum
+Subscribe_to_topic=Iscriviti al topic
+Unsubscribe_from_topic=Cancellati dal topic
+Selected_topic=Topic selezionato
+Selected_forum=Forum selezionato
+Notification_type=Tipo di notifica
+
+Attachment=Allegato
+
+// Viewtopic -> Display of Attachments
+Description=Descrizione
+// used in Administration Panel too...
+Download=Download 
+// this Language Variable is defined in lang_admin.php too, but we are unable to access it from the main Language File
+Filesize=Dimensione del file
+
+// Posting/PM -> Posting Attachments
+Add_attachment=Aggiungi l\'allegato
+Add_attachment_title=Aggiungi un allegato
+Add_attachment_explain=Se non vuoi aggiungere un allegato al tuo messaggio, per favore lascia il campo bianco
+File_name=Nome del file
+File_comment=Commento del file
+
+// Posting/PM -> Posted Attachments
+Posted_attachments=Allegati mandati
+Options=Opzioni
+Update_comment=Carica il commento
+Delete_attachment=Cancella l\'allegato
+
+EMAIL_VIEWORIGINAL=Vedi il post originale
+EMAIL_REPLY=Rispondi al post
+EMAIL_LINKED_MODE_INFO=Stai ricevendo questa e-mail perch\u00e8 ti sei registrato su
+EMAIL_FOOTER_MESSAGE=Questo messaggio \u00e8 generato automaticamente. Per favore non rispondere.
+EMAIL_NO_NOTIFICATION=Nessuna notifica di e-mail
+EMAIL_LINKED_NOTIFICATION=Notifica di e-mail tramite Link
+EMAIL_EMBEDED_NOTIFICATION=Notifica di e-mail integrata
+SELECT_NOTIFICATION_TYPE=Seleziona il tipo di notifica
+
+// BB Code variables
+Message_code=Codice
+Message_quote=Quota
+Message_wrote=scritto
+
+Category_delete=Cancella la Categoria
+
+topiclockederr=Questo topic \u00e8 bloccato. Non \u00e8 permesso ne modificare il post e ne rispondere al topic

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,183 @@
+#NEW
+
+#COMMON
+forum=common/forum_ico_nonew_open.gif
+forum_new=common/forum_ico_new_open.gif
+forum_locked=common/forum_ico_nonew_locked.gif
+folder=common/forum_ico_nonew_open.gif
+folder_new=common/forum_ico_new_open.gif
+folder_hot=common/forum_ico_nonew_pop.gif
+folder_hot_new=common/forum_ico_new_pop.gif
+folder_locked=common/forum_ico_nonew_locked.gif
+folder_locked_new=common/forum_ico_new_locked.gif
+folder_sticky=common/forum_ico_sticky.gif
+folder_sticky_new=common/forum_ico_sticky_new.gif
+folder_announce=common/forum_ico_anno.gif
+folder_announce_new=common/forum_ico_anno_new.gif
+lock=common/forum_ico_adminlock.gif
+unlock=common/forum_ico_adminunlock.gif
+topic_mod_lock=common/forum_ico_adminlock.gif
+topic_mod_unlock=common/forum_ico_adminunlock.gif
+topic_mod_split=common/forum_ico_adminsplit.gif
+topic_mod_move=common/forum_ico_adminmove.gif
+topic_mod_delete=common/forum_ico_admindelete_norm.gif
+topic_mod_delete_disa=common/forum_ico_admindelete_disa.gif
+admin_arrowdown=common/forum_ico_adminarrowdown_norm.gif
+admin_arrowdown_disa=common/forum_ico_adminarrowdown_disa.gif
+admin_arrowup=common/forum_ico_adminarrowup_norm.gif
+admin_arrowup_disa=common/forum_ico_adminarrowup_disa.gif
+icon_dialog_error=common/forum_ico_dialog_error.gif
+icon_dialog_question=common/forum_ico_dialog_question.gif
+icon_dialog_warning=common/forum_ico_dialog_warning.gif
+voting_graphic_0=common/forum_poll_bar.gif
+vote_lcap=common/forum_poll_lcap.gif
+vote_rcap=common/forum_poll_rcap.gif
+forums_logo=common/forums_ico_logo.gif
+spacer=common/spacer.gif
+icon_feed=common/forums_ico_feed.gif
+
+#LANGUAGE SPECIFIC
+
+forum_subscribe=forum_but_subscribe.gif
+forum_unsubscribe=forum_but_unsubscribe.gif
+post_new=forum_but_newtopic.gif
+post_locked=forum_but_closed.gif
+reply_new=forum_but_postreply.gif
+reply_locked=forum_but_closed.gif
+moderate=forum_but_moderate.gif
+icon_quote=forum_but_quote.gif
+icon_delpost=forum_but_delete.gif
+icon_edit=forum_but_edit.gif
+icon_profile=forum_but_profile.gif
+icon_email=forum_but_email.gif
+icon_www=forum_but_website.gif
+icon_aim=forum_but_aim.gif
+icon_yim=forum_but_yim.gif
+icon_skype=forum_but_skype.gif
+icon_msnm=forum_but_msnm.gif
+icon_icq=forum_but_icq.gif
+admin_newcategory=forum_but_addnewcategory.gif
+admin_newforum=forum_but_addnewforum.gif
+
+
+#OLD
+
+#icon_quote=images/lang_english/icon_quote.gif
+#icon_edit=images/lang_english/icon_edit.gif
+icon_repost=images/lang_english/icon_repost.gif
+icon_search=images/lang_english/icon_search.gif
+#icon_profile=images/lang_english/icon_profile.gif
+icon_pm=images/lang_english/icon_pm.gif
+#icon_email=images/lang_english/icon_email.gif
+#icon_delpost=images/icon_delete.gif
+icon_ip=images/lang_english/icon_ip.gif
+#icon_www=images/lang_english/icon_www.gif
+#icon_icq=images/lang_english/icon_icq_add.gif
+#icon_aim=images/lang_english/icon_aim.gif
+#icon_skype=images/lang_english/icon_skype.gif
+#icon_yim=images/lang_english/icon_yim.gif
+#icon_msnm=images/lang_english/icon_msnm.gif
+icon_minipost=images/icon_minipost.gif
+icon_gotopost=images/icon_minipost.gif
+icon_minipost_new=images/icon_minipost_new.gif
+icon_latest_reply=images/icon_latest_reply.gif
+icon_newest_reply=images/icon_newest_reply.gif
+
+#forum=images/folder_big.gif
+#forum_new=images/folder_new.gif
+forum_new_big=images/folder_new_big.gif
+#forum_locked=images/folder_locked_big.gif
+
+#folder=images/folder.gif
+#folder_new=images/folder_new.gif
+#folder_hot=images/folder_hot.gif
+#folder_hot_new=images/folder_new_hot.gif
+#folder_locked=images/folder_lock.gif
+#folder_locked_new=images/folder_lock_new.gif
+#folder_sticky=images/folder_sticky.gif
+#folder_sticky_new=images/folder_sticky_new.gif
+#folder_announce=images/folder_announce.gif
+#folder_announce_new=images/folder_announce_new.gif
+
+#post_new=images/lang_english/post.gif
+#post_locked=images/lang_english/reply-locked.gif
+#reply_new=images/lang_english/reply.gif
+#reply_locked=images/lang_english/reply-locked.gif
+
+pm_inbox=images/msg_inbox.gif
+pm_outbox=images/msg_outbox.gif
+pm_savebox=images/msg_savebox.gif
+pm_sentbox=images/msg_sentbox.gif
+pm_readmsg=images/folder.gif
+pm_unreadmsg=images/folder_new.gif
+pm_replymsg=images/reply.gif
+pm_postmsg=images/lang_english/msg_newpost.gif
+pm_quotemsg=images/icon_quote.gif
+pm_editmsg=images/icon_edit.gif
+pm_new_msg=
+pm_no_new_msg=
+
+topic_watch=
+topic_un_watch=
+#topic_mod_lock=images/topic_lock.gif
+#topic_mod_unlock=images/topic_unlock.gif
+#topic_mod_split=images/topic_split.gif
+#topic_mod_move=images/topic_move.gif
+#topic_mod_delete=images/topic_delete.gif
+
+#voting_graphic_0=images/voting_bar.gif
+#voting_graphic_1=images/voting_bar.gif
+#voting_graphic_2=images/voting_bar.gif
+#voting_graphic_3=images/voting_bar.gif
+#voting_graphic_4=images/voting_bar.gif
+
+#vote_lcap=images/vote_lcap.gif
+#vote_rcap=images/vote_rcap.gif
+
+
+
+vote_graphic_length=205
+privmsg_graphic_length=175
+
+template_name=subSilver
+style_name=subSilver
+head_stylesheet=subSilver.css
+body_background=
+body_bgcolor=E5E5E5
+body_text=000000
+body_link=006699
+body_vlink=5493B4
+body_alink=
+body_hlink=DD6900
+tr_color1=EFEFEF
+tr_color2=DEE3E7
+tr_color3=D1D7DC
+tr_class1=
+tr_class2=
+tr_class3=
+th_color1=98AAB1
+th_color2=006699
+th_color3=FFFFFF
+th_class1=images/cellpic1.gif
+th_class2=images/cellpic3.gif
+th_class3=images/cellpic2.jpg
+td_color1=FAFAFA
+td_color2=FFFFFF
+td_color3=
+td_class1=row1
+td_class2=row2
+td_class3=
+fontface1=Verdana, Arial, Helvetica, sans-serif
+fontface2=Trebuchet MS
+fontface3=Courier, \'Courier New\', sans-serif
+fontsize1=10
+fontsize2=11
+fontsize3=12
+fontcolor1=444444
+fontcolor2=006600
+fontcolor3=FFA34F
+span_class1=
+span_class2=
+span_class3=
+img_size_poll=0
+img_size_privmsg=0

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</span>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/b_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<span style="font-weight: bold">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,6 @@
+</pre>
+</div>
+</td>
+</tr>
+</table>
+<span class="postbody">
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/code_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+</span>
+<table width="0%" cellspacing="1" cellpadding="3" border="0" align="center" style="margin-left: 20px;">
+   <tr>
+      <td><b>{L_CODE}:</b></td>
+   </tr>
+   <tr>
+      <td width="0%" class="code"><div class="scroll"><pre>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</span>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/color_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<span style="color: {COLOR}">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/email.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/email.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/email.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<a href="mailto:{EMAIL}">{EMAIL}</a>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</span>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/i_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<span style="font-style: italic">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/img.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/img.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/img.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<img src="{URL}" border="0"/>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/listitem.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/listitem.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/listitem.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<li>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</ol>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/olist_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<ol type="{LIST_TYPE}">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+</td>
+</tr>
+</table>
+<span class="postbody">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+</span>
+<table width="0%" cellspacing="1" cellpadding="3" border="0" align="center" style="margin-left: 20px;">
+   <tr>
+      <td><span class="genmed"><b>{L_QUOTE}:</b></span></td>
+   </tr>
+   <tr>
+      <td class="quote">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_username_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_username_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/quote_username_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+</span>
+<table width="0%" cellspacing="1" cellpadding="3" border="0" align="center" style="margin-left: 20px;">
+   <tr>
+      <td><span class="genmed"><b>{USERNAME}&#160;{L_WROTE}:</b></span></td>
+   </tr>
+   <tr>
+      <td class="quote">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</span>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/size_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<span style="font-size: {SIZE}px; line-height: normal">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</span>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/u_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<span style="text-decoration: underline">

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_close.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_close.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_close.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+</ul>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_open.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_open.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/ulist_open.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<ul>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/url.tpl
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/url.tpl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/classes/template/url.tpl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1 @@
+<a href="{URL}" target="_blank">{DESCRIPTION}</a>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,669 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE faces-config PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>		
+	<!-- general application configuration -->
+	<application>
+	    <!-- jbossportal-facelets integration -->
+	    <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+	    <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+	    
+	    <!-- standalone facelets integration -->
+    	<!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler--> 
+    	
+    	<!-- custom action listener with integrated authorization checking -->
+    	<action-listener>org.jboss.portlet.forums.auth.AuthorizationListener</action-listener>
+    	
+    	<!-- internationalization -->
+    	<locale-config>
+    		<default-locale>en</default-locale>
+    		<!-- add supported locales as new locales are supported -->
+            <supported-locale>it</supported-locale>
+    		<supported-locale>fr</supported-locale>
+            <supported-locale>pl</supported-locale>
+    		<supported-locale>de</supported-locale>	
+    	</locale-config>    	
+    </application> 
+    
+    <!-- phase listeners -->
+    <lifecycle>
+        
+        <phase-listener>org.jboss.portlet.forums.ui.event.ValueRequiredMessageModifierListener</phase-listener>
+    
+        <!-- 
+        remove this in portal-environment. This is needed only for managing a transaction in standalone mode.
+        in portal mode, the portal takes care of this
+        -->
+    	<!--phase-listener>org.jboss.portlet.forums.ui.event.BeginTransactionListener</phase-listener>    	
+    	<phase-listener>org.jboss.portlet.forums.ui.event.EndTransactionListener</phase-listener-->
+            	
+    </lifecycle>
+    
+    <!-- Custom validators definitions -->
+    <validator>
+        <validator-id>pollValidator</validator-id>
+        <validator-class>org.jboss.portlet.forums.ui.action.validators.PollValidator</validator-class>
+    </validator>
+    <validator>
+        <validator-id>messageLengthValidator</validator-id>
+        <validator-class>org.jboss.portlet.forums.ui.action.validators.MessageLengthValidator</validator-class>
+    </validator>
+    <validator>
+        <validator-id>subjectLengthValidator</validator-id>
+        <validator-class>org.jboss.portlet.forums.ui.action.validators.SubjectLengthValidator</validator-class>
+    </validator>
+    
+    <!-- Custom converters definitions -->
+    <converter>
+        <converter-id>pollDurationConverter</converter-id>
+        <converter-class>org.jboss.portlet.forums.ui.action.converters.PollDurationConverter</converter-class>
+    </converter>
+    	
+	<!-- configuration for the shared EmptyController -->
+	<managed-bean>
+		<managed-bean-name>shared</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.EmptyController</managed-bean-class>
+	    <managed-bean-scope>application</managed-bean-scope>
+	    <!-- bean level configuration -->
+	    <managed-property>
+	      <property-name>mainPageName</property-name>
+	      <value>JBoss Forums</value>
+	    </managed-property>
+	    <!-- bookmarkable links in forums -->
+	    <managed-property>
+	    	<property-name>links</property-name>
+	    	<map-entries>
+	    		<key-class>java.lang.String</key-class>
+	    		<map-entry>
+	    			<key>category</key>
+	    			<value>/views/category/viewcategory_body.jsf</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>forum</key>
+	    			<value>/views/forums/viewforum_body.jsf</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>topic</key>
+	    			<value>/views/topics/viewtopic_body.jsf</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>index</key>
+	    			<value>/views/index.jsf</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>posting</key>
+	    			<value>/views/topics/posting_new_body.jsf</value>
+	    		</map-entry>
+			    <map-entry>
+			     <key>profile</key>
+			     <value>/views/profile/viewprofile_body.jsf</value>
+			    </map-entry>
+			    <map-entry>
+			     <key>message</key>
+			     <value>/views/profile/usermessage_body.jsf</value>
+			    </map-entry>
+                        <map-entry>
+                            <key>moderator</key>
+                            <value>/views/moderator/modcp_body.jsf</value>
+                        </map-entry>
+                        <map-entry>
+                            <key>topicSplit</key>
+                            <value>/views/moderator/modcp_split.jsf</value>
+                        </map-entry>
+                <map-entry>
+			     <key>forumWatch</key>
+			     <value>/views/watches/forumWatch.jsf</value>
+			    </map-entry>
+                <map-entry>
+                 <key>topicWatch</key>
+                 <value>/views/watches/topicWatch.jsf</value>
+                </map-entry>
+			    <map-entry>
+			     <key>admin</key>
+			     <value>/views/admin/index.jsf</value>
+			    </map-entry>
+			    <map-entry>
+			     <key>pref</key>
+			     <value>/views/pref/index.jsf</value>
+			    </map-entry>
+                <map-entry>
+                 <key>myForums</key>
+                 <value>/views/myforums/myforums_main.jsf</value>
+                </map-entry>
+                <map-entry>
+                 <key>myForumsAll</key>
+                 <value>/views/myforums/myforums_viewall.jsf</value>
+                </map-entry>
+                <map-entry>
+                 <key>myForumsEdit</key>
+                 <value>/views/myforums/myforums_editforums.jsf</value>
+                </map-entry>
+                <map-entry>
+                 <key>search</key>
+                 <value>/views/search/viewsearch_body.jsf</value>
+                </map-entry>
+                <map-entry>
+                 <key>searchResults</key>
+                 <value>/views/search/viewsearch_results.jsf</value>
+                </map-entry>
+             </map-entries>                
+	    </managed-property>	    	    
+	</managed-bean>		
+			
+	<!-- configuration for ViewSummary -->
+	<managed-bean>
+	    <managed-bean-name>summary</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewSummary</managed-bean-class>
+	    <managed-bean-scope>request</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
+    </managed-bean>
+    
+    <!-- configuration for ViewCategory -->
+	<managed-bean>
+	    <managed-bean-name>category</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewCategory</managed-bean-class>
+	    <managed-bean-scope>request</managed-bean-scope>	    
+    </managed-bean>
+    
+    <!-- configuration for ViewForum -->
+	<managed-bean>
+	    <managed-bean-name>forum</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewForum</managed-bean-class>
+	    <managed-bean-scope>request</managed-bean-scope>
+	    <!-- user preferences related configuration -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
+    </managed-bean>
+    <navigation-rule>		
+        <from-view-id>/views/forums/viewforum_body.xhtml</from-view-id>
+		<navigation-case>
+			<from-outcome>startNewTopic</from-outcome>
+			<to-view-id>/views/topics/posting_new_body.xhtml</to-view-id>
+		</navigation-case>				
+	</navigation-rule>  
+	
+	 <!-- managedBean for the viewTopic usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>topic</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewTopic</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	  	<!-- user preferences related configuration -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	            
+	 </managed-bean>
+	 <navigation-rule>
+        <from-view-id>/views/topics/viewtopic_body.xhtml</from-view-id>		
+        <navigation-case>
+			<from-outcome>startNewTopic</from-outcome>
+			<to-view-id>/views/topics/posting_new_body.xhtml</to-view-id>
+		</navigation-case>				
+		<navigation-case>
+			<from-outcome>startReply</from-outcome>
+			<to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>startEditPost</from-outcome>
+			<to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>instantReply</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>
+                <navigation-case>
+			<from-outcome>confirmDelete</from-outcome>
+			<to-view-id>/views/moderator/delete_topic.xhtml</to-view-id>
+		</navigation-case>
+                <navigation-case>
+			<from-outcome>confirmMove</from-outcome>
+			<to-view-id>/views/moderator/modcp_move.xhtml</to-view-id>
+		</navigation-case>
+	 </navigation-rule>	  
+    
+    <!-- configuration for NewTopic -->
+    <managed-bean>
+	    <managed-bean-name>newTopic</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.action.NewTopic</managed-bean-class>
+	    <!-- this workflow is chatty and needs to be preserved on the session -->
+	    <managed-bean-scope>session</managed-bean-scope>	    
+    </managed-bean>    
+    <navigation-rule>
+        <from-view-id>/views/topics/posting_new_body.xhtml</from-view-id>	
+        <!-- straight jsf calls -->	
+        <navigation-case>
+			<from-outcome>addOption</from-outcome>
+			<to-view-id>/views/topics/posting_new_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>updateOption</from-outcome>
+			<to-view-id>/views/topics/posting_new_body.xhtml</to-view-id>
+		</navigation-case>		
+		<navigation-case>
+			<from-outcome>updateAttachment</from-outcome>
+			<to-view-id>/views/topics/posting_new_body.xhtml</to-view-id>
+		</navigation-case>
+		<!-- jsf state by method call on managed bean first -->
+		<navigation-case>
+			<from-outcome>cancel</from-outcome>
+			<to-view-id>/views/forums/viewforum_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/forums/viewforum_body.xhtml</to-view-id>
+		</navigation-case>				
+	</navigation-rule>
+	
+	<!-- configuration for replyTopic -->
+    <managed-bean>
+	    <managed-bean-name>replyTopic</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.action.ReplyTopic</managed-bean-class>
+	    <!-- this workflow is chatty and needs to be preserved on the session -->
+	    <managed-bean-scope>session</managed-bean-scope>	    
+    </managed-bean>    
+    <navigation-rule>
+        <from-view-id>/views/topics/posting_reply_body.xhtml</from-view-id>	
+        <!-- straight jsf calls -->	
+        <navigation-case>
+			<from-outcome>addOption</from-outcome>
+			<to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>updateOption</from-outcome>
+			<to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id>
+		</navigation-case>		
+		<navigation-case>
+			<from-outcome>updateAttachment</from-outcome>
+			<to-view-id>/views/topics/posting_reply_body.xhtml</to-view-id>
+		</navigation-case>
+		<!-- jsf state by method call on managed bean first -->
+		<navigation-case>
+			<from-outcome>cancel</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>				
+	</navigation-rule>
+	
+	<!-- configuration for editPost -->
+    <managed-bean>
+	    <managed-bean-name>editPost</managed-bean-name>
+	    <managed-bean-class>org.jboss.portlet.forums.ui.action.EditPost</managed-bean-class>
+	    <!-- this workflow is chatty and needs to be preserved on the session -->
+	    <managed-bean-scope>session</managed-bean-scope>	    
+    </managed-bean>    
+    <navigation-rule>
+        <from-view-id>/views/topics/posting_edit_body.xhtml</from-view-id>	
+        <!-- straight jsf calls -->	
+        <navigation-case>
+			<from-outcome>addOption</from-outcome>
+			<to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>updateOption</from-outcome>
+			<to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id>
+		</navigation-case>		
+		<navigation-case>
+			<from-outcome>updateAttachment</from-outcome>
+			<to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id>
+		</navigation-case>
+		<!-- jsf state by method call on managed bean first -->
+		<navigation-case>
+			<from-outcome>cancel</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>				
+	</navigation-rule>
+	<navigation-rule>
+        <from-view-id>/views/topics/delete_poll.xhtml</from-view-id>		
+		<!-- represents delete of the selected poll was successfull -->        
+		<navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/topics/posting_edit_body.xhtml</to-view-id>
+		</navigation-case>		
+	</navigation-rule>
+		 	 
+	 <!-- managedBean for the jumpbox usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>jumpbox</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewJumpbox</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+	 
+	 <!-- managedBean for the viewProfile usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>profile</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewProfile</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+	 
+	 <!-- managedBean for the moderatorPanel usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>moderator</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.ModeratorAction</managed-bean-class>
+	  	<managed-bean-scope>session</managed-bean-scope>
+                <managed-property>
+                    <property-name>userPreferences</property-name>
+                    <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+                    <value>#{prefController}</value>
+                </managed-property>
+        </managed-bean>
+        <managed-bean>
+	  	<managed-bean-name>splitTopic</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.SplitTopic</managed-bean-class>
+	  	<managed-bean-scope>session</managed-bean-scope>
+     </managed-bean>
+        
+	 <navigation-rule>
+            <from-view-id>/views/moderator/modcp_body.xhtml</from-view-id>
+            <navigation-case>
+                <from-outcome>confirmDelete</from-outcome>
+                <to-view-id>/views/moderator/delete_topics.xhtml</to-view-id>
+            </navigation-case>
+            <navigation-case>
+                <from-outcome>confirmMove</from-outcome>
+                <to-view-id>/views/moderator/modcp_move.xhtml</to-view-id>
+            </navigation-case>
+        </navigation-rule>
+        <navigation-rule>
+            <from-view-id>/views/moderator/delete_topic.xhtml</from-view-id>
+            <navigation-case>
+                <from-outcome>success</from-outcome>
+                <to-view-id>/views/moderator/modcp_body.xhtml</to-view-id>
+            </navigation-case>
+        </navigation-rule>
+        <navigation-rule>
+            <from-view-id>/views/moderator/delete_topics.xhtml</from-view-id>
+            <navigation-case>
+                <from-outcome>success</from-outcome>
+                <to-view-id>/views/moderator/modcp_body.xhtml</to-view-id>
+            </navigation-case>
+        </navigation-rule>
+	 
+	 <!-- managedBean for deletePost usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>deletePost</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.DeletePost</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+	 <navigation-rule>
+        <from-view-id>/views/topics/delete_post.xhtml</from-view-id>		
+		<!-- represents delete of the selected post was successfull -->        
+		<navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>topicDeleted</from-outcome>
+			<to-view-id>/views/forums/viewforum_body.xhtml</to-view-id>
+		</navigation-case>
+	</navigation-rule>
+	
+	<!-- managed bean for the voting/poll stuff -->
+	<managed-bean>
+	  	<managed-bean-name>pollController</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.PollController</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	</managed-bean>	
+	
+	<!-- managedBean for the adminPanel usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>adminPanel</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewAdminPanel</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+	 <!-- managedBean for the adminController usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>adminController</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.AdminController</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+	<navigation-rule>
+        <from-view-id>/views/admin/deleteCategory.xhtml</from-view-id>	
+        <navigation-case>
+			<from-outcome>deleteCategory</from-outcome>
+			<to-view-id>/views/admin/index.xhtml</to-view-id>
+		</navigation-case>			
+	</navigation-rule>
+	<navigation-rule>
+        <from-view-id>/views/admin/deleteForum.xhtml</from-view-id>	
+        <navigation-case>
+			<from-outcome>deleteForum</from-outcome>
+			<to-view-id>/views/admin/index.xhtml</to-view-id>
+		</navigation-case>			
+	</navigation-rule>        
+    <navigation-rule>
+        <from-view-id>/views/admin/deleteCategory.xhtml</from-view-id>  
+        <navigation-case>
+            <from-outcome>cancel</from-outcome>
+            <to-view-id>/views/admin/index.xhtml</to-view-id>
+        </navigation-case>          
+    </navigation-rule>
+    <navigation-rule>
+        <from-view-id>/views/admin/deleteForum.xhtml</from-view-id> 
+        <navigation-case>
+            <from-outcome>cancel</from-outcome>
+            <to-view-id>/views/admin/index.xhtml</to-view-id>
+        </navigation-case>          
+    </navigation-rule>
+                 
+         <navigation-rule>
+         <from-view-id>/views/moderator/modcp_move.xhtml</from-view-id>
+            <navigation-case>
+                <from-outcome>success</from-outcome>
+                <to-view-id>/views/moderator/modcp_body.xhtml</to-view-id>
+            </navigation-case>
+         </navigation-rule>
+	
+	 <!-- managedBean for the user preference usecase -->
+	 <managed-bean>
+	  	<managed-bean-name>prefController</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.PreferenceController</managed-bean-class>
+	  	<managed-bean-scope>session</managed-bean-scope>        
+        <managed-property>
+	    	<property-name>defaultPreferences</property-name>
+	    	<map-entries>
+	    		<key-class>java.lang.String</key-class>
+	    		<map-entry>
+	    			<key>notifyreply</key>
+	    			<value>true</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>allowhtml</key>
+	    			<value>true</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>postorder</key>
+	    			<value>ascending</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>dateformat</key>
+	    			<value>EEE MMM d, yyy</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>alwaysaddsignature</key>
+	    			<value>false</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>signature</key>
+	    			<value></value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>summarymode</key>
+	    			<value>0</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>summarytopiclimit</key>
+	    			<value>0</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>summarytopicdays</key>
+	    			<value>20</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>summarytopicreplies</key>
+	    			<value>15</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>topicsperforum</key>
+	    			<value>10</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>postspertopic</key>
+	    			<value>15</value>
+	    		</map-entry>
+	    	</map-entries>
+	    </managed-property> 
+	 </managed-bean>
+	 <navigation-rule>
+        <from-view-id>/views/pref/index.xhtml</from-view-id>	
+        <navigation-case>
+			<from-outcome>success</from-outcome>
+			<to-view-id>/views/index.xhtml</to-view-id>
+		</navigation-case>
+	 </navigation-rule>
+	 
+	 
+	 <!-- topic watch controller -->
+	 <managed-bean>
+	  	<managed-bean-name>topicWatch</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.TopicWatchController</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	 </managed-bean>
+     <navigation-rule>
+        <from-view-id>/views/myforums/myforums_viewall.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/myforums/myforums_viewall.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+	 
+	 <!-- forum watch controller -->
+	 <managed-bean>
+	  	<managed-bean-name>forumWatch</managed-bean-name>
+	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.ForumWatchController</managed-bean-class>
+	  	<managed-bean-scope>request</managed-bean-scope>
+	  	<managed-property>
+	  		<!-- set the default embedded mode -->
+	  		<property-name>watchMode</property-name>
+	  		<value>1</value>
+	  	</managed-property>
+	 </managed-bean>
+     <navigation-rule>
+        <from-view-id>/views/watches/forumWatch.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/forums/viewforum_body.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+     <navigation-rule>
+        <from-view-id>/views/watches/forumWatch.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>cancel</from-outcome>
+            <to-view-id>/views/forums/viewforum_body.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+     
+     <!-- topic watch controller -->
+     <managed-bean>
+        <managed-bean-name>topicWatch</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.action.TopicWatchController</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+     </managed-bean>
+     <navigation-rule>
+        <from-view-id>/views/watches/topicWatch.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+     <navigation-rule>
+        <from-view-id>/views/watches/topicWatch.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>cancel</from-outcome>
+            <to-view-id>/views/topics/viewtopic_body.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+
+     
+     <!-- myforums controller -->
+     <managed-bean>
+        <managed-bean-name>myForums</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewMyForumsMain</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>
+     </managed-bean>
+     <managed-bean>
+        <managed-bean-name>myForumsAll</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewMyForumsAllSubscribed</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>
+     </managed-bean>
+     <managed-bean>
+        <managed-bean-name>myForumsEdit</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewMyForumsEditAllForums</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+     </managed-bean>
+     <navigation-rule>
+        <from-view-id>/views/myforums/myforums_editforums.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/myforums/myforums_editforums.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+
+     <managed-bean>
+        <managed-bean-name>search</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.action.Search</managed-bean-class>
+        <managed-bean-scope>session</managed-bean-scope>
+     </managed-bean>
+     <managed-bean>
+        <managed-bean-name>viewSearch</managed-bean-name>
+        <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewSearch</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>
+        <managed-property>
+            <property-name>search</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.Search</property-class>
+            <value>#{search}</value>
+        </managed-property>
+     </managed-bean>     
+
+     <navigation-rule>
+        <from-view-id>/views/search/viewsearch_body.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/search/viewsearch_results.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
+     
+</faces-config>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-object.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-object.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums-object.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+	<deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default</parent-ref>
+		<page>
+			<page-name>forums</page-name>
+
+			<window>
+				<window-name>NavigationPortletWindow</window-name>
+				kosmos/
+				<instance-ref>NavigationPortletInstance</instance-ref>
+				<region>navigation</region>
+				<height>0</height>
+				<!-- keep portal and page properties for this window -->
+				<properties>
+					<!-- use the window renderer from the emptyRenderer renderSet -->
+					<property>
+						<name>theme.windowRendererId</name>
+						<value>emptyRenderer</value>
+					</property>
+					<!-- use the decoration renderer from the emptyRenderer renderSet -->
+					<property>
+						<name>theme.decorationRendererId</name>
+						<value>emptyRenderer</value>
+					</property>
+					<!-- use the portlet renderer from the emptyRenderer renderSet -->
+					<property>
+						<name>theme.portletRendererId</name>
+						<value>emptyRenderer</value>
+					</property>
+				</properties>
+			</window>
+
+			<window>
+				<window-name>JBossForumsWindow</window-name>
+				<instance-ref>JBossForumsInstance</instance-ref>
+				<region>center</region>
+				<height>1</height>
+			</window>
+		</page>
+	</deployment>
+</deployments>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,218 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+	<namespace>http://www.jboss.com/products/jbossportal/forums</namespace>
+	<!-- 
+		 function generates an outputLink that works seamlessly within portal and standalone environment 
+	     to be used for generating "GET" requests that can be bookmarked
+	-->
+	<function>
+  		<function-name>outputLink</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>java.lang.String outputLink(java.lang.String,boolean)</function-signature>
+	</function>
+        <!-- 
+             function generates a permament link to post in a topic view 
+             that works seamlessly within portal and standalone environment 
+	     to be used for generating "GET" requests that can be bookmarked
+	-->
+	<function>
+  		<function-name>postPermlink</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>java.lang.String postPermlink(java.lang.String)</function-signature>
+	</function>
+	<!-- 
+		 function generates String value got from org.jboss.portal.core.CoreConstants
+	-->
+	<function>
+  		<function-name>userProperty</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>java.lang.String userProperty(org.jboss.portal.identity.User,java.lang.String)</function-signature>
+	</function>
+	<!-- 
+		 function to get constant declarations
+	-->
+	<function>
+  		<function-name>constantInt</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ConstantsHelper</function-class>
+  		<function-signature>int getConstantInt(java.lang.String)</function-signature>
+	</function>	
+	<!-- 
+		 function generates the contextPath of the application
+	-->
+	<function>
+  		<function-name>contextPath</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class>
+  		<function-signature>java.lang.String getContextPath()</function-signature>
+	</function>
+	<!-- 
+		 function retrieves a generic error message if one is found.
+		 return null if nothing is found
+	-->
+	<function>
+  		<function-name>errorMsg</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class>
+  		<function-signature>java.lang.String getErrorMsg()</function-signature>
+	</function>
+        <!--
+                function retrieves last post of specified in parameter forum
+        -->
+        <function>
+		<function-name>lastPost</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+  		<function-signature>
+                    org.jboss.portlet.forums.model.Post getLastPost(org.jboss.portlet.forums.ForumsModule,org.jboss.portlet.forums.model.Forum)
+                </function-signature>
+	</function>
+	<!-- 
+		 function retrieves a message if one is found
+		 return null if nothing is found
+	-->
+	<function>
+  		<function-name>message</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class>
+  		<function-signature>java.lang.String getMessage(java.lang.String)</function-signature>
+	</function>	
+	<!--
+	-->
+	<function>
+		<function-name>percentStr</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+  		<function-signature>java.lang.String getPercentStr(double)</function-signature>
+	</function>
+	
+    <!--
+    -->
+    <function>
+        <function-name>feedsConfigured</function-name>
+        <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+        <function-signature>boolean isFeedsConfigured()</function-signature>
+    </function>
+    
+	<!--
+	-->
+	<function>
+		<function-name>dateStr</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+  		<function-signature>java.lang.String getDateStr(java.util.Date)</function-signature>
+	</function>	
+	
+	<!-- application specific functions -->	
+	<!--
+		function calculates the vote percent for the specified poll option
+	-->
+	<function>
+		<function-name>votePercent</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>float getVotePercent(org.jboss.portlet.forums.model.Poll,org.jboss.portlet.forums.model.PollOption)</function-signature>
+	</function>
+        
+    <!-- 
+     	Method for processing posts's messages.
+    -->
+    <function>
+		<function-name>formatMessage</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>java.lang.String formatMessage(java.lang.String,boolean)</function-signature>
+	</function>
+	
+    <!-- 
+        Simple method returing subString of given String.
+    -->
+    <function>
+        <function-name>subString</function-name>
+        <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+        <function-signature>java.lang.String subString(java.lang.String,int)</function-signature>
+    </function>
+    
+    <!-- 
+        Simple method returing true if string is longer than given integer parameter.
+    -->
+    <function>
+        <function-name>isLongerThan</function-name>
+        <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+        <function-signature>boolean isLongerThan( java.lang.String , int )</function-signature>
+    </function>
+    
+    <!-- 
+        Simple method which trims given in parameter string.
+    -->
+    <function>
+        <function-name>nullIfEmptyString</function-name>
+        <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+        <function-signature>java.lang.String nullIfEmptyString( java.lang.String )</function-signature>
+    </function>
+    
+    <!-- 
+        Simple method which returns collection's size.
+    -->
+    <function>
+        <function-name>collectionSize</function-name>
+        <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+        <function-signature>int collectionSize( java.util.Collection )</function-signature>
+    </function>
+    
+	<!-- 
+		 function to get theme URL location
+	-->
+	<function>
+  		<function-name>themeURL</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ThemeHelper</function-class>
+  		<function-signature>java.lang.String getURL(java.lang.String)</function-signature>
+	</function>    	
+	<!-- 
+		 function to get folderTypeURL
+	-->
+	<function>
+  		<function-name>folderTypeURL</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ThemeHelper</function-class>
+  		<function-signature>java.lang.String getFolderTypeURL(org.jboss.portlet.forums.model.Topic,boolean)</function-signature>
+	</function> 
+	
+	<!-- 
+		 function to get folderType
+	-->
+	<function>
+  		<function-name>folderType</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.ThemeHelper</function-class>
+  		<function-signature>java.lang.String getFolderType(org.jboss.portlet.forums.model.Topic)</function-signature>
+	</function>
+	
+	<!-- 
+		 function to get isWatchingForum
+	-->
+	<function>
+  		<function-name>isWatchingForum</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
+  		<function-signature>java.lang.String isWatchingForum(org.jboss.portlet.forums.model.Forum)</function-signature>
+	</function>
+	
+	<!--
+		function to check if the application is running in a portal envioronment
+	-->
+	<function>
+  		<function-name>isRunningInPortal</function-name>
+  		<function-class>org.jboss.portlet.forums.ui.JSFUtil</function-class>
+  		<function-signature>boolean isRunningInPortal()</function-signature>
+	</function>
+	
+	<!-- access control tag -->
+	<tag>
+		<tag-name>isAllowed</tag-name>
+		<handler-class>org.jboss.portlet.forums.auth.ACLTagHandler</handler-class>
+	</tag>
+	
+	<!-- conditional access control tag -->
+	<tag>
+		<tag-name>isAllowedChoose</tag-name>
+		<handler-class>org.jboss.portlet.forums.auth.ACLChooseTagHandler</handler-class>
+	</tag> 
+	<tag>
+		<tag-name>isAllowedWhen</tag-name>
+		<handler-class>org.jboss.portlet.forums.auth.ACLWhenTagHandler</handler-class>
+	</tag>
+	<tag>
+		<tag-name>isAllowedOtherwise</tag-name>
+		<handler-class>org.jboss.portlet.forums.auth.ACLOtherwiseTagHandler</handler-class>
+	</tag>     	       
+</facelet-taglib>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+<jboss-app>
+   <app-name>forums</app-name>
+</jboss-app>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,164 @@
+<portlet-app>
+   <portlet>
+      <portlet-name>ForumsPortlet</portlet-name>
+      <security>
+         <model>
+            <content-provider-class>org.jboss.portlet.forums.security.ForumsModelContentProvider</content-provider-class>
+            <!-- Root level -->
+            <permission-description>
+               <permission-name>Read</permission-name>
+               <description>Global reading privilege</description>
+               <implies>ReadCategory</implies>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>Add</permission-name>
+               <description>Global add privilege</description>
+               <implies>AddPostInForum</implies>
+               <implies>Read</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>Delete</permission-name>
+               <description>Global deleting privilege</description>
+               <implies>Add</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>Edit</permission-name>
+               <description>Global editing privilege</description>
+               <implies>Add</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>Admin</permission-name>
+               <description>Global Admin Privilege</description>
+               <implies>AddForumInCategory</implies>
+               <implies>Edit</implies>
+               <implies>Delete</implies>
+               <implies>AdminCategory</implies>
+               <implies>EditCategory</implies>
+            </permission-description>
+            <!-- Category level -->
+            <permission-description>
+               <permission-name>ReadCategory</permission-name>
+               <description>Read a category</description>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>EditCategory</permission-name>
+               <description>Edit Category (name and etc...)</description>
+            </permission-description>
+            <permission-description>
+               <permission-name>AddForumInCategory</permission-name>
+               <description>Add a forum in the category</description>
+               <implies>ReadCategory</implies>
+               <implies>AddPostInForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>DeleteForumInCategory</permission-name>
+               <description>Delete a forum in the category</description>
+               <implies>AddForumInCategory</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>EditForumInCategory</permission-name>
+               <description>Edit a forum in the category</description>
+               <implies>AddForumInCategory</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>AdminCategory</permission-name>
+               <description>Admin a category</description>
+               <implies>EditForumInCategory</implies>
+               <implies>DeleteForumInCategory</implies>
+               <implies>AdminForum</implies>
+               <implies>AddPollInPost</implies>
+               <implies>EditPollInPost</implies>
+               <implies>AddAttachmentInPost</implies>
+            </permission-description>
+            <!-- Forum level -->
+            <permission-description>
+               <permission-name>ReadForum</permission-name>
+               <description>Read a forum</description>
+            </permission-description>
+            <permission-description>
+               <permission-name>AddPostInForum</permission-name>
+               <description>Post in a forum</description>
+               <implies>ReadForum</implies>
+               <implies>VotePollInPost</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>AddPollInPost</permission-name>
+               <description>Submit Polls in forum posts</description>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>AddAttachmentInPost</permission-name>
+               <description>Can Add Attachments in forum posts</description>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>EditPollInPost</permission-name>
+               <description>Can edit poll (when editing topic first post)</description>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>VotePollInPost</permission-name>
+               <description>Vote in Polls in forum posts</description>
+               <implies>ReadForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>EditPostInForum</permission-name>
+               <description>Edit a post in a forum</description>
+               <implies>AddPostInForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>DeletePostInForum</permission-name>
+               <description>Delete a post in a forum</description>
+               <implies>AddPostInForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>ModerateForum</permission-name>
+               <description>Moderate a forum</description>
+               <implies>EditPostInForum</implies>
+               <implies>DeletePostInForum</implies>
+            </permission-description>
+            <permission-description>
+               <permission-name>AdminForum</permission-name>
+               <description>Admin a forum</description>
+               <implies>ModerateForum</implies>
+            </permission-description>
+            <scheme>
+               <item>
+                  <path>/</path>
+                  <permission>
+                     <permission-name>Add</permission-name>
+                     <role-name>User</role-name>
+                  </permission>
+                  <permission>
+                     <permission-name>Edit</permission-name>
+                     <role-name>EditPostInForum</role-name>
+                  </permission>
+                  <permission>
+                     <permission-name>Admin</permission-name>
+                     <role-name>Admin</role-name>
+                  </permission>
+                  <!-- For non logged users -->
+                  <permission>
+                     <permission-name>Read</permission-name>
+                     <unchecked/>
+                  </permission>
+               </item>
+            </scheme>
+         </model>
+      </security>
+      <transaction>
+         <trans-attribute>Required</trans-attribute>
+      </transaction>
+      <header-content>
+         <link rel="stylesheet" type="text/css" href="/subSilver/styles.css" title="" media="screen"/>
+      </header-content>
+   </portlet>
+   <portlet>
+		<portlet-name>JSFForumsPortlet</portlet-name> 		
+		<transaction>
+         	<trans-attribute>Required</trans-attribute>
+        </transaction>
+   </portlet>
+</portlet-app>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<jboss-web>
+	<security-domain>java:jaas/forums</security-domain>
+</jboss-web>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portal-lib.tld
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portal-lib.tld	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portal-lib.tld	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,77 @@
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
+  version="2.0">
+   <tlib-version>1.1</tlib-version>
+   <jsp-version>2.0</jsp-version>
+   <shortname>JBoss Portal tags</shortname>
+   <info>JBoss Portal tags</info>
+
+   <function>
+      <name>i18n</name>
+      <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+      <function-signature>java.lang.String getMessage(java.lang.String)</function-signature>
+   </function>
+
+   <function>
+      <name>out</name>
+      <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+      <function-signature>java.lang.String out(java.lang.String)</function-signature>
+   </function>
+
+   <function>
+      <name>i18nout</name>
+      <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+      <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature>
+   </function>
+
+   <tag>
+      <name>if</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tagclass>
+      <attribute>
+         <name>ctx</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>iterate</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tagclass>
+      <attribute>
+         <name>ctx</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+
+   <tag>
+      <name>include</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tagclass>
+      <attribute>
+         <name>page</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+
+   <tag>
+      <name>error</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.ErrorTag</tagclass>
+      <attribute>
+         <name>key</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+
+   <tag>
+      <name>errors</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.ErrorsTag</tagclass>
+   </tag>
+
+   <tag>
+      <name>success</name>
+      <tagclass>org.jboss.portal.core.servlet.jsp.taglib.SuccessTag</tagclass>
+   </tag>
+</taglib>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet-instances.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet-instances.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet-instances.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<deployments>
+	<deployment>
+		<instance>
+			<instance-id>JBossForumsInstance</instance-id>
+			<portlet-ref>JSFForumsPortlet</portlet-ref>
+		</instance>
+	</deployment>
+</deployments>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/portlet.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app
+   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
+   version="1.0">
+      
+   <portlet>
+      <portlet-name>JSFForumsPortlet</portlet-name>
+      <!--portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class-->
+      <portlet-class>org.jboss.portlet.forums.ui.ForumsJSFPortlet</portlet-class>
+      <display-name>JBoss Forums</display-name>
+      <description>JBoss Forums 1.2.0 for JBoss Portal 2.6</description>
+      <init-param>
+         <name>default-view</name>
+         <value>/views/portal_index.xhtml</value>
+      </init-param>
+      <expiration-cache>-1</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+      </supports>
+      <portlet-info>
+         <title>JBoss Forums</title>
+      </portlet-info>
+      <portlet-preferences>
+	     <!--  Luca Stancapiano start - this field let to configure
+	           one or more alternative forums to add it into the portal.
+	           You can to configure it by portlet instances of forums. Each
+	           number is a different instance of forum , so you can to work with
+	           different categories, forums or topic for each forum. The same number is
+	           the same forum with same objects -->
+         <preference>
+            <name>foruminstanceid</name>
+            <value>1</value>	    		
+         </preference>	
+	     <!--  Luca Stancapiano end -->
+         <preference>
+            <name>summarymode</name>
+            <value>0</value>
+         </preference>
+         <preference>
+            <name>summarytopiclimit</name>
+            <value>6</value>
+         </preference>
+         <preference>
+            <name>summarytopicdays</name>
+            <value>20</value>
+         </preference>
+         <preference>
+            <name>summarytopicreplies</name>
+            <value>15</value>
+         </preference>
+         <preference>
+            <name>topicsperforum</name>
+            <value>10</value>
+         </preference>
+         <preference>
+            <name>postspertopic</name>
+            <value>15</value>
+         </preference>         
+         <preference>
+            <name>notifyreply</name>
+            <value>true</value>
+         </preference>
+         <preference>
+            <name>allowhtml</name>
+            <value>true</value>            
+         </preference>
+         <preference>
+            <name>postorder</name>
+            <value>ascending</value>
+         </preference>                  
+         <preference>
+            <name>dateformat</name>
+            <value>EEE MMM d, yyyy HH:mm aaa</value>
+         </preference>
+         <preference>
+            <name>alwaysaddsignature</name>
+            <value>true</value>
+         </preference>
+         <preference>
+            <name>signature</name>
+            <value></value>
+         </preference>         
+      </portlet-preferences>
+   </portlet>
+</portlet-app>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/tomahawk.taglib.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/tomahawk.taglib.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/tomahawk.taglib.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,444 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+    <!-- author: thomas.jachmann at mindmatters.de -->
+    <namespace>http://myfaces.apache.org/tomahawk</namespace>
+    <tag>
+        <tag-name>commandButton</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandButton</component-type>
+            <renderer-type>org.apache.myfaces.Button</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandLink</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandLink</component-type>
+            <renderer-type>org.apache.myfaces.Link</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataTable</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataTable</component-type>
+            <renderer-type>org.apache.myfaces.Table</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputHidden</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputHidden</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputSecret</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputSecret</component-type>
+            <renderer-type>org.apache.myfaces.Secret</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputText</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputText</component-type>
+            <renderer-type>org.apache.myfaces.Text</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputHelpText</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputTextHelp</component-type>
+            <renderer-type>org.apache.myfaces.TextHelp</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputTextarea</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputTextarea</component-type>
+            <renderer-type>org.apache.myfaces.Textarea</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>graphicImage</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlGraphicImage</component-type>
+            <renderer-type>org.apache.myfaces.Image</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>message</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlMessage</component-type>
+            <renderer-type>org.apache.myfaces.Message</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>messages</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlMessages</component-type>
+            <renderer-type>org.apache.myfaces.Messages</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>outputLabel</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlOutputLabel</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>outputText</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlOutputText</component-type>
+            <renderer-type>org.apache.myfaces.Text</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelGrid</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelGrid</component-type>
+            <renderer-type>org.apache.myfaces.Grid</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelGroup</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelGroup</component-type>
+            <renderer-type>org.apache.myfaces.Group</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneMenu</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneMenu</component-type>
+            <renderer-type>org.apache.myfaces.Menu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyMenu</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyMenu</component-type>
+            <renderer-type>org.apache.myfaces.Menu</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneRadio</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneRadio</component-type>
+            <renderer-type>org.apache.myfaces.Radio</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectBooleanCheckbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectBooleanCheckbox</component-type>
+            <renderer-type>org.apache.myfaces.Checkbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyCheckbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyCheckbox</component-type>
+            <renderer-type>org.apache.myfaces.Checkbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneListbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectOneListbox</component-type>
+            <renderer-type>org.apache.myfaces.Listbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectManyListbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSelectManyListbox</component-type>
+            <renderer-type>org.apache.myfaces.Listbox</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputCalendar</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputCalendar</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>jsValueChangeListener</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.JsValueChangeListener</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>jsValueSet</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlJsValueSet</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>checkbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCheckbox</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandNavigation</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandNavigation</component-type>
+            <renderer-type>org.apache.myfaces.Navigation</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>commandSortHeader</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCommandSortHeader</component-type>
+            <renderer-type>org.apache.myfaces.SortHeader</renderer-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataList</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataList</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>dataScroller</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlDataScroller</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputDate</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputDate</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputFileUpload</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlInputFileUpload</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>inputHtml</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.InputHtml</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>navigationMenuItem</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.NavigationMenuItem</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>navigationMenuItems</tag-name>
+        <component>
+            <component-type>javax.faces.SelectItems</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>jscookMenu</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.JSCookMenu</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelLayout</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelLayout</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelNavigation</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelNavigation</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelTab</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelTab</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelTabbedPane</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelTabbedPane</component-type>
+        </component>
+    </tag>
+    <!-- deactivated since there's no component! tag>
+    <tag-name>tabChangeListener</tag-name>
+    <component>
+    <component-type></component-type>
+    </component>
+    </tag-->
+    <tag>
+        <tag-name>collapsiblePanel</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlCollapsiblePanel</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneCountry</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SelectOneCountry</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>selectOneLanguage</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SelectOneLanguage</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>stylesheet</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Stylesheet</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>div</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Div</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>htmlTag</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTag</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>radio</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlRadio</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>tree</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTree</component-type>
+            <renderer-type>org.apache.myfaces.HtmlTree</renderer-type>
+        </component>
+    </tag>
+    <!-- deactivated since there's no component! tag>
+    <tag-name>treeSelectionListener</tag-name>
+    <component>
+    <component-type></component-type>
+    </component>
+    </tag-->
+    <!-- deactivated since there's no component! tag>
+    <tag-name>iconProvider</tag-name>
+    <component>
+    <component-type></component-type>
+    </component>
+    </tag-->
+    <tag>
+        <tag-name>treeColumn</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTreeColumn</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>treeCheckbox</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTreeCheckbox</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>tree2</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlTree2</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>panelStack</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPanelStack</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>popup</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlPopup</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>newspaperTable</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlNewspaperTable</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>aliasBean</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.AliasBean</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>aliasBeansScope</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.AliasBeansScope</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>buffer</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.Buffer</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>saveState</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.SaveState</component-type>
+        </component>
+    </tag>
+    <!-- deactivated since there's no component! tag>
+    <tag-name>updateActionListener</tag-name>
+    <component>
+    <component-type></component-type>
+    </component>
+    </tag-->
+    <tag>
+        <tag-name>validateCreditCard</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.CreditCard</validator-id>
+        </validator>
+    </tag>
+    <tag>
+        <tag-name>validateEmail</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.Email</validator-id>
+        </validator>
+    </tag>
+    <tag>
+        <tag-name>validateEqual</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.Equal</validator-id>
+        </validator>
+    </tag>
+    <tag>
+        <tag-name>swapImage</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlSwapImage</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>columns</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlColumns</component-type>
+        </component>
+    </tag>
+    <tag>
+        <tag-name>column</tag-name>
+        <component>
+            <component-type>org.apache.myfaces.HtmlColumn</component-type>
+        </component>
+    </tag>
+    <!-- additional validators (note: not in tld, so no code completion) -->
+    <tag>
+        <tag-name>validateRegExpr</tag-name>
+        <validator>
+            <validator-id>org.apache.myfaces.validator.RegExpr</validator-id>
+        </validator>
+    </tag>
+</facelet-taglib>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,239 @@
+<?xml version="1.0"?>
+<!--
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
+version="2.4"> 
+   <context-param>
+        <param-name>javax.faces.CONFIG_FILES</param-name>
+        <param-value>
+            /WEB-INF/forums-config.xml
+        </param-value>
+        <description>
+            Comma separated list of URIs of (additional) faces config files.
+            (e.g. /WEB-INF/my-config.xml)
+            See JSF 1.0 PRD2, 10.3.2
+        </description>
+   </context-param>
+
+   <context-param>
+        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+        <param-value>true</param-value>
+   </context-param>
+   
+   <!--
+   <context-param>
+        <param-name>org.jboss.forums.UNIQUE_ID</param-name>
+        <param-value>f</param-value>
+        <description>
+            The value of this parameter overrides unique id created by portal
+            which is used to create an unique id for JSF components.
+            Sometimes this generated unique key might be long and if Forums
+            are used with large amounts of data then the length might increase
+            size of generated HTML code.
+            The parameter is optional and it can be set to any String value
+            also to a zero length String.
+   </context-param>
+   -->
+   
+   <!-- >context-param>
+        <param-name>org.jboss.forums.feeds.URL</param-name>
+        <param-value>/portal-forums</param-value>
+        <description>
+            This parameter is used to create proper links in standalone environment.
+            It must contain a path to Forums Servlet where Forums are deployed.
+        </description>
+    </context-param>-->
+    <context-param>
+        <param-name>org.jboss.forums.feeds.URL</param-name>
+        <param-value>/portal/portal/default/forums/JBossForumsWindow?action=1</param-value>
+        <description>
+            This parameter is used to create proper links in portal environment.
+            It must contain a path to a portlet window where Forums are deployed.
+        </description>
+    </context-param>
+    <context-param>
+        <param-name>org.jboss.forums.feeds.URL_TYPE</param-name>
+        <param-value>p</param-value>
+        <description>
+            This parameter is used to create proper links in portal environment.
+            It must contain a path to a portlet window where Forums are deployed.
+        </description>
+    </context-param>
+
+   <context-param>
+        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+        <param-value>server</param-value>
+        <description>
+            State saving method: "client" or "server" (= default)
+            See JSF Specification 2.5.2
+        </description>
+    </context-param>   
+    
+   <context-param>
+        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+        <param-value>true</param-value>
+        <description>
+			PRETTY_HTML
+        </description>
+    </context-param>
+    
+    <context-param>
+        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+        <param-value>true</param-value>
+        <description>
+			ALLOW_JAVASCRIPT
+        </description>
+    </context-param>
+    
+    <context-param>
+        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+        <param-value>false</param-value>
+        <description>
+			DETECT_JAVASCRIPT
+        </description>
+    </context-param>
+   
+    <context-param>
+        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+        <param-value>false</param-value>
+        <description>
+			AUTO_SCROLL
+        </description>
+    </context-param>   
+   
+   <!-- facelets integration -->
+   <!-- Use Documents Saved as *.xhtml -->	
+   <context-param>
+    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+    <param-value>.xhtml</param-value>
+   </context-param> 
+   
+   <!-- Special Debug Output for Development -->
+   <context-param>
+    <param-name>facelets.DEVELOPMENT</param-name>
+    <param-value>true</param-value>
+   </context-param>
+   
+   <context-param>
+      <param-name>facelets.LIBRARIES</param-name>
+      <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/forums.taglib.xml</param-value>
+   </context-param>  
+              
+   <!-- JSF Extensions filter -->
+   <filter>
+		<filter-name>MyFacesExtensionsFilter</filter-name>
+		<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
+	    <init-param>
+	        <param-name>maxFileSize</param-name>
+	        <param-value>20m</param-value>
+	        <description>Set the size limit for uploaded files.
+	            Format: 10 - 10 bytes
+	                    10k - 10 KB
+	                    10m - 10 MB
+	                    1g - 1 GB
+	        </description>
+	    </init-param>
+   </filter>
+   <filter-mapping>
+      <filter-name>MyFacesExtensionsFilter</filter-name>
+      <servlet-name>FacesServlet</servlet-name>      
+   </filter-mapping>
+   
+   <!-- Download Attachment filter -->
+   <filter>
+		<filter-name>DownloadFilter</filter-name>
+		<filter-class>org.jboss.portlet.forums.ui.DownloadFilter</filter-class>	    
+   </filter>
+   <filter-mapping>
+      <filter-name>DownloadFilter</filter-name>
+      <url-pattern>/downloadAttachment</url-pattern>      
+   </filter-mapping>
+   
+   <!-- URL filter -->
+       
+    <!-- Faces Servlet -->   
+    <servlet>
+        <servlet-name>FacesServlet</servlet-name>
+        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+   
+    <!-- Faces Servlet Mapping -->
+    <!-- extension mapping -->
+    <servlet-mapping>
+        <servlet-name>FacesServlet</servlet-name>
+        <url-pattern>*.jsf</url-pattern>
+    </servlet-mapping>
+
+  	<!--servlet>
+      <servlet-name>DownloadAttachmentsServlet</servlet-name>
+      <servlet-class>org.jboss.portlet.forums.servlet.DownloadAttachmentsServlet</servlet-class>
+     <load-on-startup>1</load-on-startup>
+  	</servlet>
+
+   <servlet-mapping>
+      <servlet-name>DownloadAttachmentsServlet</servlet-name>
+      <url-pattern>/files</url-pattern>
+   </servlet-mapping-->
+   
+   <!-- error handling -->
+   <!--error-page>
+		<error-code>500</error-code>
+		<location>/views/errors/error_body.jsf</location>
+   </error-page-->	
+   
+   <!-- secure the facelet views that make up the ui components of this jsf application -->
+    <security-constraint>
+   		<display-name>constraints for all facelets</display-name>
+   		<web-resource-collection>
+   			<web-resource-name>protected all facelets</web-resource-name>
+   			<url-pattern>*.xhtml</url-pattern>   			
+   		</web-resource-collection>
+   		<auth-constraint>
+   			<description>No roles so no direct access</description>
+   		</auth-constraint>
+    </security-constraint>
+
+    <listener>
+        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+    </listener>
+
+    <!-- integrating BASIC AUTH for the standalone JSF version -->
+    <security-constraint>
+      <web-resource-collection>
+         <web-resource-name>Authenticated</web-resource-name>
+         <description></description>
+         <url-pattern>/views/*</url-pattern>
+      </web-resource-collection>
+      <auth-constraint>
+         <role-name>Authenticated</role-name>
+      </auth-constraint>
+   </security-constraint>   
+   <login-config>
+      <auth-method>BASIC</auth-method>
+      <realm-name>JBoss Forums</realm-name>
+   </login-config>
+   <security-role>
+      <role-name>Authenticated</role-name>
+   </security-role>
+   
+   <!-- RSS Servlet -->
+	<servlet>
+		<servlet-name>FeedsServlet</servlet-name>
+		<servlet-class>org.jboss.portlet.forums.feeds.FeedsServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	
+	<servlet-mapping>
+		<servlet-name>FeedsServlet</servlet-name>
+		<url-pattern>/feeds/*</url-pattern>
+	</servlet-mapping>
+</web-app>
+
+

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteCategory.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteCategory.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteCategory.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,82 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<h1>${resource.Category_delete}</h1>
+<p>${resource.Forum_delete_explain}</p>
+
+<div class="forumsubscriptionconfirm">
+<h:form>
+    <input type="hidden" name="c" value="#{param['c']}"/>
+    <h3>${resource.Category_delete}</h3>
+    <p>${resource.Category}</p>
+    <h4>#{adminController.categoryName}</h4>
+    <label>${resource.Move_contents}</label>
+    <br />
+    <h:selectOneMenu value="#{adminController.selectedCategory}">
+        <f:selectItem itemValue="-1" itemLabel="${resource.Delete_all_forums_topics_posts}" />
+        <c:forEach items="#{adminPanel.categories}" var="category">
+            <c:if test="#{category.id != param['c']}">
+                <f:selectItem itemValue="#{category.id}" itemLabel="#{category.title}" />
+            </c:if>
+        </c:forEach>
+    </h:selectOneMenu>
+    <div class="forumformbuttonrow">
+        <ul>
+            <li>
+                <h:commandButton value="${resource.Confirm}" styleClass="buttonMed"
+                                 action="#{adminController.deleteCategory}"/>
+            </li>
+            <li>
+                <h:commandButton type="submit" action="${adminController.cancel}"
+                                 value="${resource.Cancel}" styleClass="buttonMed" />
+            </li>
+        </ul>
+    </div>
+</h:form>
+</div>
+
+<!-- integrate the jump box -->    
+<table cellspacing="0" cellpadding="0" border="0" align="right">
+    <tr>
+        <td align="right" valign="top" nowrap="nowrap">
+            <ui:include src="/views/jumpbox.xhtml"/>
+        </td>
+    </tr>
+</table>
+
+</ui:define>
+</ui:composition>   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteForum.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteForum.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/deleteForum.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,82 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<h1>${resource.Forum_delete}</h1>
+<p>${resource.Forum_delete_explain}</p>
+
+<div class="forumsubscriptionconfirm">
+<h:form>
+    <input type="hidden" name="f" value="#{param['f']}"/>
+    <h3>${resource.Forum_delete}</h3>
+    <p>${resource.Forum}</p>
+    <h4>#{adminController.forumName}</h4>
+    <label>${resource.Move_contents}</label>
+    <br />
+    <h:selectOneMenu value="#{adminController.selectedForum}">
+        <f:selectItem itemValue="-1" itemLabel="${resource.Delete_all_topics_posts}" />
+        <c:forEach items="#{adminPanel.forums}" var="forum">
+            <c:if test="#{forum.id != param['f']}">
+                <f:selectItem itemValue="#{forum.id}" itemLabel="#{forum.name}" />
+            </c:if>
+        </c:forEach>
+    </h:selectOneMenu>
+    <div class="forumformbuttonrow">
+        <ul>
+            <li>
+                <h:commandButton value="${resource.Confirm}" styleClass="buttonMed"
+                                 action="#{adminController.deleteForum}"/>
+            </li>
+            <li>
+                <h:commandButton type="submit" action="${adminController.cancel}"
+                                 value="${resource.Cancel}" styleClass="buttonMed" />
+            </li>
+        </ul>
+    </div>
+</h:form>
+</div>
+
+<!-- integrate the jump box -->
+<table cellspacing="0" cellpadding="0" border="0" align="right">
+    <tr>
+        <td align="right" valign="top" nowrap="nowrap">
+            <ui:include src="/views/jumpbox.xhtml"/>
+        </td>
+    </tr>
+</table>
+    
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/index.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/index.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/admin/index.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,469 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+    <!-- Forum admin tool title and usability explanation and feedback messages -->
+    <div class="forumtitletext">
+        <h4>${resource.Forum_admin}</h4>
+        <p>${resource.Forum_admin_explain}</p>
+        <p class="successtext">#{forums:message('feedback')}</p>
+    </div>
+    
+    <!-- Add new category button -->
+    <forums:isAllowed fragment="acl://addCategory">
+    <h:form>
+    <input type="hidden" name="addCategory" value="true" />
+    <div class="actionbuttons">
+        <ul>
+            <li>
+                <h:commandLink action="#{adminController.dummyAction}">
+                    <img src="${forums:themeURL('resourceAdminNewCategoryURL')}"
+                         alt="${resource.Create_category}" name="newCategory"
+                         border="0" />
+                </h:commandLink>
+            </li>
+        </ul>
+    </div>
+    </h:form>
+    </forums:isAllowed>
+
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+    
+        <!-- Table header -->
+        <tr class="header">
+            <td class="forumheaderfirst">${resource.Forum_admin}</td>
+            <td class="forumheaderlast">${Admin_actions}</td>
+        </tr>
+
+        <!-- display a list of categories -->
+        <c:forEach items="#{adminPanel.categories}" var="category" varStatus="categoryIdx" >
+        <forums:isAllowed fragment="acl://viewCategory" contextData="#{category}">
+        
+        <f:subview>
+        
+        <c:choose>
+        
+            <c:when test="${ ( (adminController.editCategoryMode and forums:message('feedback') eq null) 
+                               and (adminController.selectedCategory eq category.id)                         )
+                             or 
+                             ( (forums:nullIfEmptyString(category.title) eq null)                            )
+                           }" >
+                <tr class="editRow">
+                    <td>
+                        <h:form id="form_${category.id}">
+                            <input type="hidden" name="c" value="#{category.id}"/>
+                            <input type="hidden" name="editCategory" value="true" />
+                            <label for="categoryname" class="categorylabel">${resource.Category_name}:</label>
+                            <h:inputText id="Category" required="true"
+                                         value="#{adminController.categoryName}" />
+                            <h:message for="Category" styleClass="inlinefailure" />
+                            <h:commandButton id="editinline"
+                                             value="${resource.Update}"
+                                             styleClass="buttonMed"
+                                             action="#{adminController.editCategory }"/>
+                        </h:form>
+                    </td>
+                    <td class="forumlistlast">
+                        &#160;
+                    </td>
+                </tr>
+            </c:when>
+            
+            <c:otherwise>
+                <tr class="oddRow">
+                    <td>
+                    
+                        <!-- create new forum button -->
+                        <forums:isAllowed fragment="acl://addForum">
+                        <h:form>
+                            <input type="hidden" name="c" value="#{category.id}"/>
+                            <input type="hidden" name="addForum" value="true" />
+                            <div class="forumfloatright actionbuttons">
+                                <h:commandLink action="#{adminController.dummyAction}">
+                                    <img src="${forums:themeURL('resourceAdminNewForumURL')}"
+                                         alt="${resource.Create_forum}" border="0" />
+                                </h:commandLink>
+                            </div>
+                        </h:form>
+                        </forums:isAllowed>
+                        
+                        <strong>${category.title}</strong>
+                        
+                        <forums:isAllowed fragment="acl://editCategory" contextData="#{category}">
+                        <h:form>
+                            <input type="hidden" name="c" value="#{category.id}"/>
+                            &#160;(&#160;
+                            <h:commandLink action="${adminController.dummyAction}">
+                                <f:param name="editCategory" value="true"/>
+                                <h:outputText value="${resource.Edit_Category}"/>
+                            </h:commandLink>
+                            )
+                        </h:form>
+                        </forums:isAllowed>
+                        
+                    </td>
+                    <td class="forumlistlast actionbuttons">
+                        <h:form>
+                            <input type="hidden" name="c" value="#{category.id}"/>
+                            <ul>
+                                <li>
+                                <c:choose>
+                                
+                                    <c:when test="${categoryIdx.index eq 0}">
+                                        <img src="${forums:themeURL('resourceAdminArrowUpDisaURL')}"
+                                             alt="${resource.Move_up}" name="arrowup" border="0" />
+                                    </c:when>
+                                    
+                                    <c:otherwise>
+                                        <h:commandLink action="#{adminController.moveCategoryUp}">
+                                            <img src="${forums:themeURL('resourceAdminArrowUpURL')}"
+                                                 alt="${resource.Move_up}" name="arrowup" border="0" />
+                                        </h:commandLink>
+                                    </c:otherwise>
+                                    
+                                </c:choose>
+                                </li>
+                                
+                                <li>
+                                <c:choose>
+                                
+                                    <c:when test="${categoryIdx.index eq forums:collectionSize(adminPanel.categories)-1}">
+                                        <img src="${forums:themeURL('resourceAdminArrowDownDisaURL')}"
+                                             alt="${resource.Move_down}" name="arrowdown" border="0" />
+                                    </c:when>
+                                    
+                                    <c:otherwise>
+                                        <h:commandLink action="#{adminController.moveCategoryDown}">
+                                            <img src="${forums:themeURL('resourceAdminArrowDownURL')}"
+                                                 alt="${resource.Move_down}" name="arrowdown" border="0" />
+                                        </h:commandLink>
+                                    </c:otherwise>
+                                    
+                                </c:choose>
+                                </li>
+                                
+                                <li>
+                                <forums:isAllowedChoose>
+                                
+                                    <forums:isAllowedWhen fragment="acl://deleteCategory" contextData="#{category}">
+                                    <h:outputLink value="#{forums:outputLink('/views/admin/deleteCategory.jsf',true)}">
+                                        <f:param name="c" value="#{category.id}"/>
+                                        <img src="${forums:themeURL('resourceTopicModeDeleteURL')}"
+                                                 alt="${resource.Delete}" name="delete" border="0" />
+                                    </h:outputLink>
+                                    </forums:isAllowedWhen>
+                                    
+                                    <forums:isAllowedOtherwise>
+                                        <img src="${forums:themeURL('resourceTopicModeDeleteDisaURL')}"
+                                             alt="${resource.Delete}" name="delete" border="0" />
+                                    </forums:isAllowedOtherwise>
+                                    
+                                </forums:isAllowedChoose>
+                                </li>
+                                
+                                <!-- TODO: Locking/Unlocking of a category needs support from database. 
+                                <li>
+                                    <a href="#">
+                                        <img src="images/forum_ico_adminunlock.gif"
+                                             alt="Unlock" name="unlock" border="0" />
+                                    </a>
+                                </li>
+                                -->
+                                
+                            </ul>
+                        </h:form>
+                    </td>
+                </tr>
+            </c:otherwise>
+            
+        </c:choose>
+
+        </f:subview>
+        
+        <!-- display the forums in this category -->
+        <c:forEach items="#{category.forums}" var="forum" varStatus="forumIdx" >
+        <forums:isAllowed fragment="acl://viewForum" contextData="#{forum}">
+        
+        <f:subview>
+        
+        <c:choose>
+        
+            <c:when test="${( (adminController.editForumMode and forums:message('feedback') eq null)
+                               and adminController.selectedForum eq forum.id                              )
+                            or ( forums:nullIfEmptyString(forum.name) eq null                         )}" >
+                <tr class="editRow">
+                    <td class="Indent">
+                        <h:form id="forumForm_${forum.id}">
+                            <input type="hidden" name="c" value="#{category.id}"/>
+                            <input type="hidden" name="editForum" value="true" />
+                            <input type="hidden" name="f" value="#{forum.id}"/>
+                            <label for="forumname">${resource.Forum_name}:</label>
+                            <h:inputText id="Forum" required="true"
+                                         style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                         value="#{adminController.forumName}" />
+                            <h:message for="Forum" styleClass="inlinefailure"/>
+                            <label for="forumdescription">${resource.Forum_desc}:</label>
+                            <h:inputTextarea rows="5"
+                                             style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                             value="#{adminController.forumDescription}"/>
+                            <label for="forumcategory">${resource.Forum_category}:</label>
+                            <h:selectOneMenu value="#{adminController.selectedCategory}"
+                                             style="margin-left: 100px; display:block; margin-bottom: 10px;">
+                                <c:forEach items="#{adminPanel.categories}" var="cat">
+                                    <f:selectItem itemValue="#{cat.id}" itemLabel="#{cat.title}" />
+                                </c:forEach>
+                            </h:selectOneMenu>
+                            <h:commandButton id="adminbutton" value="${resource.Update}" styleClass="buttonMed"
+                                             style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                             action="#{adminController.editForum}"/>
+                        </h:form>
+                    </td>
+                    <td class="forumlistlast">
+                        &#160;
+                    </td>
+                </tr>
+            </c:when>
+            
+            <c:otherwise>
+                <tr class="evenRow">
+                    <td class="Indent">
+                        <strong>${forum.name}</strong>
+                        <forums:isAllowed fragment="acl://editForum" contextData="#{forum}">
+                        <h:form>
+                            <input type="hidden" name="f" value="#{forum.id}"/>
+                            &#160;(&#160;
+                            <h:commandLink action="#{adminController.dummyAction}">
+                                <f:param name="editForum" value="true"/>
+                                <h:outputText value="${resource.Edit_forum}"/>
+                            </h:commandLink>
+                            )
+                        </h:form>
+                        </forums:isAllowed>
+                        ${forum.description}
+                    </td>
+                    <td class="forumlistlast actionbuttons">
+                        <h:form>
+                            <input type="hidden" name="f" value="#{forum.id}"/>
+                            <ul>
+                                <li>
+                                <c:choose>
+                                    
+                                    <c:when test="${forumIdx.index eq 0}">
+                                        <img src="${forums:themeURL('resourceAdminArrowUpDisaURL')}"
+                                             alt="${resource.Move_up}" name="arrowup" border="0" />
+                                    </c:when>
+                                    
+                                    <c:otherwise>
+                                        <h:commandLink action="#{adminController.moveForumUp}">
+                                            <img src="${forums:themeURL('resourceAdminArrowUpURL')}"
+                                                 alt="${resource.Move_up}" name="arrowup" border="0" />
+                                        </h:commandLink>
+                                    </c:otherwise>
+                                    
+                                </c:choose>
+                                </li>
+                                
+                                <li>
+                                <c:choose>
+                                
+                                    <c:when test="${forumIdx.index eq forums:collectionSize(category.forums)-1}">
+                                        <img src="${forums:themeURL('resourceAdminArrowDownDisaURL')}"
+                                             alt="${resource.Move_down}" name="arrowdown" border="0" />
+                                    </c:when>
+                                    
+                                    <c:otherwise>
+                                        <h:commandLink action="#{adminController.moveForumDown}">
+                                            <img src="${forums:themeURL('resourceAdminArrowDownURL')}"
+                                                 alt="${resource.Move_down}" name="arrowdown" border="0" />
+                                        </h:commandLink>
+                                    </c:otherwise>
+                                    
+                                </c:choose>
+                                </li>
+                                
+                                <li>
+                                <forums:isAllowedChoose>
+                                
+                                    <forums:isAllowedWhen fragment="acl://deleteForum" contextData="#{forum}">
+                                    <h:outputLink value="#{forums:outputLink('/views/admin/deleteForum.jsf',true)}">
+        			            		<f:param name="f" value="#{forum.id}"/>
+                                        <img src="${forums:themeURL('resourceTopicModeDeleteURL')}"
+                                             alt="${resource.Delete}" name="delete" border="0" />
+                                    </h:outputLink>
+                                    </forums:isAllowedWhen>
+                                    
+                                    <forums:isAllowedOtherwise>
+                                        <img src="${forums:themeURL('resourceTopicModeDeleteDisaURL')}"
+                                             alt="${resource.Delete}" name="delete" border="0" />
+                                    </forums:isAllowedOtherwise>
+                                    
+                                </forums:isAllowedChoose>
+                                </li>
+                                
+                                <forums:isAllowed fragment="acl://lockForums" contextData="#{forum}" >
+                                <li>
+                                    <c:choose>
+                                    
+                                        <c:when test="#{forum.status eq forums:constantInt('FORUM_LOCKED')}">
+                                            <h:commandLink action="#{adminController.unlockForum}">
+                                                <f:param name="f" value="#{forum.id}"/>
+                                                <f:param name="c" value="#{category.id}"/>
+                                                <img src="${forums:themeURL('resourceIconUnlockURL')}" alt="${resource.Forum_unlock}" border="0"/>
+                                            </h:commandLink>
+                                        </c:when>
+                                        
+                                        <c:otherwise>
+                                            <h:commandLink action="#{adminController.lockForum}">
+                                                <f:param name="f" value="#{forum.id}"/>
+                                                <f:param name="c" value="#{category.id}"/>
+                                                <img src="${forums:themeURL('resourceIconLockURL')}" alt="${resource.Forum_lock}" border="0"/>
+                                            </h:commandLink>
+                                        </c:otherwise>
+                                    
+                                    </c:choose>
+                                </li>
+                                </forums:isAllowed>
+                                
+                            </ul>
+                        </h:form>
+                    </td>
+                </tr>
+            </c:otherwise>
+            
+        </c:choose>
+        
+        </f:subview>
+        
+        </forums:isAllowed>
+        </c:forEach>
+        
+        <!-- Add forum form -->
+        <c:if test="${ adminController.addForumMode
+                       and (adminController.selectedCategory eq category.id)
+                       and forums:message('feedback') eq null }">
+        
+        <tr class="editRow">
+            <td class="Indent">
+                <h:form id="addForumForm">
+                    <input type="hidden" name="c" value="#{category.id}"/>
+                    <input type="hidden" name="addForum" value="true" />
+                    <label for="forumname">${resource.Forum_name}:</label>
+                    <h:inputText id="Forum" required="true"
+                                 style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                 value="#{adminController.forumName}" />
+                    <h:message for="Forum" styleClass="inlinefailure"/>
+                    <label for="forumdescription">${resource.Forum_desc}:</label>
+                    <h:inputTextarea rows="5"
+                                     style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                     value="#{adminController.forumDescription}"/>
+                    <label for="forumcategory">${resource.Forum_category}:</label>
+                    <h:selectOneMenu value="#{adminController.selectedCategory}"
+                                     style="margin-left: 100px; display:block; margin-bottom: 10px;">
+                        <c:forEach items="#{adminPanel.categories}" var="cat">
+                            <f:selectItem itemValue="#{cat.id}" itemLabel="#{cat.title}" />
+                        </c:forEach>
+                    </h:selectOneMenu>
+                    <h:commandButton id="adminbutton" value="${resource.Create}" styleClass="buttonMed"
+                                     style="margin-left: 100px; display:block; margin-bottom: 10px;"
+                                     action="#{adminController.addForum}"/>
+                </h:form>
+            </td>
+            <td class="forumlistlast">
+                &#160;
+            </td>
+        </tr>
+        
+        </c:if>
+        
+    </forums:isAllowed>
+    </c:forEach>
+    
+    <!-- Add category form -->
+    <c:if test="${adminController.addCategoryMode and forums:message('feedback') eq null}" >
+    <h:form id="addCategoryForm">
+    
+        <tr class="editRow">
+            <td>
+                <input type="hidden" name="addCategory" value="true" />
+                <label for="categoryname" class="categorylabel">${resource.Category_name}:</label>
+                <h:inputText id="Category" required="true"
+                             value="#{adminController.categoryName}" />
+                <h:message for="Category" styleClass="inlinefailure"/>
+                <h:commandButton id="editinline"
+                                 value="${resource.Create}"
+                                 styleClass="buttonMed"
+                                action="#{adminController.addCategory}"/>
+            </td>
+            <td class="forumlistlast">
+                &#160;
+            </td>
+        </tr>
+        
+    </h:form>
+    </c:if>
+    
+    </table>
+    
+    <!-- Add new category button -->
+    <forums:isAllowed fragment="acl://addCategory">
+    <h:form>
+    <div class="actionbuttons">
+    <input type="hidden" name="addCategory" value="true" />
+        <ul>
+            <li>
+                <h:commandLink action="#{adminController.dummyAction}">
+                    <img src="${forums:themeURL('resourceAdminNewCategoryURL')}"
+                         alt="${resource.Create_category}" name="newCategory"
+                         border="0" />
+                </h:commandLink>
+            </li>
+        </ul>
+    </div>
+    </h:form>
+    </forums:isAllowed>
+    
+    <!-- integrate the jump box -->    
+    <!--
+    <table cellspacing="0" cellpadding="0" border="0" align="right">
+      <tr>
+        <td align="right" valign="top" nowrap="nowrap">
+            <ui:include src="/views/jumpbox.xhtml"/>                
+        </td>
+      </tr>
+    </table>
+    -->
+   </ui:define>
+   </ui:composition>   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,234 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+    <ui:define name="mainContent">
+        <div class="forumbread">
+            <ul>
+                <li class="first">
+                
+                    <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                        <h:outputText value="#{shared.mainPageName}"/>
+                    </h:outputLink>
+                    
+                    <c:if test="#{category.categories ne null and category.categorySelected eq true}" >
+                    <ul>
+                        <li>&gt; 
+                            <c:forEach items="#{category.categories}" var="catrow">
+                            <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                                <f:param name="c" value="#{catrow.id}"/>
+                                <h:outputText value="#{catrow.title}"/>                   
+                            </h:outputLink>
+                            </c:forEach>
+                        </li>
+                    </ul>
+                    </c:if>
+                    
+                </li>
+            </ul>
+        </div>
+        
+        <c:if test="${forums:feedsConfigured()}">
+            <div class="forumfloatright">
+            
+                <!--  feeds -->
+                <a href="#{category.rssFeed}">
+                    <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                    RSS
+                </a>
+                &#160;
+                <a href="#{category.atomFeed}">
+                    <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                    ATOM
+                </a>
+                <br />
+            </div>
+        </c:if>
+        
+        <h:form>
+		<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        
+            <tr class="header">
+                <td class="forumheaderfirst" colspan="2">#{resource.Forum}</td>
+                <td class="forumheadercentered">#{resource.Topics}</td>
+                <td class="forumheadercentered">#{resource.Posts}</td>
+                <td class="forumheaderlast">#{resource.Last_Post}</td>
+            </tr>
+		   
+            <!-- display each category and its corresponding forums -->
+            <c:forEach items="#{category.categories}" var="catrow">
+            <forums:isAllowed fragment="acl://readCategory" contextData="#{catrow}">
+            
+                <tr>
+                    <td class="forumcategory" colspan="5">
+                        <h3>
+                            <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                                <f:param name="c" value="#{catrow.id}"/>
+                                <h:outputText value="#{catrow.title}"/>
+                            </h:outputLink>
+                        </h3>
+                    </td>
+                </tr>
+
+                <c:forEach items="#{category.forums[catrow.id]}" var="forumrow">
+                <forums:isAllowed fragment="acl://readForum" contextData="#{forumrow}">
+                <tr>
+                    <td class="forumlisticon">
+                        <img src="#{category.forumImages[forumrow.id]}" width="11" height="14"
+                             alt="#{resource[category.forumImageDescriptions[forumrow.id]]}" 
+                             title="#{resource[category.forumImageDescriptions[forumrow.id]]}" />
+                    </td>
+                    <td>
+                        <h3>
+                            <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                                <f:param name="f" value="#{forumrow.id}"/>
+                                <h:outputText value="#{forumrow.name}"/>
+                            </h:outputLink>
+                        </h3>
+                        <br></br>
+                        ${forumrow.description}
+                    </td>
+                    <td class="forumlistcentered">
+                        ${forumrow.topicCount}
+                    </td>
+                    <td class="forumlistcentered">
+                        ${forumrow.postCount}
+                    </td>
+                    <td class="forumlistlast">
+                    
+                        <c:choose>
+                            <c:when test="#{category.forumLastPosts[forumrow.id]!=null}">
+                    
+                                <a href="#{forums:postPermlink(category.forumLastPosts[forumrow.id].id)}">
+                                <c:choose>
+                                    <c:when test="#{forums:isLongerThan(category.forumLastPosts[forumrow.id].message.subject,25)}">
+                                        #{forums:subString(category.forumLastPosts[forumrow.id].message.subject,25)}&#8230;
+                                    </c:when>
+                                    <c:otherwise>
+                                        #{category.forumLastPosts[forumrow.id].message.subject}
+                                    </c:otherwise>
+                                </c:choose>
+                                </a>
+                                
+                                <br></br>
+                                ${resource.By}&#160;
+                                
+	                            <c:choose>
+                                
+	                                <c:when test="#{category.anonymous}">
+                                        ${category.forumLastPosts[forumrow.id].poster.user.userName}
+                                    </c:when>
+                                    
+                                    <c:otherwise>
+                                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                            <f:param name="uid" value="#{category.forumLastPosts[forumrow.id].poster.user.id}"/>
+                                            <h:outputText value="${category.forumLastPosts[forumrow.id].poster.user.userName}"/>
+                                        </h:outputLink>
+                                    </c:otherwise>
+                                    
+                                </c:choose>
+                                
+                                <br></br>
+                                #{category.forumLastPosts[forumrow.id].createDate}
+                                
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{resource.No_Posts}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </td>
+                    
+                </tr>
+                
+                </forums:isAllowed>
+                </c:forEach>
+                
+            </forums:isAllowed>
+            </c:forEach>
+
+		</table>
+	
+		<!--table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
+		<tr>
+		<td align="left"><span class="gensmall"><a href="" class="gensmall">${resource.Mark_all_forums}</a></span></td>
+		<td align="right"><span class="gensmall"></span></td>
+		</tr>
+		</table>
+		
+		<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
+		<tr>
+		<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href=""
+		class="cattitle">${resource.Who_is_Online}</a></span></td>
+		</tr>
+		<tr>
+		<td class="row1" align="center" valign="middle" rowspan="2"><img
+		src="images/whosonline.gif" alt="${respource.Who_is_Online}" /></td>
+		<td class="row1" align="left" width="100%"><span class="gensmall"><br /><br /></span>
+		</td>
+		</tr>
+		<tr>
+		<td class="row1" align="left"><span class="gensmall"> &nbsp; [ ] &nbsp; [ ]<br /><br /></span></td>
+		</tr>
+		</table>
+		
+		<table width="100%" cellpadding="1" cellspacing="1" border="0">
+		<tr>
+		<td align="left" valign="top"><span class="gensmall">${resource.Online_explain}</span></td>
+		</tr>
+		</table-->
+        
+        <div class="forumlegend">
+            <hr class="forumdashedHR"></hr>
+            <ul>
+                <li>
+                    <img src="${forums:themeURL('resourceForumNewURL')}" alt="${resource.New_posts}" width="11" height="14" />
+                    ${resource.New_posts}
+                </li>
+                <li>
+                    <img src="${forums:themeURL('resourceForumURL')}" alt="${resource.No_new_posts}" width="11" height="14" />
+                     ${resource.No_new_posts}
+                </li>
+                <li>
+                    <img src="${forums:themeURL('resourceForumLockedURL')}" alt="${resource.Forum_is_locked}" width="11" height="14" />
+                    ${resource.Forum_is_locked}
+                </li>
+          </ul>
+        </div>
+        
+        </h:form>
+    </ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,105 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common_decoration.xhtml">
+<ui:define name="content">
+
+	<!-- resourceBundle to be used by this entire application -->
+	<f:loadBundle basename="ResourceJSF" var="resource"/>
+	
+	<!-- display the function tray -->
+    <div class="forumsectionhdr">
+    <ul>
+    
+        <li>
+            <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                ${resource.Home}
+            </h:outputLink>
+        </li>
+
+        <li>
+            &#160;&#160;|&#160;&#160;
+            <h:outputLink value="#{forums:outputLink(shared.links['search'],true)}">Search </h:outputLink>
+        </li>
+        
+        <c:if test="#{shared.anonymous==false &amp;&amp; forums:isRunningInPortal()==false}">
+        <li>
+            &#160;&#160;|&#160;&#160;
+            <h:outputLink value="#{forums:outputLink(shared.links['pref'],true)}">
+                ${resource.Preferences}
+            </h:outputLink>
+        </li>
+        </c:if>
+    
+        <c:if test="#{shared.anonymous==false}">
+        <li>
+            &#160;&#160;|&#160;&#160;
+            <h:outputLink value="#{forums:outputLink(shared.links['myForums'],true)}">
+                ${resource.My_Forums}
+            </h:outputLink>
+        </li>
+        </c:if>
+    
+        <c:if test="#{shared.anonymous==false}">
+        <forums:isAllowed fragment="acl://accessAdminTool">
+        <li>
+            &#160;&#160;|&#160;&#160;
+            <h:outputLink value="#{forums:outputLink(shared.links['admin'],true)}">
+                ${resource.Admin_panel}
+            </h:outputLink>
+        </li>
+        </forums:isAllowed>
+        </c:if>
+        
+    </ul>
+    </div>
+
+    <!-- body of the page -->
+	<c:choose>
+		<c:when test="#{(forums:errorMsg())!=null}">
+			<!-- generic error handling -->
+			<ui:include src="/views/errors/error_body.xhtml"/>
+		</c:when>
+		<c:otherwise>
+			<!-- main content for this page -->
+			<ui:insert name="mainContent"/>
+		</c:otherwise>
+	</c:choose>
+	
+	<!-- footer -->
+    <div class="PoweredBy">${resource.Powered_by}&#160;<a href="http://labs.jboss.com/jbossforums"><img border="0" src="${forums:themeURL('resourceIconForumsLogoURL')}" /></a></div>
+    
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,68 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+<ui:composition>
+
+<c:if test="#{forums:isRunningInPortal()}">
+    <div class="forumscontainer">
+        
+        <!-- style sheet for this application -->
+        <link rel='stylesheet' 
+              type='text/css'
+              href='#{forums:contextPath()}/default_graphics/forums_styles.css'
+              media='screen'/>
+        <ui:insert name="content"/>
+    
+    </div>
+</c:if>
+
+<c:if test="#{forums:isRunningInPortal()==false}">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+        <head>
+            <title><h:outputText value="#{shared.mainPageName}"/></title>
+            <meta http-equiv="Content-Type" content="text/html;"/>
+            <!-- style sheet for this application -->
+            <link rel='stylesheet' 
+                  type='text/css'
+                  href='#{forums:contextPath()}/default_graphics/forums_styles.css'
+                  media='screen'/>
+        </head>
+        <body class="bodyStyle">
+            <div class="forumscontainer">
+                <ui:insert name="content"/>
+            </div>
+        </body>
+    </html>
+</c:if>
+
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,59 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common_decoration.xhtml">
+<ui:define name="content">
+
+	<!-- resourceBundle to be used by this entire application -->
+	<f:loadBundle basename="ResourceJSF" var="resource"/>
+		
+
+	<!-- body of the page -->
+	<c:choose>
+		<c:when test="#{(forums:errorMsg())!=null}">
+			<!-- generic error handling -->
+			<ui:include src="/views/errors/error_body.xhtml"/>
+		</c:when>
+		<c:otherwise>
+			<!-- main content for this page -->
+			<ui:insert name="mainContent"/>
+		</c:otherwise>
+	</c:choose>
+	
+	<!-- footer -->
+    <div class="PoweredBy">${resource.Powered_by}&#160;<a href="http://labs.jboss.com/jbossforums"><img border="0" src="${forums:themeURL('resourceIconForumsLogoURL')}" /></a></div>
+    
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/errors/error_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,67 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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"
+>
+
+<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
+   <tr>
+      <td>
+         <table width="100%" cellspacing="0" cellpadding="1" border="0">
+            <tr>
+               <td>&#160;</td>
+            </tr>
+            <tr>
+               <td align="center">
+                	<h:outputText value="${forums:errorMsg()}. ${resource.Please_try_again}" styleClass="gen"/>               	
+               </td>
+            </tr>
+            <tr>
+               <td>&#160;</td>
+            </tr>
+            <tr>
+               <td align="center">
+                  <h:form>
+                	<h:commandButton type="button" value="${resource.Back}" onclick="javascript:history.back();"/>
+                  </h:form>
+               </td>
+            </tr>
+            <tr>
+               <td>&#160;</td>
+            </tr>
+         </table>
+      </td>
+   </tr>
+</table>
+
+<br clear="all"/>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,921 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+
+<c:if test="#{forum.initialized &amp;&amp; forum.forum!=null &amp;&amp; forum.forum.id!=-1}">
+
+    <!-- make sure the user is allowed to access both the specified forum and the category that this forum belongs to -->
+	<forums:isAllowed fragment="acl://readCategory" contextData="#{forum.forum.category}">
+	<forums:isAllowed fragment="acl://readForum" contextData="#{forum.forum}">
+
+    <div class="forumbread">
+        <ul>
+            <li class="first">
+            
+                <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                    <h:outputText value="#{shared.mainPageName}"/>
+                </h:outputLink>
+                
+                <ul>
+                    <li>&gt; 
+                        <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                            <f:param name="c" value="#{forum.forum.category.id}"/>
+                            <h:outputText value="#{forum.forum.category.title}"/>
+                        </h:outputLink>
+                        
+                        <ul>
+                            <li>&gt; 
+                                <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                                    <f:param name="f" value="#{forum.forum.id}"/>
+                                    <h:outputText value="#{forum.forum.name}"/>
+                                </h:outputLink>
+                            </li>
+                        </ul>
+                        
+                    </li>
+                </ul>
+                
+            </li>
+        </ul>
+    </div>
+
+<h:form>	
+	
+    <div class="forumfloatright">
+
+        <c:if test="${forums:feedsConfigured()}">
+            <!--  feeds -->
+            <a href="#{forum.rssFeed}">
+                <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                RSS
+            </a>
+            &#160;
+            <a href="#{forum.atomFeed}" class="imglink">
+                <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                ATOM
+            </a>
+            &#160;
+        </c:if>
+    
+        <c:if test="#{shared.anonymous==false}">
+            
+            <c:choose>
+                <c:when test="#{forums:isWatchingForum(forum.forum) ne null}">
+                    <h:commandLink action="#{forumWatch.deActivateWatch}">
+                        <f:param name="w" value="#{forums:isWatchingForum(forum.forum)}" />
+                        <img src="#{forums:themeURL('resourceIconUnSubscribeURL')}"
+                             alt="${resource.Unsubscribe_from_forum}"
+                             name="unSubscribe"
+                             border="0"
+                             id="unSubscribe" />
+                    </h:commandLink>
+                </c:when>
+                <c:otherwise>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forumWatch'],true)}">
+                        <f:param name="f" value="${forum.forum.id}" />
+                        <img src="#{forums:themeURL('resourceIconSubscribeURL')}"
+                             alt="${resource.Subscribe_to_forum}"
+                             name="subscribe"
+                             border="0"
+                             id="subscribe" />
+                    </h:outputLink>
+                </c:otherwise>
+            </c:choose>
+        </c:if>
+    </div>
+    
+    <div class="forumtitletext">
+        <input type="hidden" name="f" value="#{forum.forum.id}" />
+        <h4>
+            ${forum.forum.name}
+        </h4>
+    </div>
+    
+    <!-- PAGINATION -->
+    <c:if test="#{forum.pageNavigator.totalPages gt 1}">
+    <div class="forumpagination">
+        <ul>
+            <li class="disablepage">
+                <h:outputFormat value="#{resource.PageNumber}">
+                    <f:param value="${forum.pageNavigator.pageNumber}"/>
+                    <f:param value="${forum.pageNavigator.totalPages}"/>
+                </h:outputFormat>
+            </li>
+            
+            <c:choose>
+                <c:when test="#{forum.pageNavigator.currentPage eq 0}">
+                    <li class="disablepage">
+                        ${resource.First}
+                    </li>
+                    <li class="disablepage">
+                        &#60; ${resource.Previous}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${resource.First}"/>
+                        </h:outputLink>    
+                    </li>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.currentPage-1}"/>
+                            <h:outputText value="&#60; ${resource.Previous}"/>
+                        </h:outputLink>    
+                    </li>
+                </c:otherwise>
+            </c:choose>
+            
+            <c:forEach items="#{forum.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                <li>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="#{forum.forum.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <li class="currentpage">
+                ${forum.pageNavigator.currentPage+1}
+            </li>
+            
+            <c:forEach items="#{forum.pageNavigator.currentPaginationRight}" var="pageNumber">
+                <li>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="#{forum.forum.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <c:choose>
+                <c:when test="#{forum.pageNavigator.currentPage eq (forum.pageNavigator.totalPages-1) }">
+                    <li class="disablepage">
+                        ${resource.Next} &#62;
+                    </li>
+                    <li class="disablepage">
+                        ${resource.Last}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.currentPage+1}"/>
+                            <h:outputText value="${resource.Next} &#62;"/>
+                        </h:outputLink>
+                    </li>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.totalPages-1}"/>
+                            <h:outputText value="${resource.Last}"/>
+                        </h:outputLink>
+                    </li>
+                </c:otherwise>
+            </c:choose>
+        </ul>
+    </div>
+    </c:if>
+
+    <forums:isAllowed fragment="acl://newTopic" contextData="#{forum.forum}">
+    <div class="actionbuttons">
+        <ul>
+            <li>
+                <h:commandLink id="newTopic" action="#{newTopic.start}">
+                    <f:param name="f" value="#{forum.forum.id}"/>
+                    <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
+                        <f:verbatim>
+                            <img border="0"
+                                 src="#{forums:themeURL('resourcePostLockedURL')}"
+                                 alt="${resource.Forum_locked}"/>
+                        </f:verbatim>
+                    </c:if>
+                    <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
+                        <f:verbatim>
+                            <img border="0"
+                                 src="#{forums:themeURL('resourcePostNewURL')}"
+                                 alt="${resource.Post_new_topic}" />
+                        </f:verbatim>
+                    </c:if>
+               </h:commandLink>
+            </li>
+        </ul>
+    </div>
+    </forums:isAllowed>
+    
+    <!-- display the list of topics associated with this forum -->
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+    
+        <tr class="header">
+            <td class="forumheaderfirst" colspan="2">${resource.Topics}</td>
+            <td class="forumheadercentered">${resource.Replies}</td>
+            <td class="forumheadercentered">${resource.Views}</td>
+            <td class="forumheaderlast">${resource.Last_Post}</td>
+        </tr>
+        
+        <c:choose>
+            <c:when test="#{forum.forum.topicCount>0}">
+            <c:if test="#{forum.announcementsPresent}">
+            <!-- Announcement threads -->
+            
+            <tr>
+                <td class="forumspecialized" colspan="5">
+                    <h3>
+                        ${resource.Announcements}
+                    </h3>
+                </td>
+            </tr>
+            
+            <c:forEach items="#{forum.announcements}" var="topicrow" varStatus="status" >
+            <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+                <td class="forumlisticon">
+                    <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" 
+                         width="11" height="14"
+                         alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+                </td>
+                <td>
+                    <h3>
+                        ${forums:folderType(topicrow)}&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="${topicrow.id}"/>
+                            <h:outputText value="${topicrow.subject}"/>                   
+                        </h:outputLink>   
+                    </h3>
+                    
+                    <!-- mini post navigator for this topic -->
+                    <c:if test="#{forum.topicNavigator[topicrow.id] ne null &amp;&amp; forum.topicNavigator[topicrow.id].totalPages gt 1}">
+                        &#160;(&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${1}"/>
+                        </h:outputLink>
+                        &#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="1"/>
+                            <h:outputText value="${2}"/>
+                        </h:outputLink>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+                            &#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="2"/>
+                                <h:outputText value="${3}"/>
+                            </h:outputLink>
+                        </c:if>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                            &#160;&#8230;&#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+                                <h:outputText value="${resource.Last_page}"/>
+                            </h:outputLink>
+                        </c:if>
+                        &#160;)
+                    </c:if>
+                    <br />
+                    ${resource.By}&#160;
+                    <c:choose>
+                        
+                        <c:when test="#{category.anonymous}">
+                            ${topicrow.poster.user.userName}
+                        </c:when>
+                       
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                                <h:outputText value="${topicrow.poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                        
+                </td>
+                <td class="forumlistcentered">${topicrow.replies}</td>
+                <td class="forumlistcentered">${topicrow.viewCount}</td>
+                <td class="forumlistlast">
+                    <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+                        <c:choose>
+                        
+                            <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+                                #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}&#8230;
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{forum.topicLastPosts[topicrow.id].message.subject}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </a>
+                    <br />
+                    ${resource.By} 
+                    <c:choose>
+                    
+                        <c:when test="#{myForum.anonymous}">
+                            ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+                        </c:when>
+                                    
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+                                <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                    <br />
+                    #{forum.topicLastPosts[topicrow.id].createDate}
+                </td>
+            </tr>
+            
+            </c:forEach>
+            </c:if>
+            
+            <c:if test="#{forum.stickyThreadsPresent}">
+            <!-- Sticky Threads -->
+            
+            <tr>
+                <td class="forumspecialized" colspan="5">
+                    <h3>
+                        ${resource.Sticky_Threads}
+                    </h3>
+                </td>
+            </tr>
+            
+            <c:forEach items="#{forum.stickyThreads}" var="topicrow" varStatus="status" >
+            <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+                <td class="forumlisticon">
+                    <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" 
+                         width="11" height="14"
+                         alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+                </td>
+                <td>
+                    <h3>
+                        ${forums:folderType(topicrow)}&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="${topicrow.id}"/>
+                            <h:outputText value="${topicrow.subject}"/>                   
+                        </h:outputLink>   
+                    </h3>
+                    
+                    <!-- mini post navigator for this topic -->
+                    <c:if test="#{forum.topicNavigator[topicrow.id] ne null &amp;&amp; forum.topicNavigator[topicrow.id].totalPages gt 1}">
+                        &#160;(&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${1}"/>
+                        </h:outputLink>
+                        &#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="1"/>
+                            <h:outputText value="${2}"/>
+                        </h:outputLink>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+                            &#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="2"/>
+                                <h:outputText value="${3}"/>
+                            </h:outputLink>
+                        </c:if>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                            &#160;&#8230;&#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+                                <h:outputText value="${resource.Last_page}"/>
+                            </h:outputLink>
+                        </c:if>
+                        &#160;)
+                    </c:if>
+                    <br />
+                    ${resource.By}&#160;
+                    <c:choose>
+                        
+                        <c:when test="#{category.anonymous}">
+                            ${topicrow.poster.user.userName}
+                        </c:when>
+                       
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                                <h:outputText value="${topicrow.poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                        
+                </td>
+                <td class="forumlistcentered">${topicrow.replies}</td>
+                <td class="forumlistcentered">${topicrow.viewCount}</td>
+                <td class="forumlistlast">
+                    <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+                        <c:choose>
+                        
+                            <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+                                #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}&#8230;
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{forum.topicLastPosts[topicrow.id].message.subject}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </a>
+                    <br />
+                    ${resource.By} 
+                    <c:choose>
+                    
+                        <c:when test="#{category.anonymous}">
+                            ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+                        </c:when>
+                                    
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+                                <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                    <br />
+                    #{forum.topicLastPosts[topicrow.id].createDate}
+                </td>
+            </tr>
+
+            </c:forEach>
+            </c:if>
+            
+            <c:if test="#{forum.normalThreadsPresent}">
+            <!-- Normal threads -->
+            <tr>
+                <td class="forumspecialized" colspan="5">
+                    <h3>
+                        ${resource.Normal_Threads}
+                    </h3>
+                </td>
+            </tr>
+            
+            <c:forEach items="#{forum.normalThreads}" var="topicrow" varStatus="status" >
+            <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+                <td class="forumlisticon">
+                    <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" 
+                         width="11" height="14"
+                         alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+                </td>
+                <td>
+                    <h3>
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="${topicrow.id}"/>
+                            <h:outputText value="${topicrow.subject}"/>                   
+                        </h:outputLink>
+                    </h3>
+                    
+                    <!-- mini post navigator for this topic -->
+                    <c:if test="#{forum.topicNavigator[topicrow.id] ne null &amp;&amp; forum.topicNavigator[topicrow.id].totalPages gt 1}">
+                        &#160;(&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${1}"/>
+                        </h:outputLink>
+                        &#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="1"/>
+                            <h:outputText value="${2}"/>
+                        </h:outputLink>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+                            &#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="2"/>
+                                <h:outputText value="${3}"/>
+                            </h:outputLink>
+                        </c:if>
+                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                            &#160;&#8230;&#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+                                <h:outputText value="${resource.Last_page}"/>
+                            </h:outputLink>
+                        </c:if>
+                        &#160;)
+                    </c:if>
+                    <br />
+                    ${resource.By}&#160;
+                    <c:choose>
+                        
+                        <c:when test="#{forum.anonymous}">
+                            ${topicrow.poster.user.userName}
+                        </c:when>
+                       
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                                <h:outputText value="${topicrow.poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                        
+                </td>
+                <td class="forumlistcentered">${topicrow.replies}</td>
+                <td class="forumlistcentered">${topicrow.viewCount}</td>
+                <td class="forumlistlast">
+                    <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+                        <c:choose>
+                        
+                            <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+                                #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}&#8230;
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{forum.topicLastPosts[topicrow.id].message.subject}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </a>
+                    <br />
+                    ${resource.By} 
+                    <c:choose>
+                    
+                        <c:when test="#{category.anonymous}">
+                            ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+                        </c:when>
+                                    
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+                                <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                    <br />
+                    #{forum.topicLastPosts[topicrow.id].createDate}
+                </td>
+            </tr>
+
+            </c:forEach>
+            </c:if>
+            
+            </c:when>
+            
+            <c:otherwise>
+            <tr>
+                <td class="nonewpostRow" colspan="6">
+                    <h3>
+                        <h:outputText value="#{resource['No_topics_post_one']}" escape="false" />
+                    </h3>
+                </td>
+            </tr>
+	        </c:otherwise>
+        </c:choose>      
+    </table>
+    
+    <!-- PAGINATION -->
+    <c:if test="#{forum.pageNavigator.totalPages gt 1}">
+    <div class="forumpagination">
+        <ul>
+            <li class="disablepage">
+                <h:outputFormat value="#{resource.PageNumber}">
+                    <f:param value="${forum.pageNavigator.pageNumber}"/>
+                    <f:param value="${forum.pageNavigator.totalPages}"/>
+                </h:outputFormat>
+            </li>
+            
+            <c:choose>
+                <c:when test="#{forum.pageNavigator.currentPage eq 0}">
+                    <li class="disablepage">
+                        ${resource.First}
+                    </li>
+                    <li class="disablepage">
+                        &#60; ${resource.Previous}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${resource.First}"/>
+                        </h:outputLink>    
+                    </li>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.currentPage-1}"/>
+                            <h:outputText value="&#60; ${resource.Previous}"/>
+                        </h:outputLink>    
+                    </li>
+                </c:otherwise>
+            </c:choose>
+            
+            <c:forEach items="#{forum.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                <li>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="#{forum.forum.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <li class="currentpage">
+                ${forum.pageNavigator.currentPage+1}
+            </li>
+            
+            <c:forEach items="#{forum.pageNavigator.currentPaginationRight}" var="pageNumber">
+                <li>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="#{forum.forum.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <c:choose>
+                <c:when test="#{forum.pageNavigator.currentPage eq (forum.pageNavigator.totalPages-1) }">
+                    <li class="disablepage">
+                        ${resource.Next} &#62;
+                    </li>
+                    <li class="disablepage">
+                        ${resource.Last}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.currentPage+1}"/>
+                            <h:outputText value="${resource.Next} &#62;"/>
+                        </h:outputLink>
+                    </li>
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="page" value="${forum.pageNavigator.totalPages-1}"/>
+                            <h:outputText value="${resource.Last}"/>
+                        </h:outputLink>
+                    </li>
+                </c:otherwise>
+            </c:choose>
+        </ul>
+    </div>
+    </c:if>
+    
+    <!-- NEWTOPIC -->
+    <forums:isAllowed fragment="acl://newTopic" contextData="#{forum.forum}">
+    <div class="actionbuttons">
+        <ul>
+            <li>
+                <h:commandLink id="newTopic" action="#{newTopic.start}">
+                    <f:param name="f" value="#{forum.forum.id}"/>
+                    <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
+                        <f:verbatim>
+                            <img border="0"
+                                 src="#{forums:themeURL('resourcePostLockedURL')}"
+                                 alt="${resource.Forum_locked}"/>
+                        </f:verbatim>
+                    </c:if>
+                    <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
+                        <f:verbatim>
+                            <img border="0"
+                                 src="#{forums:themeURL('resourcePostNewURL')}"
+                                 alt="${resource.Post_new_topic}" />
+                        </f:verbatim>
+                    </c:if>
+               </h:commandLink>
+            </li>
+        </ul>
+    </div>
+    </forums:isAllowed>
+    
+    <!-- MODERATION -->
+    <c:if test="#{shared.anonymous==false}">
+    <forums:isAllowed fragment="acl://moderateForum" contextData="#{forum.forum}">
+    <div class="modtools">
+        <ul>
+            <li>
+                ${resource.Forum_moderation}:
+            </li>
+            <li>
+                <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                    <f:param name="f" value="#{forum.forum.id}"/>
+                    <f:verbatim>
+                        <img src="${forums:themeURL('resourceIconModerateURL')}" alt="${resource.Moderate}" border="0" />
+                    </f:verbatim>
+                </h:outputLink>
+            </li>
+        </ul>
+    </div>
+    </forums:isAllowed>
+    </c:if>
+    
+    <!-- ADMINISTRATION -->
+    <c:if test="#{shared.anonymous==false}">
+    <forums:isAllowed fragment="acl://lockForums" contextData="#{forum.forum}" >
+    <div class="admintools">
+        <ul>
+            <li>${resource.Forum_administration}:</li>
+            <li>
+                <c:choose>
+                
+                    <c:when test="#{forum.forum.status eq forums:constantInt('FORUM_LOCKED')}">
+                        <h:commandLink action="#{adminController.unlockForum}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="c" value="#{forum.forum.category.id}"/>
+                            <f:verbatim>
+                                <img src="${forums:themeURL('resourceIconUnlockURL')}" alt="${resource.Forum_unlock}" border="0"/>
+                            </f:verbatim>
+                        </h:commandLink>
+                    </c:when>
+                    
+                    <c:otherwise>
+                        <h:commandLink action="#{adminController.lockForum}">
+                            <f:param name="f" value="#{forum.forum.id}"/>
+                            <f:param name="c" value="#{forum.forum.category.id}"/>
+                            <f:verbatim>
+                                <img src="${forums:themeURL('resourceIconLockURL')}" alt="${resource.Forum_lock}" border="0"/>
+                            </f:verbatim>
+                        </h:commandLink>
+                    </c:otherwise>
+                
+                </c:choose>
+            </li>
+        </ul>
+    </div>
+    </forums:isAllowed>
+    </c:if>
+        
+
+    <hr class="forumdashedHR" />
+        <div class="forumthreadlegend">
+            <ul>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderNewURL')}"
+                         alt="${resource.New_posts}" width="11" height="14" />
+                    ${resource.New_posts}
+                </li>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderHotNewURL')}"
+                         alt="${resource.New_posts_hot}" width="11" height="14" />
+                    ${resource.New_posts_hot}
+                </li>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderLockedNewURL')}"
+                         alt="${resource.New_posts_locked}" width="11" height="14" />
+                    ${resource.New_posts_locked}
+                </li>
+            </ul>
+        </div>
+        <div class="forumthreadlegend">
+            <ul>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderURL')}"
+                         alt="${resource.No_new_posts}" width="11" height="14" />
+                    ${resource.No_new_posts}
+                </li>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderHotURL')}"
+                         alt="${resource.No_new_posts_hot}" width="11" height="14" />
+                    ${resource.No_new_posts_hot}
+                </li>
+                <li>
+                    <img src="#{forums:themeURL('resourceFolderLockedURL')}"
+                         alt="${resource.No_new_posts_locked}" width="11" height="14" />
+                    ${resource.No_new_posts_locked}
+                </li>
+            </ul>
+        </div>
+        <div class="forumthreadlegendtext">
+
+            <!-- post new topics link -->
+            <forums:isAllowedChoose>
+                <forums:isAllowedWhen fragment="acl://newTopic">
+                    <h:outputText value="#{resource['Rules_post_can']}" escape="false" />
+                </forums:isAllowedWhen>
+                <forums:isAllowedOtherwise>
+                    <h:outputText value="#{resource['Rules_post_cannot']}" escape="false" />
+                </forums:isAllowedOtherwise>
+            </forums:isAllowedChoose>
+            <br/>
+
+            <!-- manage poll link -->
+            <forums:isAllowedChoose>
+                <forums:isAllowedWhen fragment="acl://managePoll">
+                    <h:outputText value="#{resource['Rules_poll_can']}" escape="false" />
+                </forums:isAllowedWhen>
+                <forums:isAllowedOtherwise>
+                    <h:outputText value="#{resource['Rules_poll_cannot']}" escape="false" />
+                </forums:isAllowedOtherwise>
+            </forums:isAllowedChoose>
+            <br/>
+
+            <!-- votePoll link -->
+            <forums:isAllowedChoose>
+                <forums:isAllowedWhen fragment="acl://votePoll">
+                    <h:outputText value="#{resource['Rules_vote_can']}" escape="false" />
+                </forums:isAllowedWhen>
+                <forums:isAllowedOtherwise>
+                    <h:outputText value="#{resource['Rules_vote_cannot']}" escape="false" />
+                </forums:isAllowedOtherwise>
+            </forums:isAllowedChoose>
+            <br/>
+
+            <!-- moderate forum link -->
+            <forums:isAllowedChoose>
+                <forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{forum.forum}">
+                    <h:outputText value="#{resource['Rules_moderate_0']}" escape="false" /><h:outputText value="#{resource['Rules_moderate_2']}" escape="false" />
+                </forums:isAllowedWhen>
+                <forums:isAllowedOtherwise>
+                    <h:outputText value="#{resource['Rules_moderate_1']}" escape="false" /><h:outputText value="#{resource['Rules_moderate_2']}" escape="false" />
+                </forums:isAllowedOtherwise>
+            </forums:isAllowedChoose>
+            <br/>
+
+        </div>
+        
+    </h:form>
+    
+    <div class="forumlegendjumpboxclear">
+        <ui:include src="/views/jumpbox.xhtml" />
+    </div>
+    
+    </forums:isAllowed>
+    </forums:isAllowed>
+	</c:if>
+    
+    <c:if test="#{forum.forum==null}">
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.Forum_not_exist}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </c:if>
+
+
+</ui:define>
+</ui:composition>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/index.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/index.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/index.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,46 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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"
+      class="forumscontainer"
+>
+
+<ui:composition>
+<c:if test="#{summary.initialized}">
+	<c:if test="#{summary.numberOfTopicsFound>0}">
+		<ui:include src="/views/summary/viewsummary_body.xhtml"/>
+	</c:if>
+		
+	<c:if test="#{summary.numberOfTopicsFound==0}">
+		<ui:include src="/views/category/viewcategory_body.xhtml"/>
+	</c:if>
+</c:if>
+</ui:composition>
+
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/jumpbox.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/jumpbox.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/jumpbox.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,84 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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">
+    
+    
+    <form method="post" name="jumpbox"
+          action="#{forums:outputLink(shared.links['forum'],true)}"
+          onsubmit="if(document.jumpbox.identifier.value == 0){return false;}">
+          
+        ${resource.Jump_to}:&#160;
+        <select name="identifier"
+                onchange="if(this.options[this.selectedIndex].value != 0)
+                          {
+                              if (this.options[this.selectedIndex].value > 0)
+                              {
+                                  forms['jumpbox'].action='#{forums:outputLink(shared.links['forum'],true)}';
+                                  this.name='f';
+                              }
+                              else 
+                              {
+                                  forms['jumpbox'].action='#{forums:outputLink(shared.links['category'],true)}';
+                                  this.options[this.selectedIndex].value=-(this.options[this.selectedIndex].value);
+                                  this.name='c';
+                              }
+                              forms['jumpbox'].submit();
+                          }">
+                
+            <option value="0">${resource.Select_forum}</option>
+            
+                <c:forEach items="${jumpbox.categories}"
+                           var="category">
+                <forums:isAllowed fragment="acl://readCategory" contextData="#{category}">
+                
+                    <option value="0"></option>
+                    <option value="-${category.id}">${category.title}</option>
+                    <option value="0">----------------</option>
+                    
+                    <c:forEach items="${category.forums}"
+                               var="forum">
+                    <forums:isAllowed fragment="acl://readForum" contextData="#{forum}">
+
+                        <option value="${forum.id}">
+                            ${forum.name}
+                        </option>
+                        
+                    </forums:isAllowed>
+                    </c:forEach>
+                    
+                </forums:isAllowed>
+                </c:forEach>
+                
+            </select>
+        &#160;
+        <input type="submit" value="${resource.Go}" class="buttonMed"/>
+    </form>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topic.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topic.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topic.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,133 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<forums:isAllowedChoose>
+<forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{moderator.forum}">
+<c:choose>
+
+    <c:when test="#{topic.initialized &amp;&amp; topic.topic!=null &amp;&amp; topic.topic.id!=-1}">
+    <div class="dialog">
+    <table cellpadding="0" cellspacing="0" border="0" width="100%">
+        <tr>
+            <td class="icon">
+                <img src="#{forums:themeURL('resourceIconDialogWarningURL')}" border="0" />
+            </td>
+            <td class="title" width="100%">
+                ${resource.Delete_topic}
+            </td>
+        </tr>
+        <tr>
+            <td class="icon"></td>
+            <td>
+                <h:outputFormat value="#{resource.Topic_deletion_info}">
+                    <f:param value="#{topic.topic.subject}"/>
+                    <f:param value="#{topic.topic.replies+1}"/>
+                </h:outputFormat>
+            </td>
+        </tr>
+        <tr>
+            <td class="buttons" colspan="2">
+                <h:form>
+                    <input type="hidden" name="f" value="#{moderator.forum.id}"/>
+                    <h:commandButton type="submit"
+                                     value="${resource.Yes}"
+                                     styleClass="buttonMed"
+                                     action="#{moderator.deleteTopic}">
+                        <f:param name="f" value="#{moderator.forum.id}"/> 
+                    </h:commandButton>
+                    <h:commandButton type="button"
+                                     value="${resource.No}"
+                                     styleClass="buttonMed"
+                                     onclick="javascript:history.back();">
+                        <f:param name="f" value="#{moderator.forum.id}"/> 
+                    </h:commandButton>
+                </h:form>
+            </td>
+        </tr>
+    </table>
+    </div>
+    </c:when>
+    
+    <c:otherwise>
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.Not_Moderator}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </c:otherwise>
+    
+</c:choose>
+</forums:isAllowedWhen>
+<forums:isAllowedOtherwise>
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td>
+                <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                    <tr>
+                        <td align="center">
+                            ${resource.Not_Moderator}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</forums:isAllowedOtherwise>
+</forums:isAllowedChoose>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topics.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topics.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/delete_topics.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,137 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<forums:isAllowedChoose>
+<forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{moderator.forum}">
+<c:choose>
+
+    <c:when test="#{moderator.anyCheckboxSelected &amp;&amp; moderator.forum!=null &amp;&amp; moderator.forum.id!=-1}">
+    <div class="dialog">
+    <table cellpadding="0" cellspacing="0" border="0" width="100%">
+        <tr>
+            <td class="icon">
+                <img src="#{forums:themeURL('resourceIconDialogWarningURL')}" border="0" />
+            </td>
+            <td class="title" width="100%">
+                ${resource.Topic_delete_confirm}
+            </td>
+        </tr>
+        <tr>
+            <td class="icon"></td>
+            <td>
+                ${resource.Confirm_delete_topic}
+                <br /><br />
+                ${resource.Topics_to_deletion}
+                <br />
+                <c:forEach items="#{moderator.allSelectedTopics}" var="topicrow">
+                #{topicrow.subject}<br />
+                </c:forEach>
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td class="buttons" colspan="2">
+                <h:form>
+                    <input type="hidden" name="f" value="#{moderator.forum.id}"/>
+                    <h:commandButton type="submit"
+                                     value="${resource.Yes}"
+                                     styleClass="buttonMed"
+                                     action="#{moderator.deleteTopic}">
+                        <f:param name="f" value="#{moderator.forum.id}"/> 
+                    </h:commandButton>
+                    <h:commandButton type="button"
+                                     value="${resource.No}"
+                                     styleClass="buttonMed"
+                                     onclick="javascript:history.back();">
+                        <f:param name="f" value="#{moderator.forum.id}"/> 
+                    </h:commandButton>
+                </h:form>
+            </td>
+        </tr>
+    </table>
+    </div>
+    </c:when>
+    
+    <c:otherwise>
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.Not_Moderator}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </c:otherwise>
+    
+</c:choose>
+</forums:isAllowedWhen>
+<forums:isAllowedOtherwise>
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td>
+                <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                    <tr>
+                        <td align="center">
+                            ${resource.Not_Moderator}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</forums:isAllowedOtherwise>
+</forums:isAllowedChoose>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,389 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<c:if test="#{moderator.initialized &amp;&amp; moderator.forum!=null &amp;&amp; moderator.forum.id!=-1}">
+<forums:isAllowedChoose>
+
+    <forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{moderator.forum}">
+        
+        <h:form>
+        <input type="hidden" name="f" value="#{moderator.forum.id}"/>
+        <div class="forumbread">
+            <ul>
+                <li class="first">
+                
+                    <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                        <h:outputText value="#{shared.mainPageName}"/>
+                    </h:outputLink>
+                    
+                    <ul>
+                        <li>&gt; 
+                            <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                                <f:param name="c" value="#{moderator.forum.category.id}"/>
+                                <h:outputText value="#{moderator.forum.category.title}"/>
+                            </h:outputLink>
+                            
+                            <ul>
+                                <li>&gt; 
+                                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                                        <f:param name="f" value="#{moderator.forum.id}"/>
+                                        <h:outputText value="#{moderator.forum.name}"/>
+                                    </h:outputLink>
+                                    
+                                    <ul>
+                                        <li>&gt; 
+                                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                                <h:outputText value="${resource.Mod_CP}"/>
+                                            </h:outputLink>
+                                        </li>
+                                    </ul>
+                                </li>
+                            </ul>
+                            
+                        </li>
+                    </ul>
+                    
+                </li>
+            </ul>
+        </div>
+        
+        <!-- Forum moderator tool title and usability explanation and feedback messages -->
+        <div class="forumtitletext">
+            <h4>${resource.Mod_CP}</h4>
+            <p>${resource.Mod_CP_explain}</p>
+            <!-- <p class="successtext">
+                <h:messages layout="table" infoStyle="color:green" warnStyle="color:red"/>
+            </p>-->
+        </div>
+        
+        <!-- PAGINATION -->
+        <c:if test="#{moderator.pageNavigator.totalPages gt 1}">
+        <div class="forumpagination">
+            <ul>
+                <li class="disablepage">
+                    <h:outputFormat value="#{resource.PageNumber}">
+                        <f:param value="${moderator.pageNavigator.pageNumber}"/>
+                        <f:param value="${moderator.pageNavigator.totalPages}"/>
+                    </h:outputFormat>
+                </li>
+                
+                <c:choose>
+                    <c:when test="#{moderator.pageNavigator.currentPage eq 0}">
+                        <li class="disablepage">
+                            ${resource.First}
+                        </li>
+                        <li class="disablepage">
+                            &#60; ${resource.Previous}
+                        </li>
+                    </c:when>
+                    <c:otherwise>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{modaerator.forum.id}"/>
+                                <f:param name="page" value="0"/>
+                                <h:outputText value="${resource.First}"/>
+                            </h:outputLink>    
+                        </li>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.currentPage-1}"/>
+                                <h:outputText value="&#60; ${resource.Previous}"/>
+                            </h:outputLink>    
+                        </li>
+                    </c:otherwise>
+                </c:choose>
+                
+                <c:forEach items="#{moderator.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                            <f:param name="f" value="#{moderator.forum.id}"/>
+                            <f:param name="page" value="${pageNumber-1}"/>
+                            <h:outputText value="${pageNumber}"/>
+                        </h:outputLink>  
+                    </li>
+                </c:forEach>
+                
+                <li class="currentpage">
+                    ${moderator.pageNavigator.currentPage+1}
+                </li>
+                
+                <c:forEach items="#{moderator.pageNavigator.currentPaginationRight}" var="pageNumber">
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                            <f:param name="f" value="#{moderator.forum.id}"/>
+                            <f:param name="page" value="${pageNumber-1}"/>
+                            <h:outputText value="${pageNumber}"/>
+                        </h:outputLink>  
+                    </li>
+                </c:forEach>
+                
+                <c:choose>
+                    <c:when test="#{moderator.pageNavigator.currentPage eq (moderator.pageNavigator.totalPages-1) }">
+                        <li class="disablepage">
+                            ${resource.Next} &#62;
+                        </li>
+                        <li class="disablepage">
+                            ${resource.Last}
+                        </li>
+                    </c:when>
+                    <c:otherwise>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.currentPage+1}"/>
+                                <h:outputText value="${resource.Next} &#62;"/>
+                            </h:outputLink>
+                        </li>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.totalPages-1}"/>
+                                <h:outputText value="${resource.Last}"/>
+                            </h:outputLink>
+                        </li>
+                    </c:otherwise>
+                </c:choose>
+            </ul>
+        </div>
+        </c:if>
+        
+        
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        
+            <tr class="header">
+                <td class="forumheaderfirst">&#160;</td>
+                <td class="tableheader">&#160;${resource.Topics}&#160;</td>
+                <td class="tableheader">&#160;${resource.Replies}&#160;</td>
+                <td class="tableheader">&#160;${resource.Last_Post}&#160;</td>
+                <td class="forumheadernarrow">&#160;${resource.Select}&#160;</td>
+            </tr>
+            
+            <c:forEach items="#{moderator.page}" var="topicrow" varStatus="status">
+            <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+            
+                <td class='rowlinefirst ${(status.last)?"bottomline":""}' width="20px" align="center">
+                    <img src="#{forums:folderTypeURL(topicrow,moderator.anonymous)}"
+                         alt="${resource.Topic_Moved}"
+                         title="${resource.Topic_Moved}"/>
+                </td>
+                
+                <td class='rowline ${(status.last)?"bottomline":""}'>
+                    ${forums:folderType(topicrow)}&#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="${topicrow.id}"/>
+                        <h:outputText value="${topicrow.subject}"/>
+                    </h:outputLink>
+                </td>
+                <td class='rowline ${(status.last)?"bottomline":""} forumheadercentered' width="30px">
+                    ${topicrow.replies}
+                </td>
+                <td class='rowline ${(status.last)?"bottomline":""}' width="150px">
+                    ${topicrow.lastPostDate}
+                </td>
+                <td class='rowline ${(status.last)?"bottomline":""}' width="30px">
+                    <h:selectBooleanCheckbox value="#{moderator.checkboxes[topicrow.id]}"/>
+                </td>
+            </tr>
+            </c:forEach>
+            
+            <tr align="right">
+                <td class="buttonrow" colspan="5" height="29" style="border-bottom: 0px none;">
+                    <forums:isAllowed fragment="acl://deleteTopics" contextData="#{moderator.forum}">
+                    <h:commandButton action="#{moderator.deleteConfirm}"
+                                     class="buttonMed"
+                                     value="${resource.Delete}">
+                        <f:param name="f" value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                    </forums:isAllowed>
+                    <forums:isAllowed fragment="acl://moveTopics" contextData="#{moderator.forum}">
+                    <h:commandButton action="#{moderator.moveConfirm}"
+                                     class="buttonMed"
+                                     value="${resource.Move}">
+                       <f:param name="f" value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                    </forums:isAllowed>
+                    <forums:isAllowed fragment="acl://lockTopics" contextData="#{moderator.forum}">
+                    <h:commandButton action="#{moderator.lockTopic}"
+                                     class="buttonMed"
+                                     value="${resource.Lock}">
+                       <f:param name="f"
+                                value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                    <h:commandButton action="#{moderator.unlockTopic}"
+                                     class="buttonMed"
+                                     value="${resource.Unlock}">
+                       <f:param name="f" value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                    </forums:isAllowed>
+                </td>
+            </tr>
+        </table>
+        
+        <!-- PAGINATION -->
+        <c:if test="#{moderator.pageNavigator.totalPages gt 1}">
+        <div class="forumpagination">
+            <ul>
+                <li class="disablepage">
+                    <h:outputFormat value="#{resource.PageNumber}">
+                        <f:param value="${moderator.pageNavigator.pageNumber}"/>
+                        <f:param value="${moderator.pageNavigator.totalPages}"/>
+                    </h:outputFormat>
+                </li>
+                
+                <c:choose>
+                    <c:when test="#{moderator.pageNavigator.currentPage eq 0}">
+                        <li class="disablepage">
+                            ${resource.First}
+                        </li>
+                        <li class="disablepage">
+                            &#60; ${resource.Previous}
+                        </li>
+                    </c:when>
+                    <c:otherwise>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{modaerator.forum.id}"/>
+                                <f:param name="page" value="0"/>
+                                <h:outputText value="${resource.First}"/>
+                            </h:outputLink>    
+                        </li>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.currentPage-1}"/>
+                                <h:outputText value="&#60; ${resource.Previous}"/>
+                            </h:outputLink>    
+                        </li>
+                    </c:otherwise>
+                </c:choose>
+                
+                <c:forEach items="#{moderator.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                            <f:param name="f" value="#{moderator.forum.id}"/>
+                            <f:param name="page" value="${pageNumber-1}"/>
+                            <h:outputText value="${pageNumber}"/>
+                        </h:outputLink>  
+                    </li>
+                </c:forEach>
+                
+                <li class="currentpage">
+                    ${moderator.pageNavigator.currentPage+1}
+                </li>
+                
+                <c:forEach items="#{moderator.pageNavigator.currentPaginationRight}" var="pageNumber">
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                            <f:param name="f" value="#{moderator.forum.id}"/>
+                            <f:param name="page" value="${pageNumber-1}"/>
+                            <h:outputText value="${pageNumber}"/>
+                        </h:outputLink>  
+                    </li>
+                </c:forEach>
+                
+                <c:choose>
+                    <c:when test="#{moderator.pageNavigator.currentPage eq (moderator.pageNavigator.totalPages-1) }">
+                        <li class="disablepage">
+                            ${resource.Next} &#62;
+                        </li>
+                        <li class="disablepage">
+                            ${resource.Last}
+                        </li>
+                    </c:when>
+                    <c:otherwise>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.currentPage+1}"/>
+                                <h:outputText value="${resource.Next} &#62;"/>
+                            </h:outputLink>
+                        </li>
+                        <li>
+                            <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+                                <f:param name="f" value="#{moderator.forum.id}"/>
+                                <f:param name="page" value="${moderator.pageNavigator.totalPages-1}"/>
+                                <h:outputText value="${resource.Last}"/>
+                            </h:outputLink>
+                        </li>
+                    </c:otherwise>
+                </c:choose>
+            </ul>
+        </div>
+        </c:if>
+        
+        <hr class="forumdashedHR" />
+        
+        <table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+                <td align="right">
+                    <ui:include src="/views/jumpbox.xhtml"/>
+                </td>
+            </tr>
+        </table>
+        
+        </h:form>
+        
+    </forums:isAllowedWhen>
+    
+    <forums:isAllowedOtherwise>
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.Not_Moderator}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+        
+    </forums:isAllowedOtherwise>
+
+</forums:isAllowedChoose>
+</c:if>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_move.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_move.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_move.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,139 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<forums:isAllowedChoose>
+<forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{moderator.forum}">
+<h:form>
+    <input type="hidden" name="f" value="#{moderator.forum.id}"/>
+    <div class="dialog">
+        <table cellpadding="0" cellspacing="0" border="0" width="100%">
+            <tr>
+                <td class="icon">
+                    <img src="#{forums:themeURL('resourceIconDialogWarningURL')}" border="0" />
+                </td>
+                <td class="title" width="100%">
+                    ${resource.Topic_move_confirm}<br /><br />
+                </td>
+            </tr>
+            <tr>
+                <td class="icon"></td>
+                <td>
+                    ${resource.Move_to_forum}<br /><br />
+                </td>
+            </tr>
+            <tr>
+                <td class="icon"></td>
+                <td>
+                    <select name="forum_to_id">
+                        <option value="-1">${resource.Select_forum}</option>
+                        <c:forEach items="${jumpbox.categories}"
+                                   var="category">
+                            <forums:isAllowed fragment="acl://readCategory" 
+                                              contextData="#{category}">
+                            <option value="-1"></option>
+                            <option value="-1">${category.title}</option>
+                            <option value="-1">----------------</option>
+                            <c:forEach items="${category.forums}"
+                                       var="forum">
+                                <forums:isAllowed fragment="acl://newTopic" 
+                                                  contextData="#{forum}">
+                                <option value="${forum.id}">
+                                    ${forum.name}
+                                </option>
+                                </forums:isAllowed>
+                            </c:forEach>
+                            </forums:isAllowed>
+                        </c:forEach>
+                    </select>
+                    <br /><br />
+                </td>
+            </tr>
+            <!-- TODO: FUTURE FEATURE: SHADOW NOT AVAILABLE-->
+            <!--<input type="checkbox" name="move_leave_shadow" checked="checked"DISABLED/>${resource.Leave_shadow_topic}[N/A yet...]<br /> -->
+            <tr>
+                <td class="icon"></td>
+                <td>
+                    ${resource.Confirm_move_topic}
+                    <br /><br />
+                    <c:forEach items="#{moderator.allSelectedTopics}" var="topicrow">
+                    #{topicrow.subject}<br />
+                    </c:forEach>
+                    <br />
+                </td>
+            </tr>
+            <tr>
+                <td class="buttons" colspan="2">
+                    <h:commandButton type="submit" value="${resource.Move}"
+                                     styleClass="buttonMed"
+                                     action="#{moderator.moveTopic}">
+                        <f:param name="f"
+                                 value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                    <h:commandButton type="button" value="${resource.Cancel}"
+                                     styleClass="buttonMed"
+                                     onclick="javascript:history.back();">
+                        <f:param name="f"
+                                 value="#{moderator.forum.id}"/>
+                    </h:commandButton>
+                </td>
+            </tr>
+        </table>
+    </div>
+</h:form>
+</forums:isAllowedWhen>
+<forums:isAllowedOtherwise>
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td>
+                <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                    <tr>
+                        <td align="center">
+                            ${resource.Not_Moderator}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</forums:isAllowedOtherwise>
+</forums:isAllowedChoose>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,294 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:choose> 
+<c:when test="#{splitTopic.initialized &amp;&amp; splitTopic.topic!=null &amp;&amp; splitTopic.topic.id!=-1}">
+
+<forums:isAllowedChoose>
+
+<forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{splitTopic.topic.forum}">
+
+<h:form>
+    <input type="hidden" name="t" value="#{splitTopic.topic.id}"/>
+    <div class="forumbread">
+        <ul>
+            <li class="first">
+            
+                <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                    <h:outputText value="#{shared.mainPageName}"/>
+                </h:outputLink>
+                
+                <ul>
+                    <li>&gt; 
+                        <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                            <f:param name="c" value="#{splitTopic.topic.forum.category.id}"/>
+                            <h:outputText value="#{splitTopic.topic.forum.category.title}"/>
+                        </h:outputLink>
+                        
+                        <ul>
+                            <li>&gt; 
+                                <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                                    <f:param name="f" value="#{splitTopic.topic.forum.id}"/>
+                                    <h:outputText value="#{splitTopic.topic.forum.name}"/>
+                                </h:outputLink>
+                                
+                                <ul>
+                                    <li>&gt; 
+                                        <h:outputLink value="#{forums:outputLink(shared.links['topicSplit'],true)}">
+                                            <f:param name="t" value="#{splitTopic.topic.id}"/>
+                                            <h:outputText value="${resource.L_SPLIT_TOPIC}"/>
+                                        </h:outputLink>
+                                    </li>
+                                </ul>
+                                
+                            </li>
+                        </ul>
+                        
+                    </li>
+                </ul>
+                
+            </li>
+        </ul>
+    </div>
+    
+    <!-- Topic split title and usability explanation and feedback messages -->
+    <div class="forumtitletext">
+        <h4>${resource.L_SPLIT_TOPIC}</h4>
+        <p class="successtext">
+            <h:messages layout="table" infoStyle="color:green" warnStyle="color:red"/>
+        </p>
+    </div>
+       
+    <table width="100%" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr class="oddRow">
+            <td colspan="2">${resource.L_SPLIT_TOPIC_EXPLAIN}</td>
+        </tr>
+        <tr class="header">
+            <td class="forumheaderfirst" colspan="2">${resource.L_SPLIT_DESTINATION}</td>
+        </tr>
+        <tr>
+            <td>
+                <label class="forumformlabelbold" for="topic_name">${resource.L_SPLIT_SUBJECT}</label>
+            </td>
+            <td>
+                <h:inputText size="35" style="width: 350px" maxlength="60" id="topic_name"
+                             value="#{splitTopic.newTopicTitle}"/>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label class="forumformlabelbold" for="forum_to_id">${resource.L_SPLIT_FORUM}</label>
+            </td>
+            <td>         
+                <select name="forum_to_id">
+                    <option value="-1">${resource.Select_forum}</option>
+                    <c:forEach items="${jumpbox.categories}"
+                               var="category">
+                        <forums:isAllowed fragment="acl://readCategory" 
+                                          contextData="#{category}">
+                        <option value="-1"></option>
+                        <option value="-1">${category.title}</option>
+                        <option value="-1">----------------</option>
+                        <c:forEach items="${category.forums}"
+                                   var="forum">
+                            <forums:isAllowed fragment="acl://newTopic" 
+                                              contextData="#{forum}">
+                            <option value="${forum.id}">
+                                ${forum.name}
+                            </option>
+                            </forums:isAllowed>
+                        </c:forEach>
+                        </forums:isAllowed>
+                    </c:forEach>
+                </select>
+            </td>
+        </tr>
+    </table>
+    <br />
+    
+    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td colspan="3" class="buttonrow">
+                <h:commandButton action="${splitTopic.splitPosts}"
+                                 type="submit"
+                                 class="buttonMed"
+                                 value="${resource.L_SPLIT_POSTS}">
+                    <f:param name="t" value="#{splitTopic.topic.id}"/>
+                </h:commandButton>
+                <h:commandButton action="${splitTopic.splitAfter}"
+                                 type="submit"
+                                 class="buttonMed" 
+                                 value="${resource.L_SPLIT_AFTER}">
+                    <f:param name="t" value="#{splitTopic.topic.id}"/>
+                </h:commandButton>
+            </td>
+        </tr>
+        <tr class="header">
+            <td class="forumheaderfirst">${resource.L_AUTHOR}</td>
+            <td class="tableheader">${resoure.L_MESSAGE}</td>
+            <td class="forumheaderopen">${resource.L_SELECT}</td>
+        </tr>
+        
+        <c:forEach items="#{splitTopic.topic.posts}" var="postrow" varStatus="status" >
+        <tr class="oddRow">
+            <td class="forumpostleftcolumn">
+                <c:choose>
+                    
+                    <c:when test="#{splitTopic.anonymous}">
+                        ${postrow.poster.user.userName}
+                    </c:when>
+                    
+                    <c:otherwise>
+                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid" value="${postrow.poster.user.id}"/>
+                            <h:outputText value="${postrow.poster.user.userName}"/>
+                        </h:outputLink>
+                    </c:otherwise>
+                    
+                </c:choose>
+            </td>
+            <td class="forumpostspacer">                            
+                <div class="forumpostinfo">
+                    <ul>
+                        <li>
+                            <a name="${postrow.id}" />
+                            <h:outputLink value="#{forums:postPermlink(postrow.id)}" style="text-decoration: none;">
+                                <f:verbatim>
+                                    <h:outputText value="${resource.Permalink}"/>
+                                </f:verbatim>
+                            </h:outputLink>
+                        </li>
+                        <li>${resource.L_POSTED}:#{forums:dateStr(postrow.createDate)}</li>
+                        <li>${resource.L_POST_SUBJECT}:${postrow.message.subject}</li>
+                    </ul>
+                </div>
+            </td>
+            <td class="forumpostspacer"></td>
+        </tr>
+        <tr>
+            <td class="forumpostleftcolumn"> </td>
+            <td class="forumpostcontent">
+                <p>
+                    <h:outputText value="#{forums:formatMessage(postrow.message.text,false)}" escape="false" />
+                    <br /><br />
+                    ${forums:userProperty(postrow.poster.user,'INFO_USER_SIGNATURE')}
+                </p>
+            </td>
+            <td width="5%" align="center" class="forumpostcontent">
+                <h:selectBooleanCheckbox value="${splitTopic.checkboxes[postrow.id]}"/>
+            </td>
+        </tr>
+        </c:forEach>
+        
+        <tr>
+            <td colspan="3" class="buttonrow">
+                <h:commandButton action="${splitTopic.splitPosts}"
+                                 type="submit"
+                                 class="buttonMed"
+                                 value="${resource.L_SPLIT_POSTS}">
+                    <f:param name="t" value="#{splitTopic.topic.id}"/>
+                </h:commandButton>
+                <h:commandButton action="${splitTopic.splitAfter}"
+                                 type="submit"
+                                 class="buttonMed" 
+                                 value="${resource.L_SPLIT_AFTER}">
+                    <f:param name="t" value="#{splitTopic.topic.id}"/>
+                </h:commandButton>
+            </td>
+        </tr>
+    </table>
+</h:form>
+<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
+   <tr>
+       <!-- integrate jumpbox here -->
+       <td align="right" valign="top" nowrap="nowrap">
+           <ui:include src="/views/jumpbox.xhtml"/>
+       </td>
+   </tr>
+</table>
+<hr />
+
+</forums:isAllowedWhen>
+
+<forums:isAllowedOtherwise>
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td>
+                <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                    <tr>
+                        <td align="center">
+                            ${resource.Not_Moderator}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</forums:isAllowedOtherwise>
+
+</forums:isAllowedChoose>
+</c:when>
+<c:otherwise>
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        <tr>
+            <td>
+                <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                    <tr>
+                        <td align="center">
+                            ${resource.Not_Moderator}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>&#160;</td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</c:otherwise>
+</c:choose>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,289 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{myForumsEdit.initialized}">
+
+<div class="forumtitletext">
+    <h4>${resource.MyForums_title}</h4>
+    <p>${resource.MyForums_info}</p>
+</div>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_forums_info}</td>
+        <td class="forumheaderopen">${resource.Last_Post}</td>
+        <td class="forumheaderopen">${resource.Notification}</td>
+        <td class="forumheadercentered">${resource.Delete}</td>
+    </tr>
+    
+    <c:if test="${forums:collectionSize(myForumsEdit.watchedForums) gt 0}">
+    <c:forEach items="#{myForumsEdit.watchedForums}" var="forumrow" varStatus="status" >
+    
+    <f:subview>
+    
+    <c:choose>
+    
+        <c:when test="${forumWatch.selectedForum ne forumrow.id || forumWatch.editMode eq false}">
+        
+        <f:subview>
+        
+        <tr>
+            <td class="forumlisticon">
+            <img src="#{myForumsEdit.forumImages[forumrow.id]}" width="11" height="14"
+                 alt="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" 
+                 title="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="${forumrow.id}"/>
+                        <h:outputText value="${forumrow.name}"/>                   
+                    </h:outputLink>
+                </h3>
+                ${forumrow.description}
+            </td>
+            <td class="forumlistlast">
+            
+            <c:choose>
+
+                <c:when test="#{myForumsEdit.forumsLastPosts[forumrow.id]!=null}">
+                
+                    <a href="#{forums:postPermlink(myForumsEdit.forumsLastPosts[forumrow.id].id)}">
+                        <c:choose>
+                        
+                            <c:when test="#{forums:isLongerThan(myForumsEdit.forumsLastPosts[forumrow.id].message.subject,25)}">
+                                #{forums:subString(myForumsEdit.forumsLastPosts[forumrow.id].message.subject,25)}&#8230;
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{myForumsEdit.forumsLastPosts[forumrow.id].message.subject}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </a>
+                    <br />
+                    ${resource.By} 
+                    <c:choose>
+                    
+                        <c:when test="#{myForumsEdit.anonymous}">
+                            ${myForumsEdit.forumsLastPosts[forumrow.id].poster.user.userName}
+                        </c:when>
+                                    
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{myForumsEdit.forumsLastPosts[forumrow.id].poster.user.id}"/>
+                                <h:outputText value="${myForumsEdit.forumsLastPosts[forumrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                    <br />
+                    #{myForumsEdit.forumsLastPosts[forumrow.id].createDate}
+                    
+                </c:when>
+                
+                <c:otherwise>
+                    #{resource.No_Posts}
+                </c:otherwise>
+            
+            </c:choose>
+            </td>
+            <td class="forumlistopen">
+            <h:form>
+                <input type="hidden" name="f" value="${forumrow.id}"/>
+                <input type="hidden" name="editWatch" value="true"/>
+                <c:choose>
+                
+                    <c:when test="${myForumsEdit.forumWatches[forumrow.id].mode eq 0}">
+                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:when test="${myForumsEdit.forumWatches[forumrow.id].mode eq 1}">
+                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:otherwise>
+                        ${resource.EMAIL_NO_NOTIFICATION}
+                    </c:otherwise>
+                    
+                </c:choose>
+                &#160;(
+                <h:commandLink action="#{forumWatch.dummyAction}">
+                    <h:outputText value="${resource.Edit}"/>
+                </h:commandLink>
+                )
+            </h:form>
+            </td>
+            <td class="forumlistcentered">
+            <h:form>
+                <div class="actionbuttons">
+                    <ul>
+                        <li>
+                            <h:commandLink id="deActivateWatch" action="#{forumWatch.deActivateWatch}">
+                                <f:param name="f" value="#{forumrow.id}"/>
+                                <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                                     alt="${resource.Unsubscribe_from_forum}"
+                                     name="unSubscribe"
+                                     border="0"
+                                     id="unSubscribe" />
+                            </h:commandLink>
+                        </li>
+                    </ul>
+                </div>
+            </h:form>
+            </td>
+        </tr>
+        
+        </f:subview>
+
+        </c:when>
+        
+        <c:otherwise>
+
+        <f:subview>
+        <tr class="editRow">
+            <td class="forumlisticon">
+                <img src="#{myForumsEdit.forumImages[forumrow.id]}" width="11" height="14"
+                     alt="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" 
+                     title="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="${forumrow.id}"/>
+                        <h:outputText value="${forumrow.name}"/>                   
+                    </h:outputLink>
+                </h3>
+                ${forumrow.description}
+            </td>
+            <td colspan="3">
+                <div class="forumfloatright">
+                    <h:form id="notification_${forumrow.id}" >
+                        <input type="hidden" name="f" value="${forumrow.id}" />
+                        <select name="notified_watch_type" id="notified_watch_type">
+                        
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 0}">
+                                    <option value="0" selected="selected" >
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:when>
+                                 <c:otherwise>
+                                    <option value="0">
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:otherwise>
+                             </c:choose>
+                                
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 1}">
+                                    <option value="1" selected="selected" >
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="1">
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 2}">
+                                    <option value="2" selected="selected" >
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="2">
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                        </select>
+                        <h:commandButton action="${forumWatch.updateNotificationType}"
+                                         value="${resource.Update}" styleClass="buttonMed" />
+                    </h:form>
+                </div>
+            </td>
+        </tr>
+        </f:subview>
+
+        </c:otherwise>
+    
+    </c:choose>
+
+    </f:subview>
+
+    </c:forEach>
+    </c:if>
+    
+    <c:if test="${forums:collectionSize(myForumsEdit.watchedForums) eq 0}">
+        <tr>
+            <td class="nonewpostRow" colspan="6">
+                ${resource.NotSubscribingToAnyForum}
+            </td>
+        </tr>
+    </c:if>
+    
+</table>
+
+<div class="forumlegend">
+    <hr class="forumdashedHR" />
+    <ul>
+        <li>
+            <img src="${forums:themeURL('resourceForumNewURL')}" alt="${resource.New_posts}" width="11" height="14" />
+            ${resource.New_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumURL')}" alt="${resource.No_new_posts}" width="11" height="14" />
+            ${resource.No_new_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumLockedURL')}" alt="${resource.Forum_is_locked}" width="11" height="14" />
+            ${resource.Forum_is_locked}
+        </li>
+    </ul>
+</div>
+
+</c:if>
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,327 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{myForums.initialized}">
+
+<div class="forumtitletext">
+    <h4>${resource.MyForums_title}</h4>
+    <p>${resource.MyForums_info}</p>
+</div>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_topics_info}</td>
+        <td class="forumheadercentered">${resource.Replies}</td>
+        <td class="forumheadercentered">${resource.Views}</td>
+        <td class="forumheader250px">${resource.Last_Post}</td>
+        <td class="forumheadercentered">${resource.Delete}</td>
+    </tr>
+    
+    <c:if test="${forums:collectionSize(myForums.watchedTopics) gt 0}">
+    <c:forEach items="#{myForums.watchedTopics}" var="topicrow" varStatus="status" >
+    <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+        <td class="forumlisticon">
+            <img src="#{forums:folderTypeURL(topicrow,myForums.anonymous)}" 
+                 width="11" height="14"
+                 alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}" />
+        </td>
+        <td>
+            <h3>
+                <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                    <f:param name="t" value="${topicrow.id}"/>
+                    <h:outputText value="${topicrow.subject}"/>                   
+                </h:outputLink>
+            </h3>
+            
+            <!-- mini post navigator for this topic -->
+            <c:if test="#{myForums.topicNavigator[topicrow.id] ne null &amp;&amp; myForums.topicNavigator[topicrow.id].totalPages gt 1}">
+                &#160;(&#160;
+                <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                    <f:param name="t" value="#{topicrow.id}"/>
+                    <f:param name="page" value="0"/>
+                    <h:outputText value="${1}"/>
+                </h:outputLink>
+                &#160;
+                <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                    <f:param name="t" value="#{topicrow.id}"/>
+                    <f:param name="page" value="1"/>
+                    <h:outputText value="${2}"/>
+                </h:outputLink>
+                <c:if test="#{myForums.topicNavigator[topicrow.id].totalPages gt 2}">
+                    &#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="2"/>
+                        <h:outputText value="${3}"/>
+                    </h:outputLink>
+                </c:if>
+                <c:if test="#{myForums.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                    &#160;&#8230;&#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="#{myForums.topicNavigator[topicrow.id].totalPages-1}"/>
+                        <h:outputText value="${resource.Last_page}"/>
+                    </h:outputLink>
+                </c:if>
+                &#160;)
+            </c:if>
+            <br />
+            ${resource.By}&#160;
+            <c:choose>
+                
+                <c:when test="#{myForums.anonymous}">
+                    ${topicrow.poster.user.userName}
+                </c:when>
+               
+                <c:otherwise>
+                    <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                        <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                        <h:outputText value="${topicrow.poster.user.userName}"/>
+                    </h:outputLink>
+                </c:otherwise>
+                            
+            </c:choose>
+        </td>
+        <td class="forumlistcentered">${topicrow.replies}</td>
+        <td class="forumlistcentered">${topicrow.viewCount}</td>
+        <td class="forumlistlast">
+            <a href="#{forums:postPermlink(myForums.topicsLastPosts[topicrow.id].id)}">
+                <c:choose>
+                
+                    <c:when test="#{forums:isLongerThan(myForums.topicsLastPosts[topicrow.id].message.subject,25)}">
+                        #{forums:subString(myForums.topicsLastPosts[topicrow.id].message.subject,25)}&#8230;
+                    </c:when>
+                    
+                    <c:otherwise>
+                        #{myForums.topicsLastPosts[topicrow.id].message.subject}
+                    </c:otherwise>
+                    
+                </c:choose>
+            </a>
+            <br />
+            ${resource.By} 
+            <c:choose>
+            
+                <c:when test="#{myForums.anonymous}">
+                    ${myForums.topicsLastPosts[topicrow.id].poster.user.userName}
+                </c:when>
+                            
+                <c:otherwise>
+                    <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                        <f:param name="uid" value="#{myForums.topicsLastPosts[topicrow.id].poster.user.id}"/>
+                        <h:outputText value="${myForums.topicsLastPosts[topicrow.id].poster.user.userName}"/>
+                    </h:outputLink>
+                </c:otherwise>
+                            
+            </c:choose>
+            <br />
+            #{myForums.topicsLastPosts[topicrow.id].createDate}
+        </td>
+        <td class="forumlistcentered">
+        <h:form>
+            <div class="actionbuttons">
+                <ul>
+                    <li>
+                        <h:commandLink id="deActivateWatch" action="#{topicWatch.deActivateWatch}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                                 alt="${resource.Unsubscribe_from_topic}"
+                                 name="unSubscribe"
+                                 border="0"
+                                 id="unSubscribe" />
+                        </h:commandLink>
+                    </li>
+                </ul>
+            </div>
+        </h:form>
+        </td>
+    </tr>
+    </c:forEach>
+    </c:if>
+    
+    <c:if test="${forums:collectionSize(myForums.watchedTopics) eq 0}">
+        <tr>
+            <td class="nonewpostRow" colspan="6">
+                ${resource.NoNewPosts}
+            </td>
+        </tr>
+    </c:if>
+    
+    <tr>
+        <td class="footerrow" colspan="6">
+            <h:outputLink value="#{forums:outputLink(shared.links['myForumsAll'],true)}">
+               ${resource.ViewAllSubscribed}
+            </h:outputLink>
+        </td>
+    </tr>
+    <tr>
+        <td class="spacerRow" colspan="6" />
+    </tr>
+</table>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_forums_info}</td>
+        <td class="forumheadercentered">#{resource.Topics}</td>
+        <td class="forumheadercentered">#{resource.Posts}</td>
+        <td class="forumheaderopen">#{resource.Last_Post}</td>
+	    <td class="forumheadercentered">${resource.Delete}</td>
+    </tr>
+    
+    <c:forEach items="#{myForums.watchedForums}" var="forumrow">
+    <forums:isAllowed fragment="acl://readForum" contextData="#{forumrow}">
+    <tr>
+        <td class="forumlisticon">
+            <img src="#{myForums.forumImages[forumrow.id]}" width="11" height="14"
+                 alt="#{resource[myForums.forumImageDescriptions[forumrow.id]]}" 
+                 title="#{resource[myForums.forumImageDescriptions[forumrow.id]]}" />
+        </td>
+        <td>
+            <h3>
+                <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                    <f:param name="f" value="#{forumrow.id}"/>
+                    <h:outputText value="#{forumrow.name}"/>
+                </h:outputLink>
+            </h3>
+            ${forumrow.description}
+        </td>
+        <td class="forumlistcentered">${forumrow.topicCount}</td>
+        <td class="forumlistcentered">${forumrow.postCount}</td>
+        <td class="forumlistlast">
+        
+            <c:choose>
+                <c:when test="#{myForums.forumsLastPosts[forumrow.id]!=null}">
+        
+                    <a href="#{forums:postPermlink(myForums.forumsLastPosts[forumrow.id].id)}">
+                    <c:choose>
+                        <c:when test="#{forums:isLongerThan(myForums.forumsLastPosts[forumrow.id].message.subject,25)}">
+                            #{forums:subString(myForums.forumsLastPosts[forumrow.id].message.subject,25)}&#8230;
+                        </c:when>
+                        <c:otherwise>
+                            #{myForums.forumsLastPosts[forumrow.id].message.subject}
+                        </c:otherwise>
+                    </c:choose>
+                    </a>
+                    
+                    <br></br>
+                    ${resource.By}&#160;
+                    
+                    <c:choose>
+                    
+                        <c:when test="#{myForums.anonymous}">
+                            ${myForums.forumsLastPosts[forumrow.id].poster.user.userName}
+                        </c:when>
+                        
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{myForums.forumsLastPosts[forumrow.id].poster.user.id}"/>
+                                <h:outputText value="${myForums.forumsLastPosts[forumrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                        
+                    </c:choose>
+                    
+                    <br></br>
+                    #{myForums.forumsLastPosts[forumrow.id].createDate}
+                    
+                </c:when>
+                
+                <c:otherwise>
+                    #{resource.No_Posts}
+                </c:otherwise>
+                
+            </c:choose>
+        </td>
+        <td class="forumlistcentered">
+        <h:form>
+            <div class="actionbuttons">
+                <ul>
+                    <li>
+                        <h:commandLink action="#{forumWatch.deActivateWatch}">
+                            <f:param name="w" value="#{forums:isWatchingForum(forumrow)}" />
+                            <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                                 alt="${resource.Unsubscribe_from_forum}"
+                                 name="unSubscribe"
+                                 border="0"
+                                 id="unSubscribe" />
+                        </h:commandLink>
+                    </li>
+                </ul>
+            </div>
+        </h:form>
+        </td>
+    </tr>
+    </forums:isAllowed>
+    </c:forEach>
+    
+    <tr>
+        <td class="footerrow" colspan="6">
+            <h:outputLink value="#{forums:outputLink(shared.links['myForumsEdit'],true)}">
+               ${resource.EditAllSubscribed}
+            </h:outputLink>
+        </td>
+    </tr>
+    <tr>
+        <td class="spacerRow" colspan="6" />
+    </tr>
+    
+</table>
+
+<div class="forumlegend">
+    <hr class="forumdashedHR" />
+    <ul>
+        <li>
+            <img src="${forums:themeURL('resourceForumNewURL')}" alt="${resource.New_posts}" width="11" height="14" />
+            ${resource.New_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumURL')}" alt="${resource.No_new_posts}" width="11" height="14" />
+            ${resource.No_new_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumLockedURL')}" alt="${resource.Forum_is_locked}" width="11" height="14" />
+            ${resource.Forum_is_locked}
+        </li>
+    </ul>
+</div>
+
+</c:if>
+
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,352 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{myForumsAll.initialized}">
+
+<div class="forumtitletext">
+    <h4>${resource.MyForums_title}</h4>
+    <p>${resource.MyForums_info}</p>
+</div>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_topics_info}</td>
+        <td class="forumheaderopen">${resource.Last_Post}</td>
+        <td class="forumheaderopen">${resource.Notification}</td>
+        <td class="forumheadercentered">${resource.Delete}</td>
+    </tr>
+    
+    <c:if test="${forums:collectionSize(myForumsAll.watchedTopics) gt 0}">
+    <c:forEach items="#{myForumsAll.watchedTopics}" var="topicrow" varStatus="status" >
+    <ui:fragment>
+    <c:choose>
+    
+        <c:when test="${topicWatch.topicId ne topicrow.id || topicWatch.editMode eq false}">
+        <ui:fragment>
+        <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+            <td class="forumlisticon">
+                <img src="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}" 
+                     width="11" height="14"
+                     alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="${topicrow.id}"/>
+                        <h:outputText value="${topicrow.subject}"/>                   
+                    </h:outputLink>
+                </h3>
+                
+                <!-- mini post navigator for this topic -->
+                <c:if test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
+                    &#160;(&#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="0"/>
+                        <h:outputText value="${1}"/>
+                    </h:outputLink>
+                    &#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="1"/>
+                        <h:outputText value="${2}"/>
+                    </h:outputLink>
+                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
+                        &#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="2"/>
+                            <h:outputText value="${3}"/>
+                        </h:outputLink>
+                    </c:if>
+                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                        &#160;&#8230;&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}"/>
+                            <h:outputText value="${resource.Last_page}"/>
+                        </h:outputLink>
+                    </c:if>
+                    &#160;)
+                </c:if>
+                <br />
+                ${resource.By}&#160;
+                <c:choose>
+                    
+                    <c:when test="#{myForumsAll.anonymous}">
+                        ${topicrow.poster.user.userName}
+                    </c:when>
+                   
+                    <c:otherwise>
+                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                            <h:outputText value="${topicrow.poster.user.userName}"/>
+                        </h:outputLink>
+                    </c:otherwise>
+                                
+                </c:choose>
+            </td>
+            <td class="forumlistlast">
+                <a href="#{forums:postPermlink(myForumsAll.topicsLastPosts[topicrow.id].id)}">
+                    <c:choose>
+                    
+                        <c:when test="#{forums:isLongerThan(myForumsAll.topicsLastPosts[topicrow.id].message.subject,25)}">
+                            #{forums:subString(myForumsAll.topicsLastPosts[topicrow.id].message.subject,25)}&#8230;
+                        </c:when>
+                        
+                        <c:otherwise>
+                            #{myForumsAll.topicsLastPosts[topicrow.id].message.subject}
+                        </c:otherwise>
+                        
+                    </c:choose>
+                </a>
+                <br />
+                ${resource.By} 
+                <c:choose>
+                
+                    <c:when test="#{myForumsAll.anonymous}">
+                        ${myForumsAll.topicsLastPosts[topicrow.id].poster.user.userName}
+                    </c:when>
+                                
+                    <c:otherwise>
+                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid" value="#{myForumsAll.topicsLastPosts[topicrow.id].poster.user.id}"/>
+                            <h:outputText value="${myForumsAll.topicsLastPosts[topicrow.id].poster.user.userName}"/>
+                        </h:outputLink>
+                    </c:otherwise>
+                                
+                </c:choose>
+                <br />
+                #{myForumsAll.topicsLastPosts[topicrow.id].createDate}
+            </td>
+            <td class="forumlistopen">
+            <h:form>
+                <input type="hidden" name="t" value="${topicrow.id}"/>
+                <input type="hidden" name="editWatch" value="true"/>
+                <c:choose>
+                
+                    <c:when test="${myForumsAll.topicWatches[topicrow.id].mode eq 0}">
+                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:when test="${myForumsAll.topicWatches[topicrow.id].mode eq 1}">
+                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:otherwise>
+                        ${resource.EMAIL_NO_NOTIFICATION}
+                    </c:otherwise>
+                    
+                </c:choose>
+                &#160;(
+                <h:commandLink action="#{topicWatch.dummyAction}">
+                    <h:outputText value="${resource.Edit}"/>
+                </h:commandLink>
+                )
+            </h:form>
+            </td>
+            <td class="forumlistcentered">
+            <h:form>
+                <div class="actionbuttons">
+                    <ul>
+                        <li>
+                            <h:commandLink id="deActivateWatch" action="#{topicWatch.deActivateWatch}">
+                                <f:param name="t" value="#{topicrow.id}"/>
+                                <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                                     alt="${resource.Unsubscribe_from_topic}"
+                                     name="unSubscribe"
+                                     border="0"
+                                     id="unSubscribe" />
+                            </h:commandLink>
+                        </li>
+                    </ul>
+                </div>
+            </h:form>
+            </td>
+        </tr>
+        </ui:fragment>
+        </c:when>
+        
+        <c:otherwise>
+        <ui:fragment>
+        <tr class="editRow">
+            <td class="forumlisticon">
+                <img src="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}" 
+                     width="11" height="14"
+                     alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="${topicrow.id}"/>
+                        <h:outputText value="${topicrow.subject}"/>                   
+                    </h:outputLink>
+                </h3>
+                <!-- mini post navigator for this topic -->
+                <c:if test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
+                    &#160;(&#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="0"/>
+                        <h:outputText value="${1}"/>
+                    </h:outputLink>
+                    &#160;
+                    <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topicrow.id}"/>
+                        <f:param name="page" value="1"/>
+                        <h:outputText value="${2}"/>
+                    </h:outputLink>
+                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
+                        &#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="2"/>
+                            <h:outputText value="${3}"/>
+                        </h:outputLink>
+                    </c:if>
+                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
+                        &#160;&#8230;&#160;
+                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topicrow.id}"/>
+                            <f:param name="page" value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}"/>
+                            <h:outputText value="${resource.Last_page}"/>
+                        </h:outputLink>
+                    </c:if>
+                    &#160;)
+                </c:if>
+                <br />
+                ${resource.By}&#160;
+                <c:choose>
+                    
+                    <c:when test="#{myForumsAll.anonymous}">
+                        ${topicrow.poster.user.userName}
+                    </c:when>
+                   
+                    <c:otherwise>
+                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid" value="${topicrow.poster.user.id}"/>
+                            <h:outputText value="${topicrow.poster.user.userName}"/>
+                        </h:outputLink>
+                    </c:otherwise>
+                                
+                </c:choose>
+            </td>
+            <td colspan="3">
+                <div class="forumfloatright">
+                    <h:form id="notification_${topicrow.id}" >
+                        <input type="hidden" name="t" value="${topicrow.id}" />
+                        <select name="notified_watch_type" id="notified_watch_type">
+                        
+                            <c:choose>
+                                <c:when test="${myForumsAll.watch.mode eq 0}">
+                                    <option value="0" selected="selected" >
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:when>
+                                 <c:otherwise>
+                                    <option value="0">
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:otherwise>
+                             </c:choose>
+                                
+                            <c:choose>
+                                <c:when test="${myForumsAll.watch.mode eq 1}">
+                                    <option value="1" selected="selected" >
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="1">
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                            <c:choose>
+                                <c:when test="${myForumsAll.watch.mode eq 2}">
+                                    <option value="2" selected="selected" >
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="2">
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                        </select>
+                        <h:commandButton action="${topicWatch.updateNotificationType}"
+                                         value="${resource.Update}" styleClass="buttonMed" />
+                    </h:form>
+                </div>
+            </td>
+        </tr>
+        </ui:fragment>
+        </c:otherwise>
+    
+    </c:choose>
+    </ui:fragment>
+    </c:forEach>
+    </c:if>    
+</table>
+
+<div class="forumlegend">
+    <hr class="forumdashedHR" />
+    <ul>
+        <li>
+            <img src="${forums:themeURL('resourceForumNewURL')}" alt="${resource.New_posts}" width="11" height="14" />
+            ${resource.New_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumURL')}" alt="${resource.No_new_posts}" width="11" height="14" />
+            ${resource.No_new_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumLockedURL')}" alt="${resource.Forum_is_locked}" width="11" height="14" />
+            ${resource.Forum_is_locked}
+        </li>
+    </ul>
+</div>
+
+</c:if>
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/portal_index.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/portal_index.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/portal_index.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,53 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<table width="100%" cellpadding="2" cellspacing="1" border="0">
+	<tr>
+		<th colspan="2" height="25" nowrap="nowrap">
+      	&#160;
+      	<form name="redirect" action="#{forums:outputLink(shared.links['index'],true)}" method="post">
+      		<!--input type="submit" name="Start Forums"/-->
+        </form>
+      	&#160;  					
+      </th>
+	</tr>
+</table>
+
+<!-- perform a sendRedirect to the above resource -->
+<script type="text/javascript" language="javascript">
+	document.redirect.submit();
+</script>
+
+
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/pref/index.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/pref/index.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/pref/index.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,259 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+<ui:composition template="/views/common/common_noMenu.xhtml">
+
+<ui:define name="mainContent">
+   
+<c:if test="#{prefController.initialized &amp;&amp; prefController.anonymous==false}">
+<h:form>
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+    
+    <!-- title -->
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.L_PREFERENCES}</td>
+    </tr>
+    
+    <!-- notify on reply -->
+    <tr class="oddRow">
+        <td class="rowlinefirst">
+            ${resource.L_NOTIFY_ON_REPLY}:
+            <br/>
+            <span class="note">${resource.L_NOTIFY_ON_REPLY_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.notifyOnReply}" styleClass="forumsubtablestyle" >
+                <f:selectItem itemValue="true" itemLabel="&#160;${resource.L_YES}" />
+                <f:selectItem itemValue="false" itemLabel="&#160;${resource.L_NO}" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    
+    <!-- Always allow html -->
+    <tr class="evenRow">
+        <td class="rowlinefirst">
+            ${resource.L_ALWAYS_ALLOW_HTML}:
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.alwaysAllowHtml}" styleClass="forumsubtablestyle">
+                <f:selectItem itemValue="true" itemLabel="${resource.L_YES}" />
+                <f:selectItem itemValue="false" itemLabel="${resource.L_NO}" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    
+    <!-- Post Order -->
+    <tr class="oddRow" >
+        <td class="rowlinefirst">
+            ${resource.L_POST_ORDER}:
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.postOrder}" styleClass="forumsubtablestyle">
+                <f:selectItem itemValue="ascending" itemLabel="${resource.L_ASCENDING}" />
+                <f:selectItem itemValue="descending" itemLabel="${resource.L_DESCENDING}" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+        
+    <!-- Topics Per Page -->
+    <tr class="evenRow">
+        <td class="rowlinefirst">
+            ${resource.L_TOPICS_PER_FORUM}:
+            <br />
+            <span class="note">${resource.L_TOPICS_PER_FORUM_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.topicsPerForum}" styleClass="forumsubtablestyle">
+                <f:selectItem itemValue="5" itemLabel="5" />
+                <f:selectItem itemValue="10" itemLabel="10" />
+                <f:selectItem itemValue="15" itemLabel="15" />
+                <f:selectItem itemValue="20" itemLabel="20" />
+                <f:selectItem itemValue="25" itemLabel="25" />
+                <f:selectItem itemValue="30" itemLabel="30" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    
+    <!-- Posts Per Page -->
+    <tr class="oddRow">
+        <td class="rowlinefirst">
+            ${resource.L_POSTS_PER_TOPIC}:
+            <br />
+            <span class="note">${resource.L_POSTS_PER_TOPIC_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.postsPerTopic}" styleClass="forumsubtablestyle">
+                <f:selectItem itemValue="5" itemLabel="5" />
+                <f:selectItem itemValue="10" itemLabel="10" />
+                <f:selectItem itemValue="15" itemLabel="15" />
+                <f:selectItem itemValue="20" itemLabel="20" />
+                <f:selectItem itemValue="25" itemLabel="25" />
+                <f:selectItem itemValue="30" itemLabel="30" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    
+    <!-- Date Format -->
+    <tr class="evenRow">
+        <td class="rowlinefirst">
+            ${resource.L_DATE_FORMAT}:
+        </td>
+        <td class="rowline">
+            <h:inputText maxlength="14" styleClass="post" value="#{prefController.dateFormat}"/>
+        </td>
+    </tr>
+    
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.L_USER_INFO}</td>
+    </tr>
+    
+    <!-- Always add Signature -->
+    <tr class="oddRow">
+        <td class="rowlinefirst">
+            ${resource.L_ALWAYS_ADD_SIGNATURE}:
+        </td>
+        <td class="rowline">
+            <h:selectOneRadio value="#{prefController.alwaysAddSignature}" styleClass="forumsubtablestyle">
+                <f:selectItem itemValue="true" itemLabel="${resource.L_YES}" />
+                <f:selectItem itemValue="false" itemLabel="${resource.L_NO}" />
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    
+    <!-- Signature -->
+    <tr class="evenRow">
+        <td class="rowlinefirst">
+            ${resource.L_SIGNATURE}:
+            <br />
+            <span class="note">${resource.L_SIGNATURE_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:inputTextarea style="width: 300px" rows="6" cols="30" styleClass="post" value="#{prefController.signature}"/>
+        </td>
+    </tr>
+    
+    <!-- Topic Summary -->
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.L_TOPIC_SUMMARY}</td>
+    </tr>
+    
+    <!-- Summary Mode -->
+    <tr class="oddRow">
+        <td class="rowlinefirst">
+            ${resource.L_MODE_CHOOSE}:
+            <br />
+            <span class="note">${resource.L_MODE_CHOOSE_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:selectOneMenu value="#{prefController.summaryMode}">
+                <f:selectItem itemValue="1" itemLabel="Hot topics (above some number of replies)"/>
+                <f:selectItem itemValue="0" itemLabel="Latest posted topics"/>
+                <f:selectItem itemValue="2" itemLabel="Hottest topics (most replied)"/>
+                <f:selectItem itemValue="3" itemLabel="Most viewed topics"/>
+            </h:selectOneMenu>
+        </td>
+    </tr>
+    
+    <!-- Topics Limit -->
+    <tr class="evenRow">
+        <td class="rowlinefirst">
+            ${resource.L_TOPIC_SUMMARY_LIMIT}:
+            <br />
+            <span class="note">${resource.L_TOPIC_SUMMARY_LIMIT_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:inputText maxlength="7" value="#{prefController.summaryTopicLimit}"/>
+        </td>
+    </tr>
+    
+    <!-- Days Old Posts -->
+    <tr class="oddRow">
+        <td class="rowlinefirst">
+            ${resource.L_TOPIC_SUMMARY_DAYS}:
+            <br />
+            <span class="note">${resource.L_TOPIC_SUMMARY_DAYS_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:inputText maxlength="7" value="#{prefController.summaryTopicDays}"/>
+        </td>
+    </tr>
+    
+    <!-- Replies in Topic -->
+    <tr>
+        <td class="rowlinefirst">
+            ${resource.L_TOPIC_SUMMARY_REPLIES}:
+            <br />
+            <span class="note">${resource.L_TOPIC_SUMMARY_REPLIES_EXPLAIN}</span>
+        </td>
+        <td class="rowline">
+            <h:inputText maxlength="7" styleClass="post" value="#{prefController.summaryTopicReplies}"/>
+        </td>
+    </tr>
+    
+    <!-- buttons -->
+    <tr>
+        <td class="forumformbuttonrow" colspan="2" style="border:0px;">
+            <h:commandButton value="${resource.L_SUBMIT}" styleClass="buttonMed" action="#{prefController.execute}"/>
+            <h:commandButton type="reset" value="${resource.L_RESET}" styleClass="buttonMed"/>
+        </td>
+    </tr>
+</table>
+</h:form>
+</c:if>
+
+<!-- in case of anonymous access -->
+<c:if test="#{prefController.anonymous==true}">
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+    <tr>
+        <td>
+            <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                <tr>
+                    <td>&#160;</td>
+                </tr>
+                <tr>
+                    <td align="center">
+                        <h:outputText value="${resource.L_LOGIN_REQUIRED}"/>                   
+                    </td>
+                </tr>
+                <tr>
+                    <td>&#160;</td>
+                </tr>                   
+            </table>
+        </td>
+    </tr>
+</table>
+</c:if>
+
+</ui:define>
+</ui:composition>   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/usermessage_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,41 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+-->
+
+<div xmlns="http://www.w3.org/1999/xhtml"
+     xmlns:ui="http://java.sun.com/jsf/facelets"
+     xmlns:c="http://java.sun.com/jstl/core"
+     xmlns:h="http://java.sun.com/jsf/html"
+     xmlns:f="http://java.sun.com/jsf/core"
+     xmlns:forums="http://www.jboss.com/products/jbossportal/forums" class="bb">
+     
+   <ui:composition template="/views/common/common.xhtml">
+   <ui:define name="mainContent">
+
+   		<h:outputText value="VIEW SHOWING AN EDITOR OF MEESSAGE SENT TO USER" />
+   
+   </ui:define>
+   </ui:composition>
+   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,199 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<c:choose> 
+
+    <c:when test="#{profile.poster!=null &amp;&amp; profile.poster.id!=-1}">
+    
+        <div class="forumbread">
+            <ul>
+                <li class="first">
+                    
+                    <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                        <h:outputText value="#{shared.mainPageName}"/>
+                    </h:outputLink>
+                    
+                    <ul>
+                        <li>
+                            &#62;&#160;
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="${profile.poster.user.id}"/>
+                                <h:outputText value="${resource.L_VIEWING_PROFILE}"/>
+                            </h:outputLink>
+                        </li>
+                    </ul>
+                    
+                </li>
+            </ul>
+        </div>
+        
+        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr class="header">
+                <td class="forumheaderfirst" colspan="4">
+                    ${forums:userProperty(profile.poster.user,'INFO_USER_NAME_GIVEN')}
+                </td>
+            </tr>
+            <tr>
+                <td class="labelCell" width="10%">
+                    ${resource.L_JOINED}:&#160;
+                </td>
+                <td class="valueCell" width="40%">
+                    ${forums:userProperty(profile.poster.user,'INFO_USER_REGISTRATION_DATE')}
+                </td>
+                <td class="labelCell" width="10%">
+                    ${resource.L_EMAIL_ADDRESS}:
+                </td>
+                <td class="valueCell" width="40%">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_EMAIL_FAKE')!=null}" >
+                    <a href="mailto:${forums:userProperty(profile.poster.user,'INFO_USER_EMAIL_FAKE')}"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconEmailURL')}"
+                             alt="${resource.Send_email}"/>
+                    </a>
+                    </c:if>
+                </td>
+            </tr>
+            <tr>
+                <td class="labelCell">${resource.L_TOTAL_POSTS}:&#160;</td>
+                <td class="valueCell">${profile.poster.postCount}</td>
+                <td class="labelCell">${resource.L_SKYPE}:</td>
+                <td class="valueCell">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_IM_SKYPE')!=null}" >
+                    <a href="skype:#{forums:userProperty(profile.poster.user,'INFO_USER_IM_SKYPE')}?add"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconSkypeURL')}"
+                             alt="${resource.L_SKYPE}"/>
+                    </a>
+                    </c:if>
+                </td>
+            </tr>
+            <tr>
+                <td class="labelCell">${resource.L_LOCATION}:&#160;</td>
+                <td class="valueCell">#{forums:userProperty(profile.poster.user,'INFO_USER_LOCATION')}</td>
+                <td class="labelCell">${resource.L_MESSENGER}:</td>
+                <td class="valueCell">#{forums:userProperty(profile.poster.user,'INFO_USER_IM_MSNM')}</td>
+            </tr>
+            <tr>
+                <td class="labelCell">${resource.L_WEBSITE}:&#160;</td>
+                <td class="valueCell">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_HOMEPAGE')!=null}" >
+                    <a href="${forums:userProperty(profile.poster.user,'INFO_USER_HOMEPAGE')}"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconWWWURL')}"
+                             alt="${resource.Visit_website}"/>
+                    </a>
+                    </c:if>
+                </td>
+                <td class="labelCell">${resource.L_YAHOO}:</td>
+                <td class="valueCell">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_IM_YIM')!=null}" >
+                    <a href="http://edit.yahoo.com/config/send_webmesg?.target=#{forums:userProperty(profile.poster.user,'INFO_USER_IM_YIM')}&amp;.src=pg"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconYIMURL')}"
+                             alt="${resource.YIM}"/>
+                    </a>
+                    </c:if>
+                </td>
+            </tr>
+            <tr>
+                <td class="labelCell">${resource.L_OCCUPATION}:&#160;</td>
+                <td class="valueCell">#{forums:userProperty(profile.poster.user,'INFO_USER_OCCUPATION')}</td>
+                <td class="labelCell">${resource.L_AIM}:</td>
+                <td class="valueCell">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_IM_AIM')!=null}" >
+                    <a href="aim:goim?screenname=#{forums:userProperty(profile.poster.user,'INFO_USER_IM_AIM')}&amp;message=Hello+Are+you+there?"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconAIMURL')}"
+                             alt="${resource.AIM}"/>
+                    </a>
+                    </c:if>
+                </td>
+            </tr>
+            <tr>
+                <td class="labelCell bottomline">${resource.L_INTERESTS}:</td>
+                <td class="valueCell bottomline">#{forums:userProperty(profile.poster.user,'INFO_USER_INTERESTS')}</td>
+                <td class="labelCell bottomline">${resource.L_ICQ_NUMBER}:</td>
+                <td class="valueCell bottomline">
+                    <c:if test="#{forums:userProperty(profile.poster.user,'INFO_USER_IM_ICQ')!=null}" >
+                    <a href="http://www.icq.com/scripts/search.dll?to=#{forums:userProperty(profile.poster.user,'INFO_USER_IM_ICQ')}"
+                       style="text-decoration: none;">
+                        <img border="0"
+                             src="#{forums:themeURL('resourceIconICQURL')}"
+                             alt="${resource.ICQ}"/>
+                    </a>
+                    </c:if>
+                </td>
+            </tr>
+        </table>
+        
+        <br />
+        
+        <div class="forumlegendjumpboxfloat">
+            <ui:include src="/views/jumpbox.xhtml"/>
+        </div>
+        
+     </c:when>
+     
+     <c:otherwise>
+         <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.No_such_user}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+     </c:otherwise>
+
+</c:choose>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_asposts.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_asposts.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_asposts.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,435 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+        <c:choose>
+    
+            <c:when test="#{viewSearch.initialized &amp;&amp; viewSearch.posts != null}">
+
+                <a name="top" />
+
+                <div class="forumtitletext">
+                    <h4>
+                        <h:outputFormat value="#{resource.Search_found}">
+                            <f:param value="#{viewSearch.pageNavigator.numberOfEntries}" />
+                        </h:outputFormat>
+                    </h4>
+                </div>
+	    
+			    <!-- PAGINATION -->
+			    <c:if test="#{viewSearch.pageNavigator.totalPages gt 1}">
+			    <div class="forumpagination">
+			        <ul>
+			            <li class="disablepage">
+			                <h:outputFormat value="#{resource.PageNumber}">
+			                    <f:param value="${viewSearch.pageNavigator.pageNumber}"/>
+			                    <f:param value="${viewSearch.pageNavigator.totalPages}"/>
+			                </h:outputFormat>
+			            </li>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq 0}">
+			                    <li class="disablepage">
+			                        ${resource.First}
+			                    </li>
+			                    <li class="disablepage">
+			                        &#60; ${resource.Previous}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="0"/>
+			                            <h:outputText value="${resource.First}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage-1}"/>
+			                            <h:outputText value="&#60; ${resource.Previous}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationLeft}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <li class="currentpage">
+			                ${viewSearch.pageNavigator.currentPage+1}
+			            </li>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationRight}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq (viewSearch.pageNavigator.totalPages-1) }">
+			                    <li class="disablepage">
+			                        ${resource.Next} &#62;
+			                    </li>
+			                    <li class="disablepage">
+			                        ${resource.Last}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage+1}"/>
+			                            <h:outputText value="${resource.Next} &#62;"/>
+			                        </h:outputLink>
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.totalPages-1}"/>
+			                            <h:outputText value="${resource.Last}"/>
+			                        </h:outputLink>
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			        </ul>
+			    </div>
+			    </c:if>
+
+	            <h:form>
+			        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+				        <tr class="header">
+				            <td class="forumheaderfirst">${resource.Author}</td>
+				            <td class="forumheaderopen">${resource.Message}</td>
+				        </tr>
+			        
+				        <c:forEach items="#{viewSearch.posts}" var="postrow" varStatus="status">
+				        <tr class="oddRow">
+				            <td class="forumpostleftcolumn">
+				                <c:choose>
+				                    
+				                    <c:when test="#{category.anonymous}">
+				                        ${postrow.poster.user.userName}
+				                    </c:when>
+				                    
+				                    <c:otherwise>
+				                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+				                            <f:param name="uid" value="${postrow.poster.user.id}"/>
+				                            <h:outputText value="${postrow.poster.user.userName}"/>
+				                        </h:outputLink>
+				                    </c:otherwise>
+				                    
+				                </c:choose>
+				            </td>
+				            <td class="forumpostspacer">
+				            
+				                <a name="${postrow.id}" />
+				                
+				                <div class="forumpostinfo">
+				                    <ul>
+				                        <li>
+				                            <a name="${postrow.id}" />
+				                            <h:outputLink value="#{forums:postPermlink(postrow.id)}" style="text-decoration: none;">
+				                                <f:verbatim>
+				                                    <h:outputText value="${resource.Permalink}"/>
+				                                </f:verbatim>
+				                            </h:outputLink>
+				                        </li>
+				                        <li>${resource.Posted}:&#160;#{forums:dateStr(postrow.createDate)}</li>
+				                        <li>${resource.Post_subject}:&#160;${postrow.message.subject}</li>
+				                    </ul>
+				                </div>
+				            </td>
+				        </tr>
+				        <tr>
+				            <td class="forumpostleftcolumn">&#160;</td>
+				            <td class="forumpostcontent">
+				
+				                <p>
+				                    <h:outputText value="#{forums:formatMessage(postrow.message.text,false)}" escape="false" />
+				                    <br /><br />
+				                    ${forums:userProperty(postrow.poster.user,'INFO_USER_SIGNATURE')}
+				                </p>
+				
+				                <!-- show the attachments of this post here -->
+				                <p>
+				                    <c:if test="#{postrow.attachments!=null}">
+				                        <ui:include src="/views/topics/attachmentsview.xhtml">
+				                            <ui:param name="attachments" value="#{postrow.attachments}"/>
+				                        </ui:include>
+				                    </c:if>
+				                </p>
+				
+				                <c:if test="${postrow.editCount gt 0}">
+				                <p>
+				                    <em>
+				                        <c:choose>
+				                            <c:when test="${postrow.editCount eq 1}">
+				                                <h:outputFormat value="#{resource.Edited_time_total}">
+				                                    <f:param value="${postrow.poster.user.userName}"/>
+				                                    <f:param value="${postrow.editDate}"/>
+				                                    <f:param value="${postrow.editCount}"/>
+				                                </h:outputFormat>
+				                            </c:when>
+				                            <c:otherwise>
+				                                <h:outputFormat value="#{resource.Edited_times_total}">
+				                                    <f:param value="${postrow.poster.user.userName}"/>
+				                                    <f:param value="${postrow.editDate}"/>
+				                                    <f:param value="${postrow.editCount}"/>
+				                                </h:outputFormat>
+				                            </c:otherwise>
+				                        </c:choose>
+				                    </em>
+				                </p>
+				                </c:if>
+				                
+				            </td>
+				        </tr>
+				        <tr>
+				            <td class="forumpostleftcolumn">
+				                <a href="#top">${resource.Back_to_top}</a>
+				            </td>
+				            <td class="forumthreaduserinfo">
+				                <ul>
+				                    <li>
+				                        <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+				                            <f:param name="uid"
+				                                     value="#{postrow.poster.user.id}"/>
+				                            <f:verbatim>
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconProfileURL')}"
+				                                     alt="${resource.Read_profile}"/>
+				                            </f:verbatim>
+				                        </h:outputLink>
+				                    </li>
+				                    				                    
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_EMAIL_FAKE') ne null}">
+				                        <li>
+				                            <a href="mailto:${forums:userProperty(postrow.poster.user,'INFO_USER_EMAIL_FAKE')}">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconEmailURL')}"
+				                                     alt="${resource.Send_email}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_HOMEPAGE') ne null}">
+				                        <li>
+				                            <a href="${forums:userProperty(postrow.poster.user,'INFO_USER_HOMEPAGE')}">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconWWWURL')}"
+				                                     alt="${resource.Visit_website}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_AIM') ne null}">
+				                        <li>
+				                            <a href="aim:goim?screenname=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_AIM')}&amp;message=Hello+Are+you+there?">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconAIMURL')}"
+				                                     alt="${resource.AIM}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_YIM') ne null}">
+				                        <li>
+				                            <a href="http://edit.yahoo.com/config/send_webmesg?.target=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_YIM')}&amp;.src=pg">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconYIMURL')}"
+				                                     alt="${resource.YIM}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_SKYPE') ne null}">
+				                        <li>
+				                            <!-- TODO: some more functionality may be added. Like automatic skype instalation and status checker.-->
+				                            <a href="skype:#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_SKYPE')}?add">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconSkypeURL')}"
+				                                     alt="${resource.L_SKYPE}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_MSNM') ne null}">
+				                        <li>
+				                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+				                                <f:param name="uid"
+				                                         value="#{postrow.poster.user.id}"/>
+				                                <f:verbatim>
+				                                    <img border="0"
+				                                         src="#{forums:themeURL('resourceIconMSNMURL')}"
+				                                         alt="${resource.Read_profile}"/>
+				                                </f:verbatim>
+				                            </h:outputLink>
+				                         </li>
+				                    </c:if>
+				                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_ICQ') ne null}">
+				                        <li>
+				                            <a href="http://www.icq.com/scripts/search.dll?to=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_ICQ')}">
+				                                <img border="0"
+				                                     src="#{forums:themeURL('resourceIconICQURL')}"
+				                                     alt="${resource.ICQ}"/>
+				                            </a>
+				                        </li>
+				                    </c:if>
+				                    
+				                </ul>
+				            </td>
+				        </tr> 
+				        <tr>
+				            <td colspan="2" class="forumthreadfooter">
+				                <img src="#{forums:themeURL('resourceSpacerURL')}" />
+				            </td>
+				        </tr>
+				        </c:forEach>
+			
+			        </table>
+	            </h:form>
+
+			    <!-- PAGINATION -->
+			    <c:if test="#{viewSearch.pageNavigator.totalPages gt 1}">
+			    <div class="forumpagination">
+			        <ul>
+			            <li class="disablepage">
+			                <h:outputFormat value="#{resource.PageNumber}">
+			                    <f:param value="${viewSearch.pageNavigator.pageNumber}"/>
+			                    <f:param value="${viewSearch.pageNavigator.totalPages}"/>
+			                </h:outputFormat>
+			            </li>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq 0}">
+			                    <li class="disablepage">
+			                        ${resource.First}
+			                    </li>
+			                    <li class="disablepage">
+			                        &#60; ${resource.Previous}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="0"/>
+			                            <h:outputText value="${resource.First}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage-1}"/>
+			                            <h:outputText value="&#60; ${resource.Previous}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationLeft}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <li class="currentpage">
+			                ${viewSearch.pageNavigator.currentPage+1}
+			            </li>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationRight}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq (viewSearch.pageNavigator.totalPages-1) }">
+			                    <li class="disablepage">
+			                        ${resource.Next} &#62;
+			                    </li>
+			                    <li class="disablepage">
+			                        ${resource.Last}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage+1}"/>
+			                            <h:outputText value="${resource.Next} &#62;"/>
+			                        </h:outputLink>
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.totalPages-1}"/>
+			                            <h:outputText value="${resource.Last}"/>
+			                        </h:outputLink>
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			        </ul>
+			    </div>
+			    </c:if>
+	
+            </c:when>
+	
+		    <c:otherwise>
+		        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+		            <tr>
+		                <td>
+		                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+		                        <tr>
+		                            <td>&#160;</td>
+		                        </tr>
+		                        <tr>
+		                            <td align="center">
+		                                ${resource.Search_posts_not_found}
+		                            </td>
+		                        </tr>
+		                        <tr>
+		                            <td>&#160;</td>
+		                        </tr>
+		                    </table>
+		                </td>
+		            </tr>
+		        </table>
+		    </c:otherwise>
+        </c:choose>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_astopics.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_astopics.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/view_astopics.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,365 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+        <c:choose>
+    
+            <c:when test="#{viewSearch.initialized &amp;&amp; viewSearch.topics != null}">
+
+                <a name="top" />
+
+                <div class="forumtitletext">
+                    <h4>
+                        <h:outputFormat value="#{resource.Search_found}">
+                            <f:param value="#{viewSearch.pageNavigator.numberOfEntries}" />
+                        </h:outputFormat>
+                    </h4>
+                </div>
+	    
+			    <!-- PAGINATION -->
+			    <c:if test="#{viewSearch.pageNavigator.totalPages gt 1}">
+			    <div class="forumpagination">
+			        <ul>
+			            <li class="disablepage">
+			                <h:outputFormat value="#{resource.PageNumber}">
+			                    <f:param value="${viewSearch.pageNavigator.pageNumber}"/>
+			                    <f:param value="${viewSearch.pageNavigator.totalPages}"/>
+			                </h:outputFormat>
+			            </li>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq 0}">
+			                    <li class="disablepage">
+			                        ${resource.First}
+			                    </li>
+			                    <li class="disablepage">
+			                        &#60; ${resource.Previous}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="0"/>
+			                            <h:outputText value="${resource.First}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage-1}"/>
+			                            <h:outputText value="&#60; ${resource.Previous}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationLeft}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <li class="currentpage">
+			                ${viewSearch.pageNavigator.currentPage+1}
+			            </li>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationRight}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq (viewSearch.pageNavigator.totalPages-1) }">
+			                    <li class="disablepage">
+			                        ${resource.Next} &#62;
+			                    </li>
+			                    <li class="disablepage">
+			                        ${resource.Last}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage+1}"/>
+			                            <h:outputText value="${resource.Next} &#62;"/>
+			                        </h:outputLink>
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.totalPages-1}"/>
+			                            <h:outputText value="${resource.Last}"/>
+			                        </h:outputLink>
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			        </ul>
+			    </div>
+			    </c:if>
+
+	            <h:form>
+			        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+				        <tr class="header">
+				            <td class="forumheaderfirst" colspan="2">${resource.Topics}</td>
+				            <td class="forumheadercentered">${resource.Replies}</td>
+				            <td class="forumheadercentered">${resource.Views}</td>
+				            <td class="forumheaderlast">${resource.Last_Post}</td>
+				        </tr>
+        
+                        <c:forEach items="#{viewSearch.topics}" var="topicrow" varStatus="status" >
+                            <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+				                
+				                <td class="forumlisticon">
+				                    <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" 
+				                         width="11" height="14"
+				                         alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+				                </td>
+
+				                <td>
+				                    <h3>
+				                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+				                            <f:param name="t" value="${topicrow.id}"/>
+				                            <h:outputText value="${topicrow.subject}"/>                   
+				                        </h:outputLink>
+				                    </h3>
+				                    
+				                    <!-- mini post navigator for this topic -->
+				                    <c:if test="#{forum.topicNavigator[topicrow.id] ne null &amp;&amp; forum.topicNavigator[topicrow.id].totalPages gt 1}">
+				                        &#160;(&#160;
+				                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+				                            <f:param name="t" value="#{topicrow.id}"/>
+				                            <f:param name="page" value="0"/>
+				                            <h:outputText value="${1}"/>
+				                        </h:outputLink>
+				                        &#160;
+				                        <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+				                            <f:param name="t" value="#{topicrow.id}"/>
+				                            <f:param name="page" value="1"/>
+				                            <h:outputText value="${2}"/>
+				                        </h:outputLink>
+				                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+				                            &#160;
+				                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+				                                <f:param name="t" value="#{topicrow.id}"/>
+				                                <f:param name="page" value="2"/>
+				                                <h:outputText value="${3}"/>
+				                            </h:outputLink>
+				                        </c:if>
+				                        <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">                        
+				                            &#160;&#8230;&#160;
+				                            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+				                                <f:param name="t" value="#{topicrow.id}"/>
+				                                <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+				                                <h:outputText value="${resource.Last_page}"/>
+				                            </h:outputLink>
+				                        </c:if>
+				                        &#160;)
+				                    </c:if>
+				                    <br />
+				                    ${resource.By}&#160;
+				                    <c:choose>
+				                        
+				                        <c:when test="#{forum.anonymous}">
+				                            ${topicrow.poster.user.userName}
+				                        </c:when>
+				                       
+				                        <c:otherwise>
+				                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+				                                <f:param name="uid" value="${topicrow.poster.user.id}"/>
+				                                <h:outputText value="${topicrow.poster.user.userName}"/>
+				                            </h:outputLink>
+				                        </c:otherwise>
+				                                    
+				                    </c:choose>
+				                        
+				                </td>
+				                
+			                    <td class="forumlistcentered">${topicrow.replies}</td>
+			                    <td class="forumlistcentered">${topicrow.viewCount}</td>
+			                    <td class="forumlistlast">
+				                    <a href="#{forums:postPermlink(viewSearch.topicLastPosts[topicrow.id].id)}">
+				                        <c:choose>
+				                        
+				                            <c:when test="#{forums:isLongerThan(viewSearch.topicLastPosts[topicrow.id].message.subject,25)}">
+				                                #{forums:subString(viewSearch.topicLastPosts[topicrow.id].message.subject,25)}&#8230;
+				                            </c:when>
+				                            
+				                            <c:otherwise>
+				                                #{viewSearch.topicLastPosts[topicrow.id].message.subject}
+				                            </c:otherwise>
+				                            
+				                        </c:choose>
+				                    </a>
+				                    <br />
+				                    ${resource.By} 
+				                    <c:choose>
+				                    
+				                        <c:when test="#{category.anonymous}">
+				                            ${viewSearch.topicLastPosts[topicrow.id].poster.user.userName}
+				                        </c:when>
+				                                    
+				                        <c:otherwise>
+				                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+				                                <f:param name="uid" value="#{viewSearch.topicLastPosts[topicrow.id].poster.user.id}"/>
+				                                <h:outputText value="${viewSearch.topicLastPosts[topicrow.id].poster.user.userName}"/>
+				                            </h:outputLink>
+				                        </c:otherwise>
+				                                    
+				                    </c:choose>
+				                    <br />
+				                    #{viewSearch.topicLastPosts[topicrow.id].createDate}
+                                </td>
+			                </tr>
+
+                        </c:forEach>
+			
+			        </table>
+	            </h:form>
+
+			    <!-- PAGINATION -->
+			    <c:if test="#{viewSearch.pageNavigator.totalPages gt 1}">
+			    <div class="forumpagination">
+			        <ul>
+			            <li class="disablepage">
+			                <h:outputFormat value="#{resource.PageNumber}">
+			                    <f:param value="${viewSearch.pageNavigator.pageNumber}"/>
+			                    <f:param value="${viewSearch.pageNavigator.totalPages}"/>
+			                </h:outputFormat>
+			            </li>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq 0}">
+			                    <li class="disablepage">
+			                        ${resource.First}
+			                    </li>
+			                    <li class="disablepage">
+			                        &#60; ${resource.Previous}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="0"/>
+			                            <h:outputText value="${resource.First}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage-1}"/>
+			                            <h:outputText value="&#60; ${resource.Previous}"/>
+			                        </h:outputLink>    
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationLeft}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <li class="currentpage">
+			                ${viewSearch.pageNavigator.currentPage+1}
+			            </li>
+			            
+			            <c:forEach items="#{viewSearch.pageNavigator.currentPaginationRight}" var="pageNumber">
+			                <li>
+			                    <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                        <f:param name="page" value="${pageNumber-1}"/>
+			                        <h:outputText value="${pageNumber}"/>
+			                    </h:outputLink>  
+			                </li>
+			            </c:forEach>
+			            
+			            <c:choose>
+			                <c:when test="#{viewSearch.pageNavigator.currentPage eq (viewSearch.pageNavigator.totalPages-1) }">
+			                    <li class="disablepage">
+			                        ${resource.Next} &#62;
+			                    </li>
+			                    <li class="disablepage">
+			                        ${resource.Last}
+			                    </li>
+			                </c:when>
+			                <c:otherwise>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.currentPage+1}"/>
+			                            <h:outputText value="${resource.Next} &#62;"/>
+			                        </h:outputLink>
+			                    </li>
+			                    <li>
+			                        <h:outputLink value="#{forums:outputLink(shared.links['searchResults'],true)}">
+			                            <f:param name="page" value="${viewSearch.pageNavigator.totalPages-1}"/>
+			                            <h:outputText value="${resource.Last}"/>
+			                        </h:outputLink>
+			                    </li>
+			                </c:otherwise>
+			            </c:choose>
+			        </ul>
+			    </div>
+			    </c:if>
+	
+            </c:when>
+	
+		    <c:otherwise>
+		        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+		            <tr>
+		                <td>
+		                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+		                        <tr>
+		                            <td>&#160;</td>
+		                        </tr>
+		                        <tr>
+		                            <td align="center">
+		                                ${resource.Search_topics_not_found}
+		                            </td>
+		                        </tr>
+		                        <tr>
+		                            <td>&#160;</td>
+		                        </tr>
+		                    </table>
+		                </td>
+		            </tr>
+		        </table>
+		    </c:otherwise>
+        </c:choose>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,184 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+<ui:composition template="/views/common/common.xhtml">
+    <ui:define name="mainContent">
+    
+        <c:choose>
+    
+        <c:when test="#{search.initialized}">    
+    
+        <div class="forumbread">
+            <ul>
+                <li class="first">
+                
+                    <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                        <h:outputText value="#{shared.mainPageName}"/>
+                    </h:outputLink>
+                    
+                </li>
+
+            </ul>
+        </div>
+
+        <h:form>
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+        
+            <tr class="header">
+                <td class="forumheaderfirst" colspan="2">Search</td>
+            </tr>
+            
+            <tr class="oddRow">
+                <td class="rowlinefirst" style="width:40%;">
+                    <strong>${resource.Search_keywords}</strong><br />
+                    <span class="note">${resource.Search_keywords_note}</span>
+                </td>
+                <td class="rowline" style="width:60%;">
+                    <h:inputText value="#{search.searchCriteria.keywords}" required="true" style="width:275px;"></h:inputText>
+                </td>
+            </tr>
+
+            <tr class="evenRow">
+                <td class="rowlinefirst">
+                    <strong>${resource.Search_author}</strong><br />
+                    <span class="note">${resource.Search_author_note}</span>
+                </td>
+                <td class="rowline">
+                    <span id=""></span>
+
+                    <h:inputText value="#{search.searchCriteria.author}" style="width:275px;"></h:inputText>
+                </td>
+            </tr>
+        
+            <tr class="header">
+                <td class="forumheaderfirst" colspan="2">${resource.Search_advanced}</td>
+            </tr>
+        
+            <tr class="oddRow">
+                <td class="rowlinefirst">${resource.Search_category}</td>
+    
+                <td class="rowline">
+                    <span id=""></span>
+                    
+                    <h:selectOneMenu value="#{search.searchCriteria.category}">
+                        <f:selectItems value="#{search.categoriesItems}"></f:selectItems>
+                    </h:selectOneMenu>
+                </td>
+            </tr>
+        
+            <tr class="evenRow">
+                <td class="rowlinefirst">${resource.Search_forum}</td>
+                <td class="rowline">
+               
+                    <h:selectOneMenu value="#{search.searchCriteria.forum}">
+                        <f:selectItems value="#{search.forumsItems}"></f:selectItems>
+                    </h:selectOneMenu>
+                </td>
+            </tr>
+            
+            <tr class="oddRow">
+                <td class="rowlinefirst">
+                    ${resource.Search_time_period}<br />           
+                </td>
+               
+                <td class="rowline">
+                    <h:selectOneMenu value="#{search.searchCriteria.timePeriod}">
+                        <f:selectItem itemValue="ALL" itemLabel="#{resource.Search_all_posts}" />
+                        <f:selectItem itemValue="DAY" itemLabel="#{resource.Search_1_day}" />
+                        <f:selectItem itemValue="SEVEN_DAYS" itemLabel="#{resource.Search_7_days}" />
+                        <f:selectItem itemValue="TWO_WEEKS" itemLabel="#{resource.Search_2_weeks}" />
+                        <f:selectItem itemValue="MONTH" itemLabel="#{resource.Search_1_month}" />
+                        <f:selectItem itemValue="THREE_MONTHS" itemLabel="#{resource.Search_3_months}" />
+                        <f:selectItem itemValue="SIX_MONTHS" itemLabel="#{resource.Search_6_months}" />
+                        <f:selectItem itemValue="YEAR" itemLabel="#{resource.Search_1_year}" />
+                    </h:selectOneMenu>
+                </td>
+            </tr>
+            
+            <tr class="evenRow">
+                <td class="rowlinefirst">${resource.Search_searching}</td>
+                <td class="rowline">
+                
+                    <h:selectOneRadio value="#{search.searchCriteria.searching}" required="true" layout="pageDirection">
+                        <f:selectItem itemValue="TITLE_MSG" itemLabel="#{resource.Search_title_message}" />
+                        <f:selectItem itemValue="MSG" itemLabel="#{resource.Search_message}" />
+                    </h:selectOneRadio>                
+                
+                </td>
+            </tr>
+        
+            <tr class="evenRow">
+                <td class="rowlinefirst">${resource.Search_sort}</td>
+                <td class="rowline">
+                    <h:selectOneMenu value="#{search.searchCriteria.sortBy}">
+                        <f:selectItem itemValue="POST_TIME" itemLabel="#{resource.Search_post_time}" />
+                        <f:selectItem itemValue="POST_SUBJECT" itemLabel="#{resource.Search_post_subject}" />
+                        <f:selectItem itemValue="AUTHOR" itemLabel="#{resource.Search_author}" />
+                        <f:selectItem itemValue="FORUM" itemLabel="#{resource.Search_forum}" />
+                    </h:selectOneMenu><br />
+               
+                    <h:selectOneRadio value="#{search.searchCriteria.sortOrder}" required="true" layout="pageDirection">
+                        <f:selectItem itemValue="ASC" itemLabel="#{resource.Search_ascending}" />
+                        <f:selectItem itemValue="DESC" itemLabel="#{resource.Search_descending}" />
+                    </h:selectOneRadio>
+                </td>
+            </tr>
+
+            <tr class="evenRow">
+                <td class="rowlinefirst">${resource.Search_display_as}</td>
+                <td class="rowline">
+                    <h:selectOneRadio value="#{search.searchCriteria.displayAs}" required="true" layout="pageDirection">
+                        <f:selectItem itemValue="POSTS" itemLabel="#{resource.Search_display_as_posts}" />
+                        <f:selectItem itemValue="TOPICS" itemLabel="#{resource.Search_display_as_topics}" />
+                    </h:selectOneRadio>
+                </td>
+            </tr>
+        
+            <tr>
+                <td class="forumformbuttonrow" colspan="2" style="border:0px;">
+                    <h:commandButton type="submit" action="#{search.search}" value="#{resource.Search_search}" styleClass="buttonMed"></h:commandButton>
+                    <h:commandButton type="reset" value="#{resource.Search_reset}" styleClass="buttonMed"></h:commandButton>
+                </td>
+            </tr>
+
+        </table>
+        </h:form>
+        
+        </c:when>
+        
+        </c:choose>
+    
+    </ui:define>
+</ui:composition>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_results.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_results.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/search/viewsearch_results.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,56 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+
+<ui:composition template="/views/common/common.xhtml">
+    <ui:define name="mainContent">
+
+	    <c:choose>
+	        
+	        <c:when test="#{viewSearch.displayAsTopics}">
+	            
+	            <ui:include src="/views/search/view_astopics.xhtml"></ui:include>
+	            
+	        </c:when>
+	        
+	        <c:otherwise>
+	        
+	            <ui:include src="/views/search/view_asposts.xhtml"></ui:include>
+	        
+	        </c:otherwise>
+	        
+	    </c:choose>
+
+    </ui:define>
+</ui:composition>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/summary/viewsummary_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,78 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<div class="forumbread">
+    <ul>
+        <li class="first">
+            <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+                <h:outputText value="#{shared.mainPageName}"/>  					
+            </h:outputLink>
+        </li>
+    </ul>
+</div>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+    <!-- topic type -->
+    <tr class="header">
+        <td class="forumheaderfirst">
+            ${resource[summary.blockTopicsType]}
+        </td>
+    </tr>
+    
+    <!-- a list of topics for the summary-->
+    <c:forEach items="#{summary.topics}" var="topicrow" varStatus="status" >
+    <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+        <td class='${status.last?"bottomline":""}' >
+            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" id="_${status.index}">
+                <f:param name="t" value="#{topicrow.id}"/>
+                <h:outputText value="#{topicrow.subject}"/>  					
+            </h:outputLink>
+        </td>
+    </tr>
+    </c:forEach>
+    
+</table>
+        
+<!-- number of topics found in the summary -->
+<br/> 
+<span class="note">${summary.numberOfTopicsFound}&#160;${resource.L_TOPICS_FOUND}</span>
+<hr />
+
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/attachmentsview.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,107 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+>
+<c:forEach items="#{attachments}" var="attachment">  
+<table class="forumAttachmentTable" border="0" cellpadding="0" cellspacing="0">
+    <tr class="header">
+        <td class="forumHeaderFirst">
+            ${resource.Attachment}:
+        </td>
+        <td class="forumHeaderLast" colspan="2">
+            ${attachment.file.name}
+        </td>
+    </tr>
+    
+    <tr>
+        <td class="labelCell">
+            ${resource.Description}:
+        </td>
+        <td class="valueCell">
+            ${attachment.comment}
+        </td>
+        <td rowspan="3" class="downloadCell">
+            <h:outputLink value="#{forums:contextPath()}/downloadAttachment">
+                <f:param name="id" value="${attachment.id}"/>
+                ${resource.Download}
+            </h:outputLink>
+        </td>
+    </tr>
+    <tr>
+        <td class="labelCell">
+            ${resource.Filesize}:
+        </td>
+        <td class="valueCell">
+            ${attachment.file.size} B
+        </td>
+    </tr>      
+</table>
+
+<!-- 
+
+   <div align="center"><hr width="95%"/></div>
+
+   <table width="95%" border="1" cellpadding="2" cellspacing="0" class="attachtable" align="center">
+      <tr>
+         <td width="100%" colspan="3" class="attachheader" align="center"><b>
+         <span class="gen">${attachment.file.name}</span></b></td>
+      </tr>
+      <tr>
+         <td width="15%" class="attachrow"><span class="genmed">&#160;${resource.Description}:</span></td>
+         <td width="75%" class="attachrow">
+            <table width="100%" border="0" cellpadding="0" cellspacing="4" align="center">  
+               <tr>
+                  <td class="attachrow"><span class="genmed">${attachment.comment}</span></td>
+               </tr>
+            </table>
+         </td>
+         <td rowspan="4" align="center" width="10%" class="attachrow"><br/>
+            <h:outputLink value="#{forums:contextPath()}/downloadAttachment" styleClass="genmed">
+                <f:param name="id" value="${attachment.id}"/>
+                <b>${resource.Download} </b>
+            </h:outputLink>
+         </td>
+      </tr>
+      <tr>
+
+         <td width="15%" class="attachrow"><span class="genmed">&#160;${resource.File_name}:</span></td>
+         <td width="75%" class="attachrow"><span class="genmed">&#160;${attachment.file.name}</span>
+         </td>
+      </tr>
+      <tr>
+         <td width="15%" class="attachrow"><span class="genmed">&#160;${resource.Filesize}:</span></td>
+         <td width="75%" class="attachrow"><span class="genmed">&#160;${attachment.file.size}</span></td>
+      </tr>      
+   </table>
+   <div align="center"><hr width="95%"/></div>-->
+</c:forEach>
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_poll.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_poll.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_poll.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,72 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<div class="dialog">
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+    <tr>
+        <td class="icon">
+            <img src="#{forums:themeURL('resourceIconDialogWarningURL')}" border="0" />
+        </td>
+        <td class="title" width="100%">
+            ${resource.Delete_poll}
+        </td>
+    </tr>
+    <tr>
+        <td class="icon"></td>
+        <td>
+            ${resource.Confirm_delete_poll}
+        </td>
+    </tr>
+    <tr>
+        <td class="buttons" colspan="2">
+            <h:form>
+                <h:commandButton type="submit"
+                                 value="${resource.Yes}"
+                                 styleClass="buttonMed"
+                                 action="#{editPost.deletePoll}"/>
+                <h:commandButton type="button"
+                                 value="${resource.No}"
+                                 styleClass="buttonMed"
+                                 onclick="javascript:history.back();"/>
+            </h:form>
+        </td>
+    </tr>
+</table>
+</div>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_post.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_post.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/delete_post.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,79 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+<div class="dialog">
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+    <tr>
+        <td class="icon">
+            <img src="#{forums:themeURL('resourceIconDialogWarningURL')}" border="0" />
+        </td>
+        <td class="title" width="100%">
+            ${resource.Delete_post}
+        </td>
+    </tr>
+    <tr>
+        <td class="icon"></td>
+        <td>
+            <h:outputFormat value="#{resource.Post_deletion_info}">
+                <f:param value="${deletePost.post.message.subject}"/>
+            </h:outputFormat>
+            <br/>
+            ${resource.Confirm_delete}
+        </td>
+    </tr>
+    <tr>
+        <td class="buttons" colspan="2">
+            <h:form>
+	            <input type="hidden" name="t" value="#{param['t']}"/>	            
+	            <input type="hidden" name="f" value="#{param['f']}"/>
+                <h:inputHidden value="#{deletePost.postId}" />
+                <h:commandButton type="submit"
+                                 value="${resource.Yes}"
+                                 styleClass="buttonMed"
+                                 action="#{deletePost.confirmDelete}"/>
+                <h:commandButton type="button"
+                                 value="${resource.No}"
+                                 styleClass="buttonMed"
+                                 onclick="javascript:history.back();"/>
+            </h:form>
+        </td>
+    </tr>
+</table>
+</div>
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,798 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+
+<script language="JavaScript" type="text/javascript">
+&lt;!--
+// bbCode control by
+// subBlue design
+// www.subBlue.com
+
+// Startup variables
+var imageTag = false;
+var theSelection = false;
+
+// Check for Browser &amp; Platform for PC &amp; IE specific bits
+// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
+var clientPC = navigator.userAgent.toLowerCase(); // Get client info
+var clientVer = parseInt(navigator.appVersion); // Get browser version
+
+var is_ie = ((clientPC.indexOf("msie") != -1) &amp;&amp; (clientPC.indexOf("opera") == -1));
+var is_nav = ((clientPC.indexOf('mozilla')!=-1) &amp;&amp; (clientPC.indexOf('spoofer')==-1)
+                &amp;&amp; (clientPC.indexOf('compatible') == -1) &amp;&amp; (clientPC.indexOf('opera')==-1)
+                &amp;&amp; (clientPC.indexOf('webtv')==-1) &amp;&amp; (clientPC.indexOf('hotjava')==-1));
+var is_moz = 0;
+
+var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
+var is_mac = (clientPC.indexOf("mac")!=-1);
+
+// Helpline messages
+b_help = "${resource.bbcode_b_help}";
+i_help = "${resource.bbcode_i_help}";
+u_help = "${resource.bbcode_u_help}";
+q_help = "${resource.bbcode_q_help}";
+c_help = "${resource.bbcode_c_help}";
+l_help = "${resource.bbcode_l_help}";
+o_help = "${resource.bbcode_o_help}";
+p_help = "${resource.bbcode_p_help}";
+w_help = "${resource.bbcode_w_help}";
+a_help = "${resource.bbcode_a_help}";
+s_help = "${resource.bbcode_s_help}";
+f_help = "${resource.bbcode_f_help}";
+
+// Define the bbCode tags
+bbcode = new Array();
+bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
+imageTag = false;
+
+// Shows the help messages in the helpline window
+function helpline(help) {
+	document.post.helpbox.value = eval(help + "_help");
+}
+
+
+// Replacement for arrayname.length property
+function getarraysize(thearray) {
+	for (i = 0; i &lt; thearray.length; i++) {
+		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
+			return i;
+		}
+	return thearray.length;
+}
+
+// Replacement for arrayname.push(value) not implemented in IE until version 5.5
+// Appends element to the array
+function arraypush(thearray,value) {
+	thearray[ getarraysize(thearray) ] = value;
+}
+
+// Replacement for arrayname.pop() not implemented in IE until version 5.5
+// Removes and returns the last element of an array
+function arraypop(thearray) {
+	thearraysize = getarraysize(thearray);
+	retval = thearray[thearraysize - 1];
+	delete thearray[thearraysize - 1];
+	return retval;
+}
+
+
+function checkForm() {
+
+	formErrors = false;    
+
+	if (document.post["post:message"].value.length &lt; 2) {
+		formErrors = "${resource.Empty_message}";
+	}
+
+	if (formErrors) {
+		alert(formErrors);
+		return false;
+	} else {
+		bbstyle(-1);
+		//formObj.preview.disabled = true;
+		//formObj.submit.disabled = true;
+		return true;
+	}
+}
+
+function emoticon(text) {
+	var txtarea = document.post["post:message"];
+	text = ' ' + text + ' ';
+	if (txtarea.createTextRange &amp;&amp; txtarea.caretPos) {
+		var caretPos = txtarea.caretPos;
+		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
+		txtarea.focus();
+	} else {
+		txtarea.value  += text;
+		txtarea.focus();
+	}
+}
+
+function bbfontstyle(bbopen, bbclose) {
+	var txtarea = document.post["post:message"];
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win) {
+		theSelection = document.selection.createRange().text;
+		if (!theSelection) {
+			txtarea.value += bbopen + bbclose;
+			txtarea.focus();
+			return;
+		}
+		document.selection.createRange().text = bbopen + theSelection + bbclose;
+		txtarea.focus();
+		return;
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbopen, bbclose);
+		return;
+	}
+	else
+	{
+		txtarea.value += bbopen + bbclose;
+		txtarea.focus();
+	}
+	storeCaret(txtarea);
+}
+
+
+function bbstyle(bbnumber) {
+	var txtarea = document.post["post:message"];
+
+	txtarea.focus();
+	donotinsert = false;
+	theSelection = false;
+	bblast = 0;
+
+	if (bbnumber == -1) { // Close all open tags &amp; default button names
+		while (bbcode[0]) {
+			butnumber = arraypop(bbcode) - 1;
+			txtarea.value += bbtags[butnumber + 1];
+			buttext = eval('document.post.addbbcode' + butnumber + '.value');
+			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+		}
+		imageTag = false; // All tags are closed including image tags :D
+		txtarea.focus();
+		return;
+	}
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win)
+	{
+		theSelection = document.selection.createRange().text; // Get text selection
+		if (theSelection) {
+			// Add tags around selection
+			document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
+			txtarea.focus();
+			theSelection = '';
+			return;
+		}
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
+		return;
+	}
+	
+	// Find last occurance of an open tag the same as the one just clicked
+	for (i = 0; i &lt; bbcode.length; i++) {
+		if (bbcode[i] == bbnumber+1) {
+			bblast = i;
+			donotinsert = true;
+		}
+	}
+
+	if (donotinsert) {		// Close all open tags up to the one just clicked &amp; default button names
+		while (bbcode[bblast]) {
+				butnumber = arraypop(bbcode) - 1;
+				txtarea.value += bbtags[butnumber + 1];
+				buttext = eval('document.post.addbbcode' + butnumber + '.value');
+				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+				imageTag = false;
+			}
+			txtarea.focus();
+			return;
+	} else { // Open tags
+	
+		if (imageTag &amp;&amp; (bbnumber != 14)) {		// Close image tag before adding another
+			txtarea.value += bbtags[15];
+			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
+			document.post.addbbcode14.value = "Img";	// Return button back to normal state
+			imageTag = false;
+		}
+		
+		// Open tag
+		txtarea.value += bbtags[bbnumber];
+		if ((bbnumber == 14) &amp;&amp; (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
+		arraypush(bbcode,bbnumber+1);
+		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
+		txtarea.focus();
+		return;
+	}
+	storeCaret(txtarea);
+}
+
+// From http://www.massless.org/mozedit/
+function mozWrap(txtarea, open, close)
+{
+	var selLength = txtarea.textLength;
+	var selStart = txtarea.selectionStart;
+	var selEnd = txtarea.selectionEnd;
+	if (selEnd == 1 || selEnd == 2) 
+		selEnd = selLength;
+
+	var s1 = (txtarea.value).substring(0,selStart);
+	var s2 = (txtarea.value).substring(selStart, selEnd)
+	var s3 = (txtarea.value).substring(selEnd, selLength);
+	txtarea.value = s1 + open + s2 + close + s3;
+	return;
+}
+
+// Insert at Claret position. Code from
+// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
+function storeCaret(textEl) {
+	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
+}
+
+function selectOption(optionVal)
+{
+	document.post.o.value = optionVal;
+}
+
+function selectAttachment(attachmentVal)
+{
+	document.post.ATTACHMENT.value = attachmentVal;
+}
+
+//--&gt;
+</script>
+
+<c:if test="#{editPost.preview}">
+    <ui:include src="/views/topics/posting_edit_preview.xhtml"/>
+    <br clear="all"/>
+</c:if>
+
+<div class="forumtitletext">
+    <h4>${resource.Edit_Post}</h4>
+    <h:messages errorClass="failuretext" layout="table" />
+</div>
+
+<div class="PostviewStyle">
+<h:form id="post" enctype="multipart/form-data">
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+
+    <!-- keeps the topic where this post is being edited in context, this is a control parameter -->
+    <input type="hidden" name="t" value="#{editPost.topicId}"/>
+    <input type="hidden" name="p" value="#{editPost.postId}"/>
+    
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">${resource.Compose_Message}</td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">${resource.Posting_Description}</td>
+    </tr>
+    
+    <!-- add Subject -->
+    <tr class="PostViewUnderlineBoth">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Subject}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{editPost.subject}" maxlength="200" id="SubjectInputText"
+                         size="45" style="width: 450px;" tabindex="2" />
+        </td>
+    </tr>
+    
+    <!-- Add Message -->
+    <tr>
+        <td valign="top">
+            <table border="0" cellpadding="1" cellspacing="0" width="100%">
+                <tbody>
+                    <tr>
+                        <td>
+                            <label class="forumformlabelbold">
+                                ${resource.Message_body}
+                            </label>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td align="center" valign="middle">
+                            <br />
+                            <table border="0" cellpadding="5" cellspacing="0" width="100">
+                                <tbody>
+                                    <tr align="center">
+                                        <td>
+                                            <b></b>
+                                        </td>
+                                    </tr>
+                                </tbody>
+                            </table>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </td>
+		<td valign="top">
+            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumline">
+            <tbody>
+                <tr>
+                    <td class="row2" valign="top">
+                        <span class="genmed"></span>
+                        <table border="0" cellpadding="2" cellspacing="0" width="450">
+                        <tbody>
+                            <tr align="center" valign="middle">
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="b"
+                                               name="addbbcode0" value=" B " style="font-weight:bold; width: 30px"
+                                               onClick="bbstyle(0)" onMouseOver="helpline('b')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="i"
+                                               name="addbbcode2" value=" i " style="font-style:italic; width: 30px"
+                                               onClick="bbstyle(2)" onMouseOver="helpline('i')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="u"
+                                               name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px"
+                                               onClick="bbstyle(4)" onMouseOver="helpline('u')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="q"
+                                               name="addbbcode6" value="Quote" style="width: 50px"
+                                               onClick="bbstyle(6)" onMouseOver="helpline('q')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="c"
+                                               name="addbbcode8" value="Code" style="width: 40px"
+                                               onClick="bbstyle(8)" onMouseOver="helpline('c')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="l"
+                                               name="addbbcode10" value="List" style="width: 40px"
+                                               onClick="bbstyle(10)" onMouseOver="helpline('l')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="o"
+                                               name="addbbcode12" value="List=" style="width: 40px"
+                                               onClick="bbstyle(12)" onMouseOver="helpline('o')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="p"
+                                               name="addbbcode14" value="Img" style="width: 40px"
+                                               onClick="bbstyle(14)" onMouseOver="helpline('p')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="w"
+                                               name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px"
+                                               onClick="bbstyle(16)" onMouseOver="helpline('w')"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                    <tbody>
+                                        <tr>
+                                            <td>
+                                                <span class="genmed">
+                                                    &#160;${resource.Font_color}:
+                                                    <select name="addbbcode18"
+                                                            onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;"
+                                                            onMouseOver="helpline('s')">
+                                                        <option style="color:black; background-color: "
+                                                                value="" class="genmed">
+                                                            ${resource.color_default}
+                                                        </option>
+                                                        <option style="color:darkred; background-color: "
+                                                                value="darkred" class="genmed">
+                                                            ${resource.color_dark_red}
+                                                        </option>
+                                                        <option style="color:red; background-color: "
+                                                                value="red" class="genmed">
+                                                            ${resource.color_red}
+                                                        </option>
+                                                        <option style="color:orange; background-color: "
+                                                                value="orange" class="genmed">
+                                                            ${resource.color_orange}
+                                                        </option>
+                                                        <option style="color:brown; background-color: "
+                                                                value="brown" class="genmed">
+                                                            ${resource.color_brown}
+                                                        </option>
+                                                        <option style="color:yellow; background-color: "
+                                                                value="yellow" class="genmed">
+                                                            ${resource.color_yellow}
+                                                        </option>
+                                                        <option style="color:green; background-color: "
+                                                                value="green" class="genmed">
+                                                            ${resource.color_green}
+                                                        </option>
+                                                        <option style="color:olive; background-color: "
+                                                                value="olive" class="genmed">
+                                                            ${resource.color_olive}
+                                                        </option>
+                                                        <option style="color:cyan; background-color: "
+                                                                value="cyan" class="genmed">
+                                                            ${resource.color_cyan}
+                                                        </option>
+                                                        <option style="color:blue; background-color: "
+                                                                value="blue" class="genmed">
+                                                            ${resource.color_blue}
+                                                        </option>
+                                                        <option style="color:darkblue; background-color: "
+                                                                value="darkblue" class="genmed">
+                                                            ${resource.color_dark_blue}
+                                                        </option>
+                                                        <option style="color:indigo; background-color: "
+                                                                value="indigo" class="genmed">
+                                                            ${resource.color_indigo}
+                                                        </option>
+                                                        <option style="color:violet; background-color: "
+                                                                value="violet" class="genmed">
+                                                            ${resource.color_violet}
+                                                        </option>
+                                                        <option style="color:white; background-color: "
+                                                                value="white" class="genmed">
+                                                            ${resource.color_white}
+                                                        </option>
+                                                        <option style="color:black; background-color: "
+                                                                value="black" class="genmed">
+                                                            ${resource.color_black}
+                                                        </option>
+                                                    </select>
+                                                    &#160;${resource.Font_size}:
+                                                    <select name="addbbcode20"
+                                                            onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')"
+                                                            onMouseOver="helpline('f')">
+                                                        <option value="7" class="genmed">
+                                                            ${resource.font_tiny}
+                                                        </option>
+                                                        <option value="9" class="genmed">
+                                                            ${resource.font_small}
+                                                        </option>
+                                                        <option value="12" class="genmed" selected="true">
+                                                            ${resource.font_normal}
+                                                        </option>
+                                                        <option value="18" class="genmed">
+                                                            ${resource.font_large}
+                                                        </option>
+                                                        <option value="24" class="genmed">
+                                                            ${resource.font_huge}
+                                                        </option>
+                                                    </select>
+                                                </span>
+                                            </td>
+                                            <td nowrap="nowrap" align="right">
+                                                <span class="gensmall">
+                                                    <a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">
+                                                        ${resource.Close_Tags}
+                                                    </a>
+                                                </span>
+                                            </td>
+                                        </tr>
+                                    </tbody>
+                                    </table>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <span class="gensmall">
+                                        <input type="text" name="helpbox" size="45" maxlength="100"
+                                               style="width:450px; font-size:10px"
+                                               class="helpline" value="${resource.Styles_tip}"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <h:inputTextarea id="message" value="#{editPost.message}"
+                                                     rows="15" cols="35"
+                                                     tabindex="3"
+                                                     styleClass="Posttextarea"
+                                                     onselect="storeCaret(this);"
+                                                     onkeyup="storeCaret(this);"
+                                                     onclick="storeCaret(this)" />
+                                </td>
+                            </tr>
+                        </tbody>
+                        </table>
+                    </td>
+                </tr>
+            </tbody>
+            </table>
+        </td>
+    </tr>
+    
+    <!-- subject and message invisible input for validator execution workaround -->
+    <h:inputHidden id="validator" value="validator">
+        <f:validator validatorId="subjectLengthValidator" />
+        <f:validator validatorId="messageLengthValidator" />
+    </h:inputHidden>
+
+    <!-- Add Options -->
+    <c:if test="#{editPost.firstPost}">
+    <forums:isAllowed fragment="acl://topicType" contextData="#{editPost.forumId}">
+    <tr class="PostViewUnderlineBoth">
+        <td valign="top">
+            <label class="forumformlabelbold">
+                ${resource.Options}
+            </label>
+        </td>
+        <td>
+            ${resource.Post_topic_as}:
+            <h:selectOneRadio value="#{editPost.topicType}" styleClass="gen">
+                <f:selectItem itemValue="0" itemLabel="${resource.Post_Normal}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+                <f:selectItem itemValue="1" itemLabel="${resource.Post_Sticky}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+                <f:selectItem itemValue="2" itemLabel="${resource.Post_Announcement}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    </forums:isAllowed>
+    </c:if>
+    
+    <!-- poll ui -->
+    <forums:isAllowed fragment="acl://managePoll">
+    <c:if test="#{editPost.firstPost}">
+    
+	<tr class="PostViewMainHeader">
+        <td colspan="2">
+            ${resource.Add_poll}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Add_poll_explain}
+        </td>
+    </tr>
+    
+    <!-- setup poll question -->
+    <tr>
+        <td class="PostViewUnderline">
+            <label class="forumformlabelbold">
+                ${resource.Poll_question}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{editPost.question}" id="question" maxlength="255" style="width: 450px;"/>
+        </td>
+    </tr>
+    
+    <!-- update poll options already added -->
+    <input type="hidden" name="o"/>
+    <c:forEach items="${editPost.options}" var="optionRow" varStatus="idx">
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_option}
+            </label>
+        </td>
+        <td>
+            <h:inputText id="option_${idx.index+1}" name="option_${idx.index+1}"
+                   value="${optionRow}" style="width: 300px;" maxlength="255"/>
+            &#160;
+            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{editPost.updateOption}" value="${resource.Update}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{editPost.deleteOption}" value="${resource.Delete}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+        </td>
+    </tr>
+    </c:forEach>
+    
+    <!-- add poll options -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_option}
+            </label>
+        </td>
+        <td>  		
+            <h:inputText value="#{editPost.option}" id="newOption" maxlength="255" style="width: 300px;"/>
+            &#160;   	
+            <h:commandButton action="#{editPost.addOption}"
+                             value="${resource.Add_option}"
+                             styleClass="buttonMed"/>
+        </td>
+    </tr>
+		
+		
+    <!-- setup poll duration -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_for}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{editPost.activeDuration}" id="pollDuration" size="3" maxlength="3">
+                <f:converter  converterId="pollDurationConverter" />
+            </h:inputText>
+            &#160;
+            <strong>
+                ${resource.Days}
+            </strong>
+            &#160;
+            ${resource.Poll_for_explain}
+        </td>
+    </tr>
+    
+    <!-- poll invisible input for validator execution workaround -->
+    <h:inputHidden id="execute" value="execute">
+        <f:validator validatorId="pollValidator" />
+    </h:inputHidden>
+    
+    </c:if>
+    </forums:isAllowed>
+    
+    <!-- attachment ui -->
+    <forums:isAllowed fragment="acl://managePostAttachments">
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Add_attachment_title}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Add_attachment_explain}
+        </td>
+    </tr>
+    
+    <!-- upload button -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            <t:inputFileUpload value="#{editPost.attachment}" size="40" styleClass="post"/>
+        </td>
+    </tr>
+    
+    <!-- comment -->
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea value="#{editPost.attachmentComment}" rows="3" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton action="#{editPost.addAttachment}" value="${resource.Add_attachment}" styleClass="buttonMed"/>
+        </td>
+    </tr>
+    
+    <c:if test="#{editPost.numberOfAttachments>0}">
+    <tr>
+        <th class="thHead" colspan="2">${resource.Posted_attachments}</th>
+    </tr>
+	
+	<!-- uploaded list of attachments -->
+    <input type="hidden" name="ATTACHMENT"/>
+    <c:forEach items="#{editPost.attachments}" var="attachRow" varStatus="idx">
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            ${attachRow.fileName}
+        </td>
+    </tr>
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{editPost.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            &#160;
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+        </td>
+    </tr>
+    </c:forEach>
+    </c:if>
+    </forums:isAllowed>
+</table>
+    
+<!-- hookup the buttons -->
+<div class="forumformbuttonrow">
+    <ul>
+        <li>
+            <h:commandButton action="#{editPost.preview}" value="${resource.Preview}"
+                             id="Preview"
+                             styleClass="buttonMed"
+                             tabindex="5"/>
+        </li>
+        <li>
+            <!--TODO: Missing execution of javascript checking form - onclick="return checkForm(this.parentNode)" -->
+            <h:commandButton action="#{editPost.execute}" value="${resource.Submit}"
+                             id="Submit"
+                             styleClass="buttonMed"
+                             accesskey="s" tabindex="6"/>
+        </li>
+        <li>
+            <h:commandButton action="#{editPost.cancel}" value="${resource.Cancel}"
+                             id="Cancel" accesskey="c" tabindex="7" styleClass="buttonMed"/>
+        </li>
+    </ul>
+</div>
+</h:form>
+</div>
+
+</ui:define>
+</ui:composition>
+
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_preview.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_preview.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_preview.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,61 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="PostviewStyle">
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Preview}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Posted}: ${editPost.postDate}
+            &#160;&#160;&#160; ${resource.Post_subject}: ${editPost.subject}
+        </td>
+    </tr>
+    <tr>
+        <td class="row1">
+            <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                    <td>
+                        <span class="postbody">
+                            <h:outputText value="#{forums:formatMessage(editPost.message,false)}" escape="false" />
+                        </span>
+                    </td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+<hr />
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,795 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+
+<script language="JavaScript" type="text/javascript">
+&lt;!--
+// bbCode control by
+// subBlue design
+// www.subBlue.com
+
+// Startup variables
+var imageTag = false;
+var theSelection = false;
+
+// Check for Browser &amp; Platform for PC &amp; IE specific bits
+// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
+var clientPC = navigator.userAgent.toLowerCase(); // Get client info
+var clientVer = parseInt(navigator.appVersion); // Get browser version
+
+var is_ie = ((clientPC.indexOf("msie") != -1) &amp;&amp; (clientPC.indexOf("opera") == -1));
+var is_nav = ((clientPC.indexOf('mozilla')!=-1) &amp;&amp; (clientPC.indexOf('spoofer')==-1)
+                &amp;&amp; (clientPC.indexOf('compatible') == -1) &amp;&amp; (clientPC.indexOf('opera')==-1)
+                &amp;&amp; (clientPC.indexOf('webtv')==-1) &amp;&amp; (clientPC.indexOf('hotjava')==-1));
+var is_moz = 0;
+
+var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
+var is_mac = (clientPC.indexOf("mac")!=-1);
+
+// Helpline messages
+b_help = "${resource.bbcode_b_help}";
+i_help = "${resource.bbcode_i_help}";
+u_help = "${resource.bbcode_u_help}";
+q_help = "${resource.bbcode_q_help}";
+c_help = "${resource.bbcode_c_help}";
+l_help = "${resource.bbcode_l_help}";
+o_help = "${resource.bbcode_o_help}";
+p_help = "${resource.bbcode_p_help}";
+w_help = "${resource.bbcode_w_help}";
+a_help = "${resource.bbcode_a_help}";
+s_help = "${resource.bbcode_s_help}";
+f_help = "${resource.bbcode_f_help}";
+
+// Define the bbCode tags
+bbcode = new Array();
+bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
+imageTag = false;
+
+// Shows the help messages in the helpline window
+function helpline(help) {
+	document.post.helpbox.value = eval(help + "_help");
+}
+
+
+// Replacement for arrayname.length property
+function getarraysize(thearray) {
+	for (i = 0; i &lt; thearray.length; i++) {
+		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
+			return i;
+		}
+	return thearray.length;
+}
+
+// Replacement for arrayname.push(value) not implemented in IE until version 5.5
+// Appends element to the array
+function arraypush(thearray,value) {
+	thearray[ getarraysize(thearray) ] = value;
+}
+
+// Replacement for arrayname.pop() not implemented in IE until version 5.5
+// Removes and returns the last element of an array
+function arraypop(thearray) {
+	thearraysize = getarraysize(thearray);
+	retval = thearray[thearraysize - 1];
+	delete thearray[thearraysize - 1];
+	return retval;
+}
+
+
+function checkForm() {
+
+	formErrors = false;    
+
+	if (document.post["post:message"].value.length &lt; 2) {
+		formErrors = "${resource.Empty_message}";
+	}
+
+	if (formErrors) {
+		alert(formErrors);
+		return false;
+	} else {
+		bbstyle(-1);
+		//formObj.preview.disabled = true;
+		//formObj.submit.disabled = true;
+		return true;
+	}
+}
+
+function emoticon(text) {
+	var txtarea = document.post["post:message"];
+	text = ' ' + text + ' ';
+	if (txtarea.createTextRange &amp;&amp; txtarea.caretPos) {
+		var caretPos = txtarea.caretPos;
+		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
+		txtarea.focus();
+	} else {
+		txtarea.value  += text;
+		txtarea.focus();
+	}
+}
+
+function bbfontstyle(bbopen, bbclose) {
+	var txtarea = document.post["post:message"];
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win) {
+		theSelection = document.selection.createRange().text;
+		if (!theSelection) {
+			txtarea.value += bbopen + bbclose;
+			txtarea.focus();
+			return;
+		}
+		document.selection.createRange().text = bbopen + theSelection + bbclose;
+		txtarea.focus();
+		return;
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbopen, bbclose);
+		return;
+	}
+	else
+	{
+		txtarea.value += bbopen + bbclose;
+		txtarea.focus();
+	}
+	storeCaret(txtarea);
+}
+
+
+function bbstyle(bbnumber) {
+	var txtarea = document.post["post:message"];
+
+	txtarea.focus();
+	donotinsert = false;
+	theSelection = false;
+	bblast = 0;
+
+	if (bbnumber == -1) { // Close all open tags &amp; default button names
+		while (bbcode[0]) {
+			butnumber = arraypop(bbcode) - 1;
+			txtarea.value += bbtags[butnumber + 1];
+			buttext = eval('document.post.addbbcode' + butnumber + '.value');
+			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+		}
+		imageTag = false; // All tags are closed including image tags :D
+		txtarea.focus();
+		return;
+	}
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win)
+	{
+		theSelection = document.selection.createRange().text; // Get text selection
+		if (theSelection) {
+			// Add tags around selection
+			document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
+			txtarea.focus();
+			theSelection = '';
+			return;
+		}
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
+		return;
+	}
+	
+	// Find last occurance of an open tag the same as the one just clicked
+	for (i = 0; i &lt; bbcode.length; i++) {
+		if (bbcode[i] == bbnumber+1) {
+			bblast = i;
+			donotinsert = true;
+		}
+	}
+
+	if (donotinsert) {		// Close all open tags up to the one just clicked &amp; default button names
+		while (bbcode[bblast]) {
+				butnumber = arraypop(bbcode) - 1;
+				txtarea.value += bbtags[butnumber + 1];
+				buttext = eval('document.post.addbbcode' + butnumber + '.value');
+				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+				imageTag = false;
+			}
+			txtarea.focus();
+			return;
+	} else { // Open tags
+	
+		if (imageTag &amp;&amp; (bbnumber != 14)) {		// Close image tag before adding another
+			txtarea.value += bbtags[15];
+			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
+			document.post.addbbcode14.value = "Img";	// Return button back to normal state
+			imageTag = false;
+		}
+		
+		// Open tag
+		txtarea.value += bbtags[bbnumber];
+		if ((bbnumber == 14) &amp;&amp; (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
+		arraypush(bbcode,bbnumber+1);
+		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
+		txtarea.focus();
+		return;
+	}
+	storeCaret(txtarea);
+}
+
+// From http://www.massless.org/mozedit/
+function mozWrap(txtarea, open, close)
+{
+	var selLength = txtarea.textLength;
+	var selStart = txtarea.selectionStart;
+	var selEnd = txtarea.selectionEnd;
+	if (selEnd == 1 || selEnd == 2) 
+		selEnd = selLength;
+
+	var s1 = (txtarea.value).substring(0,selStart);
+	var s2 = (txtarea.value).substring(selStart, selEnd)
+	var s3 = (txtarea.value).substring(selEnd, selLength);
+	txtarea.value = s1 + open + s2 + close + s3;
+	return;
+}
+
+// Insert at Claret position. Code from
+// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
+function storeCaret(textEl) {
+	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
+}
+
+function selectOption(optionVal)
+{
+	document.post.o.value = optionVal;
+}
+
+function selectAttachment(attachmentVal)
+{
+	document.post.ATTACHMENT.value = attachmentVal;
+}
+
+//--&gt;
+</script>
+
+<c:if test="#{newTopic.preview}">
+    <ui:include src="/views/topics/posting_new_preview.xhtml"/>
+    <br clear="all"/>
+</c:if>
+
+<div class="forumtitletext">
+    <h4>${resource.Post_a_new_topic}</h4>
+    <h:messages errorClass="failuretext" layout="table" />
+</div>
+
+<div class="PostviewStyle">
+<h:form id="post" enctype="multipart/form-data">
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+
+    <!-- keeps the forum where this topic is being created in context, this is a control parameter -->
+    <input type="hidden" name="f" value="#{newTopic.forumId}"/>
+    
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">${resource.Compose_Message}</td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">${resource.Posting_Description}</td>
+    </tr>
+    
+    <!-- add Subject -->
+    <tr class="PostViewUnderlineBoth">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Subject}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{newTopic.subject}" maxlength="200" id="SubjectInputText" 
+                         size="45" style="width: 450px;" tabindex="2" />
+        </td>
+    </tr>
+    
+    <!-- Add Message -->
+    <tr>
+        <td valign="top">
+            <table border="0" cellpadding="1" cellspacing="0" width="100%">
+                <tbody>
+                    <tr>
+                        <td>
+                            <label class="forumformlabelbold">
+                                ${resource.Message_body}
+                            </label>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td align="center" valign="middle">
+                            <br />
+                            <table border="0" cellpadding="5" cellspacing="0" width="100">
+                                <tbody>
+                                    <tr align="center">
+                                        <td>
+                                            <b></b>
+                                        </td>
+                                    </tr>
+                                </tbody>
+                            </table>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </td>
+		<td valign="top">
+            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumline">
+            <tbody>
+                <tr>
+                    <td class="row2" valign="top">
+                        <span class="genmed"></span>
+                        <table border="0" cellpadding="2" cellspacing="0" width="450">
+                        <tbody>
+                            <tr align="center" valign="middle">
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="b"
+                                               name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;"
+                                               onClick="bbstyle(0)" onMouseOver="helpline('b')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="i"
+                                               name="addbbcode2" value=" i " style="font-style:italic; width: 30px;"
+                                               onClick="bbstyle(2)" onMouseOver="helpline('i')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="u"
+                                               name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;"
+                                               onClick="bbstyle(4)" onMouseOver="helpline('u')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="q"
+                                               name="addbbcode6" value="Quote" style="width: 50px;"
+                                               onClick="bbstyle(6)" onMouseOver="helpline('q')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="c"
+                                               name="addbbcode8" value="Code" style="width: 40px;"
+                                               onClick="bbstyle(8)" onMouseOver="helpline('c')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="l"
+                                               name="addbbcode10" value="List" style="width: 40px;"
+                                               onClick="bbstyle(10)" onMouseOver="helpline('l')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="o"
+                                               name="addbbcode12" value="List=" style="width: 40px;"
+                                               onClick="bbstyle(12)" onMouseOver="helpline('o')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="p"
+                                               name="addbbcode14" value="Img" style="width: 40px;"
+                                               onClick="bbstyle(14)" onMouseOver="helpline('p')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="w"
+                                               name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px;"
+                                               onClick="bbstyle(16)" onMouseOver="helpline('w')"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                    <tbody>
+                                        <tr>
+                                            <td>
+                                                <span class="genmed">
+                                                    &#160;${resource.Font_color}:
+                                                    <select name="addbbcode18"
+                                                            onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;"
+                                                            onMouseOver="helpline('s')">
+                                                        <option style="color:black; background-color: "
+                                                                value="" class="genmed">
+                                                            ${resource.color_default}
+                                                        </option>
+                                                        <option style="color:darkred; background-color: "
+                                                                value="darkred" class="genmed">
+                                                            ${resource.color_dark_red}
+                                                        </option>
+                                                        <option style="color:red; background-color: "
+                                                                value="red" class="genmed">
+                                                            ${resource.color_red}
+                                                        </option>
+                                                        <option style="color:orange; background-color: "
+                                                                value="orange" class="genmed">
+                                                            ${resource.color_orange}
+                                                        </option>
+                                                        <option style="color:brown; background-color: "
+                                                                value="brown" class="genmed">
+                                                            ${resource.color_brown}
+                                                        </option>
+                                                        <option style="color:yellow; background-color: "
+                                                                value="yellow" class="genmed">
+                                                            ${resource.color_yellow}
+                                                        </option>
+                                                        <option style="color:green; background-color: "
+                                                                value="green" class="genmed">
+                                                            ${resource.color_green}
+                                                        </option>
+                                                        <option style="color:olive; background-color: "
+                                                                value="olive" class="genmed">
+                                                            ${resource.color_olive}
+                                                        </option>
+                                                        <option style="color:cyan; background-color: "
+                                                                value="cyan" class="genmed">
+                                                            ${resource.color_cyan}
+                                                        </option>
+                                                        <option style="color:blue; background-color: "
+                                                                value="blue" class="genmed">
+                                                            ${resource.color_blue}
+                                                        </option>
+                                                        <option style="color:darkblue; background-color: "
+                                                                value="darkblue" class="genmed">
+                                                            ${resource.color_dark_blue}
+                                                        </option>
+                                                        <option style="color:indigo; background-color: "
+                                                                value="indigo" class="genmed">
+                                                            ${resource.color_indigo}
+                                                        </option>
+                                                        <option style="color:violet; background-color: "
+                                                                value="violet" class="genmed">
+                                                            ${resource.color_violet}
+                                                        </option>
+                                                        <option style="color:white; background-color: "
+                                                                value="white" class="genmed">
+                                                            ${resource.color_white}
+                                                        </option>
+                                                        <option style="color:black; background-color: "
+                                                                value="black" class="genmed">
+                                                            ${resource.color_black}
+                                                        </option>
+                                                    </select>
+                                                    &#160;${resource.Font_size}:
+                                                    <select name="addbbcode20"
+                                                            onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')"
+                                                            onMouseOver="helpline('f')">
+                                                        <option value="7" class="genmed">
+                                                            ${resource.font_tiny}
+                                                        </option>
+                                                        <option value="9" class="genmed">
+                                                            ${resource.font_small}
+                                                        </option>
+                                                        <option value="12" class="genmed" selected="true">
+                                                            ${resource.font_normal}
+                                                        </option>
+                                                        <option value="18" class="genmed">
+                                                            ${resource.font_large}
+                                                        </option>
+                                                        <option value="24" class="genmed">
+                                                            ${resource.font_huge}
+                                                        </option>
+                                                    </select>
+                                                </span>
+                                            </td>
+                                            <td nowrap="nowrap" align="right">
+                                                <span class="gensmall">
+                                                    <a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">
+                                                        ${resource.Close_Tags}
+                                                    </a>
+                                                </span>
+                                            </td>
+                                        </tr>
+                                    </tbody>
+                                    </table>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <span class="gensmall">
+                                        <input type="text" name="helpbox" size="45" maxlength="100"
+                                               style="width:450px; font-size:10px"
+                                               class="helpline" value="${resource.Styles_tip}"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <h:inputTextarea id="message" value="#{newTopic.message}"
+                                                     rows="15" cols="35"
+                                                     tabindex="3"
+                                                     styleClass="Posttextarea"
+                                                     onselect="storeCaret(this);"
+                                                     onkeyup="storeCaret(this);"
+                                                     onclick="storeCaret(this)" />
+                                </td>
+                            </tr>
+                        </tbody>
+                        </table>
+                    </td>
+                </tr>
+            </tbody>
+            </table>
+        </td>
+    </tr>
+    
+    <!-- subject and message invisible input for validator execution workaround -->
+    <h:inputHidden id="validator" value="validator">
+        <f:validator validatorId="subjectLengthValidator" />
+        <f:validator validatorId="messageLengthValidator" />
+    </h:inputHidden>
+    
+    <!-- Add Options -->
+    <forums:isAllowed fragment="acl://topicType" contextData="#{newTopic.forumId}">
+    <tr class="PostViewUnderlineBoth">
+        <td valign="top">
+            <label class="forumformlabelbold">
+                ${resource.Options}
+            </label>
+        </td>
+        <td>
+            ${resource.Post_topic_as}:
+            <h:selectOneRadio value="#{newTopic.topicType}" styleClass="gen">
+                <f:selectItem itemValue="0" itemLabel="${resource.Post_Normal}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+                <f:selectItem itemValue="1" itemLabel="${resource.Post_Sticky}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+                <f:selectItem itemValue="2" itemLabel="${resource.Post_Announcement}">
+                    <f:verbatim>&#160;&#160;&#160;</f:verbatim>
+                </f:selectItem>
+            </h:selectOneRadio>
+        </td>
+    </tr>
+    </forums:isAllowed>
+    
+    <!-- poll ui -->
+    <forums:isAllowed fragment="acl://managePoll">
+    
+	<tr class="PostViewMainHeader">
+        <td colspan="2">
+            ${resource.Add_poll}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Add_poll_explain}
+        </td>
+    </tr>
+    
+    <!-- setup poll question -->
+    <tr>
+        <td class="PostViewUnderline">
+            <label class="forumformlabelbold">
+                ${resource.Poll_question}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{newTopic.question}" id="question" maxlength="255" style="width: 450px;"/>
+        </td>
+    </tr>
+    
+    <!-- update poll options already added -->
+    <input type="hidden" name="o"/>
+    <c:forEach items="${newTopic.options}" var="optionRow" varStatus="idx">
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_option}
+            </label>
+        </td>
+        <td>
+            <h:inputText id="option_${idx.index+1}" name="option_${idx.index+1}"
+                   value="${optionRow}" style="width: 300px;" maxlength="255"/>
+            &#160;
+            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{newTopic.updateOption}" value="${resource.Update}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{newTopic.deleteOption}" value="${resource.Delete}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+        </td>
+    </tr>
+    </c:forEach>
+    
+    <!-- add poll options -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_option}
+            </label>
+        </td>
+        <td>  		
+            <h:inputText value="#{newTopic.option}" id="newOption" maxlength="255" style="width: 300px;"/>
+            &#160;   	
+            <h:commandButton action="#{newTopic.addOption}"
+                             value="${resource.Add_option}"
+                             styleClass="buttonMed"/>
+        </td>
+    </tr>
+		
+		
+    <!-- setup poll duration -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Poll_for}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{newTopic.activeDuration}" id="pollDuration" size="3" maxlength="3">
+                <f:converter  converterId="pollDurationConverter" />
+            </h:inputText>
+            &#160;
+            <strong>
+                ${resource.Days}
+            </strong>
+            &#160;
+            ${resource.Poll_for_explain}
+        </td>
+    </tr>
+    
+    <!-- poll invisible input for validator execution workaround -->
+    <h:inputHidden id="execute" value="execute">
+        <f:validator validatorId="pollValidator" />
+    </h:inputHidden>
+    
+    </forums:isAllowed>
+    
+    <!-- attachment ui -->
+    <forums:isAllowed fragment="acl://managePostAttachments">
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Add_attachment_title}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Add_attachment_explain}
+        </td>
+    </tr>
+    
+    <!-- upload button -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            <t:inputFileUpload value="#{newTopic.attachment}" size="40" styleClass="post"/>
+        </td>
+    </tr>
+    
+    <!-- comment -->
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea value="#{newTopic.attachmentComment}" rows="3" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton action="#{newTopic.addAttachment}" value="${resource.Add_attachment}" styleClass="buttonMed"/>
+        </td>
+    </tr>
+    
+    <c:if test="#{newTopic.numberOfAttachments>0}">
+    <tr>
+        <th class="thHead" colspan="2">${resource.Posted_attachments}</th>
+    </tr>
+	
+	<!-- uploaded list of attachments -->
+    <input type="hidden" name="ATTACHMENT"/>
+    <c:forEach items="#{newTopic.attachments}" var="attachRow" varStatus="idx">
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            ${attachRow.fileName}
+        </td>
+    </tr>
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{newTopic.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            &#160;
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+        </td>
+    </tr>
+    </c:forEach>
+    </c:if>
+    </forums:isAllowed>
+</table>
+    
+<!-- hookup the buttons -->
+<div class="forumformbuttonrow">
+    <ul>
+        <li>
+            <h:commandButton action="#{newTopic.preview}" value="${resource.Preview}"
+                             id="Preview"
+                             styleClass="buttonMed"
+                             tabindex="5"/>
+        </li>
+        <li>
+            <!--TODO: Missing execution of javascript checking form - onclick="return checkForm(this.parentNode)" -->
+            <h:commandButton action="#{newTopic.execute}" value="${resource.Submit}"
+                             id="Submit"
+                             styleClass="buttonMed"
+                             accesskey="s" tabindex="6">
+              <f:actionListener type="org.jboss.portlet.forums.ui.event.FloodControlListener" />
+            </h:commandButton>
+        </li>
+        <li>
+            <h:commandButton action="#{newTopic.cancel}" value="${resource.Cancel}"
+                             id="Cancel" accesskey="c" tabindex="7" styleClass="buttonMed"/>
+        </li>
+    </ul>
+</div>
+</h:form>
+</div>
+
+</ui:define>
+</ui:composition>
+
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_preview.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_preview.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_new_preview.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,61 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="PostviewStyle">
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Preview}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Posted}: ${newTopic.postDate}
+            &#160;&#160;&#160; ${resource.Post_subject}: ${newTopic.subject}
+        </td>
+    </tr>
+    <tr>
+        <td class="row1">
+            <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                    <td>
+                        <span class="postbody">
+                            <h:outputText value="#{forums:formatMessage(newTopic.message,false)}" escape="false" />
+                        </span>
+                    </td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+<hr />
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,686 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+
+<script language="JavaScript" type="text/javascript">
+&lt;!--
+// bbCode control by
+// subBlue design
+// www.subBlue.com
+
+// Startup variables
+var imageTag = false;
+var theSelection = false;
+
+// Check for Browser &amp; Platform for PC &amp; IE specific bits
+// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
+var clientPC = navigator.userAgent.toLowerCase(); // Get client info
+var clientVer = parseInt(navigator.appVersion); // Get browser version
+
+var is_ie = ((clientPC.indexOf("msie") != -1) &amp;&amp; (clientPC.indexOf("opera") == -1));
+var is_nav = ((clientPC.indexOf('mozilla')!=-1) &amp;&amp; (clientPC.indexOf('spoofer')==-1)
+                &amp;&amp; (clientPC.indexOf('compatible') == -1) &amp;&amp; (clientPC.indexOf('opera')==-1)
+                &amp;&amp; (clientPC.indexOf('webtv')==-1) &amp;&amp; (clientPC.indexOf('hotjava')==-1));
+var is_moz = 0;
+
+var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
+var is_mac = (clientPC.indexOf("mac")!=-1);
+
+// Helpline messages
+b_help = "${resource.bbcode_b_help}";
+i_help = "${resource.bbcode_i_help}";
+u_help = "${resource.bbcode_u_help}";
+q_help = "${resource.bbcode_q_help}";
+c_help = "${resource.bbcode_c_help}";
+l_help = "${resource.bbcode_l_help}";
+o_help = "${resource.bbcode_o_help}";
+p_help = "${resource.bbcode_p_help}";
+w_help = "${resource.bbcode_w_help}";
+a_help = "${resource.bbcode_a_help}";
+s_help = "${resource.bbcode_s_help}";
+f_help = "${resource.bbcode_f_help}";
+
+// Define the bbCode tags
+bbcode = new Array();
+bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
+imageTag = false;
+
+// Shows the help messages in the helpline window
+function helpline(help) {
+	document.post.helpbox.value = eval(help + "_help");
+}
+
+
+// Replacement for arrayname.length property
+function getarraysize(thearray) {
+	for (i = 0; i &lt; thearray.length; i++) {
+		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
+			return i;
+		}
+	return thearray.length;
+}
+
+// Replacement for arrayname.push(value) not implemented in IE until version 5.5
+// Appends element to the array
+function arraypush(thearray,value) {
+	thearray[ getarraysize(thearray) ] = value;
+}
+
+// Replacement for arrayname.pop() not implemented in IE until version 5.5
+// Removes and returns the last element of an array
+function arraypop(thearray) {
+	thearraysize = getarraysize(thearray);
+	retval = thearray[thearraysize - 1];
+	delete thearray[thearraysize - 1];
+	return retval;
+}
+
+
+function checkForm() {
+
+	formErrors = false;    
+
+	if (document.post["post:message"].value.length &lt; 2) {
+		formErrors = "${resource.Empty_message}";
+	}
+
+	if (formErrors) {
+		alert(formErrors);
+		return false;
+	} else {
+		bbstyle(-1);
+		//formObj.preview.disabled = true;
+		//formObj.submit.disabled = true;
+		return true;
+	}
+}
+
+function emoticon(text) {
+	var txtarea = document.post["post:message"];
+	text = ' ' + text + ' ';
+	if (txtarea.createTextRange &amp;&amp; txtarea.caretPos) {
+		var caretPos = txtarea.caretPos;
+		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
+		txtarea.focus();
+	} else {
+		txtarea.value  += text;
+		txtarea.focus();
+	}
+}
+
+function bbfontstyle(bbopen, bbclose) {
+	var txtarea = document.post["post:message"];
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win) {
+		theSelection = document.selection.createRange().text;
+		if (!theSelection) {
+			txtarea.value += bbopen + bbclose;
+			txtarea.focus();
+			return;
+		}
+		document.selection.createRange().text = bbopen + theSelection + bbclose;
+		txtarea.focus();
+		return;
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbopen, bbclose);
+		return;
+	}
+	else
+	{
+		txtarea.value += bbopen + bbclose;
+		txtarea.focus();
+	}
+	storeCaret(txtarea);
+}
+
+
+function bbstyle(bbnumber) {
+	var txtarea = document.post["post:message"];
+
+	txtarea.focus();
+	donotinsert = false;
+	theSelection = false;
+	bblast = 0;
+
+	if (bbnumber == -1) { // Close all open tags &amp; default button names
+		while (bbcode[0]) {
+			butnumber = arraypop(bbcode) - 1;
+			txtarea.value += bbtags[butnumber + 1];
+			buttext = eval('document.post.addbbcode' + butnumber + '.value');
+			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+		}
+		imageTag = false; // All tags are closed including image tags :D
+		txtarea.focus();
+		return;
+	}
+
+	if ((clientVer &gt;= 4) &amp;&amp; is_ie &amp;&amp; is_win)
+	{
+		theSelection = document.selection.createRange().text; // Get text selection
+		if (theSelection) {
+			// Add tags around selection
+			document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
+			txtarea.focus();
+			theSelection = '';
+			return;
+		}
+	}
+	else if (txtarea.selectionEnd &amp;&amp; (txtarea.selectionEnd - txtarea.selectionStart &gt; 0))
+	{
+		mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
+		return;
+	}
+	
+	// Find last occurance of an open tag the same as the one just clicked
+	for (i = 0; i &lt; bbcode.length; i++) {
+		if (bbcode[i] == bbnumber+1) {
+			bblast = i;
+			donotinsert = true;
+		}
+	}
+
+	if (donotinsert) {		// Close all open tags up to the one just clicked &amp; default button names
+		while (bbcode[bblast]) {
+				butnumber = arraypop(bbcode) - 1;
+				txtarea.value += bbtags[butnumber + 1];
+				buttext = eval('document.post.addbbcode' + butnumber + '.value');
+				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
+				imageTag = false;
+			}
+			txtarea.focus();
+			return;
+	} else { // Open tags
+	
+		if (imageTag &amp;&amp; (bbnumber != 14)) {		// Close image tag before adding another
+			txtarea.value += bbtags[15];
+			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
+			document.post.addbbcode14.value = "Img";	// Return button back to normal state
+			imageTag = false;
+		}
+		
+		// Open tag
+		txtarea.value += bbtags[bbnumber];
+		if ((bbnumber == 14) &amp;&amp; (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
+		arraypush(bbcode,bbnumber+1);
+		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
+		txtarea.focus();
+		return;
+	}
+	storeCaret(txtarea);
+}
+
+// From http://www.massless.org/mozedit/
+function mozWrap(txtarea, open, close)
+{
+	var selLength = txtarea.textLength;
+	var selStart = txtarea.selectionStart;
+	var selEnd = txtarea.selectionEnd;
+	if (selEnd == 1 || selEnd == 2) 
+		selEnd = selLength;
+
+	var s1 = (txtarea.value).substring(0,selStart);
+	var s2 = (txtarea.value).substring(selStart, selEnd)
+	var s3 = (txtarea.value).substring(selEnd, selLength);
+	txtarea.value = s1 + open + s2 + close + s3;
+	return;
+}
+
+// Insert at Claret position. Code from
+// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
+function storeCaret(textEl) {
+	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
+}
+
+function selectOption(optionVal)
+{
+	document.post.o.value = optionVal;
+}
+
+function selectAttachment(attachmentVal)
+{
+	document.post.ATTACHMENT.value = attachmentVal;
+}
+
+//--&gt;
+</script>
+
+<!-- Checking whether bean was initialized. If not, the initialization should execute. -->
+<c:if test="#{replyTopic.initialized}"></c:if>
+
+<c:if test="#{replyTopic.preview}">
+    <ui:include src="/views/topics/posting_reply_preview.xhtml"/>
+    <br clear="all"/>
+</c:if>
+
+<div class="forumtitletext">
+    <h4>${resource.Post_a_reply}</h4>
+    <h:messages errorClass="failuretext" layout="table" />
+</div>
+
+<div class="PostviewStyle">
+<h:form id="post" enctype="multipart/form-data">
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+
+    <!-- keeps the forum where this topic is being created in context, this is a control parameter -->
+    <input type="hidden" name="f" value="#{replyTopic.forumId}"/>
+    <input type="hidden" name="t" value="#{replyTopic.topicId}"/>
+    <c:if test="#{param['page'] ne null}">
+        <input type="hidden" name="page" value="#{param['page']}"/>
+    </c:if>
+    
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">${resource.Compose_Message}</td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">${resource.Posting_Description}</td>
+    </tr>
+    
+    <!-- add Subject -->
+    <tr class="PostViewUnderlineBoth">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.Subject}
+            </label>
+        </td>
+        <td>
+            <h:inputText value="#{replyTopic.subject}" maxlength="200" id="SubjectInputText"
+                         size="45" style="width: 450px;" tabindex="2"/>
+        </td>
+    </tr>
+    
+    <!-- Add Message -->
+    <tr>
+        <td valign="top">
+            <table border="0" cellpadding="1" cellspacing="0" width="100%">
+                <tbody>
+                    <tr>
+                        <td>
+                            <label class="forumformlabelbold">
+                                ${resource.Message_body}
+                            </label>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td align="center" valign="middle">
+                            <br />
+                            <table border="0" cellpadding="5" cellspacing="0" width="100">
+                                <tbody>
+                                    <tr align="center">
+                                        <td>
+                                            <b></b>
+                                        </td>
+                                    </tr>
+                                </tbody>
+                            </table>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </td>
+        <td valign="top">
+            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumline">
+            <tbody>
+                <tr>
+                    <td class="row2" valign="top">
+                        <span class="genmed"></span>
+                        <table border="0" cellpadding="2" cellspacing="0" width="450">
+                        <tbody>
+                            <tr align="center" valign="middle">
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="b"
+                                               name="addbbcode0" value=" B " style="font-weight:bold; width: 30px"
+                                               onClick="bbstyle(0)" onMouseOver="helpline('b')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="i"
+                                               name="addbbcode2" value=" i " style="font-style:italic; width: 30px"
+                                               onClick="bbstyle(2)" onMouseOver="helpline('i')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="u"
+                                               name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px"
+                                               onClick="bbstyle(4)" onMouseOver="helpline('u')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="q"
+                                               name="addbbcode6" value="Quote" style="width: 50px"
+                                               onClick="bbstyle(6)" onMouseOver="helpline('q')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="c"
+                                               name="addbbcode8" value="Code" style="width: 40px"
+                                               onClick="bbstyle(8)" onMouseOver="helpline('c')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="l"
+                                               name="addbbcode10" value="List" style="width: 40px"
+                                               onClick="bbstyle(10)" onMouseOver="helpline('l')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="o"
+                                               name="addbbcode12" value="List=" style="width: 40px"
+                                               onClick="bbstyle(12)" onMouseOver="helpline('o')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="p"
+                                               name="addbbcode14" value="Img" style="width: 40px"
+                                               onClick="bbstyle(14)" onMouseOver="helpline('p')"/>
+                                    </span>
+                                </td>
+                                <td>
+                                    <span class="genmed">
+                                        <input type="button" class="button buttonMed" accesskey="w"
+                                               name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px"
+                                               onClick="bbstyle(16)" onMouseOver="helpline('w')"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                    <tbody>
+                                        <tr>
+                                            <td>
+                                                <span class="genmed">
+                                                    &#160;${resource.Font_color}:
+                                                    <select name="addbbcode18"
+                                                            onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;"
+                                                            onMouseOver="helpline('s')">
+                                                        <option style="color:black; background-color: "
+                                                                value="" class="genmed">
+                                                            ${resource.color_default}
+                                                        </option>
+                                                        <option style="color:darkred; background-color: "
+                                                                value="darkred" class="genmed">
+                                                            ${resource.color_dark_red}
+                                                        </option>
+                                                        <option style="color:red; background-color: "
+                                                                value="red" class="genmed">
+                                                            ${resource.color_red}
+                                                        </option>
+                                                        <option style="color:orange; background-color: "
+                                                                value="orange" class="genmed">
+                                                            ${resource.color_orange}
+                                                        </option>
+                                                        <option style="color:brown; background-color: "
+                                                                value="brown" class="genmed">
+                                                            ${resource.color_brown}
+                                                        </option>
+                                                        <option style="color:yellow; background-color: "
+                                                                value="yellow" class="genmed">
+                                                            ${resource.color_yellow}
+                                                        </option>
+                                                        <option style="color:green; background-color: "
+                                                                value="green" class="genmed">
+                                                            ${resource.color_green}
+                                                        </option>
+                                                        <option style="color:olive; background-color: "
+                                                                value="olive" class="genmed">
+                                                            ${resource.color_olive}
+                                                        </option>
+                                                        <option style="color:cyan; background-color: "
+                                                                value="cyan" class="genmed">
+                                                            ${resource.color_cyan}
+                                                        </option>
+                                                        <option style="color:blue; background-color: "
+                                                                value="blue" class="genmed">
+                                                            ${resource.color_blue}
+                                                        </option>
+                                                        <option style="color:darkblue; background-color: "
+                                                                value="darkblue" class="genmed">
+                                                            ${resource.color_dark_blue}
+                                                        </option>
+                                                        <option style="color:indigo; background-color: "
+                                                                value="indigo" class="genmed">
+                                                            ${resource.color_indigo}
+                                                        </option>
+                                                        <option style="color:violet; background-color: "
+                                                                value="violet" class="genmed">
+                                                            ${resource.color_violet}
+                                                        </option>
+                                                        <option style="color:white; background-color: "
+                                                                value="white" class="genmed">
+                                                            ${resource.color_white}
+                                                        </option>
+                                                        <option style="color:black; background-color: "
+                                                                value="black" class="genmed">
+                                                            ${resource.color_black}
+                                                        </option>
+                                                    </select>
+                                                    &#160;${resource.Font_size}:
+                                                    <select name="addbbcode20"
+                                                            onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')"
+                                                            onMouseOver="helpline('f')">
+                                                        <option value="7" class="genmed">
+                                                            ${resource.font_tiny}
+                                                        </option>
+                                                        <option value="9" class="genmed">
+                                                            ${resource.font_small}
+                                                        </option>
+                                                        <option value="12" class="genmed" selected="true">
+                                                            ${resource.font_normal}
+                                                        </option>
+                                                        <option value="18" class="genmed">
+                                                            ${resource.font_large}
+                                                        </option>
+                                                        <option value="24" class="genmed">
+                                                            ${resource.font_huge}
+                                                        </option>
+                                                    </select>
+                                                </span>
+                                            </td>
+                                            <td nowrap="nowrap" align="right">
+                                                <span class="gensmall">
+                                                    <a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">
+                                                        ${resource.Close_Tags}
+                                                    </a>
+                                                </span>
+                                            </td>
+                                        </tr>
+                                    </tbody>
+                                    </table>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <span class="gensmall">
+                                        <input type="text" name="helpbox" size="45" maxlength="100"
+                                               style="width:450px; font-size:10px"
+                                               class="helpline" value="${resource.Styles_tip}"/>
+                                    </span>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <h:inputTextarea id="message" value="#{replyTopic.message}"
+                                                     rows="15" cols="35"
+                                                     tabindex="3"
+                                                     styleClass="Posttextarea"
+                                                     onselect="storeCaret(this);"
+                                                     onkeyup="storeCaret(this);"
+                                                     onclick="storeCaret(this)" />
+                                </td>
+                            </tr>
+                        </tbody>
+                        </table>
+                    </td>
+                </tr>
+            </tbody>
+            </table>
+        </td>
+    </tr>
+    
+    <!-- subject and message invisible input for validator execution workaround -->
+    <h:inputHidden id="validator" value="validator">
+        <f:validator validatorId="subjectLengthValidator" />
+        <f:validator validatorId="messageLengthValidator" />
+    </h:inputHidden>
+    
+    <!-- attachment ui -->
+    <forums:isAllowed fragment="acl://managePostAttachments">
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Add_attachment_title}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Add_attachment_explain}
+        </td>
+    </tr>
+    
+    <!-- upload button -->
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            <t:inputFileUpload value="#{replyTopic.attachment}" size="40" styleClass="post"/>
+        </td>
+    </tr>
+    
+    <!-- comment -->
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea value="#{replyTopic.attachmentComment}" rows="3" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton action="#{replyTopic.addAttachment}" value="${resource.Add_attachment}" styleClass="buttonMed"/>
+        </td>
+    </tr>
+    
+    <c:if test="#{replyTopic.numberOfAttachments>0}">
+    <tr>
+        <th class="thHead" colspan="2">${resource.Posted_attachments}</th>
+    </tr>
+    
+    <!-- uploaded list of attachments -->
+    <input type="hidden" name="ATTACHMENT"/>
+    <c:forEach items="#{replyTopic.attachments}" var="attachRow" varStatus="idx">
+    <tr class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_name}
+            </label>
+        </td>
+        <td>
+            ${attachRow.fileName}
+        </td>
+    </tr>
+    <tr valign="top" class="PostViewUnderline">
+        <td>
+            <label class="forumformlabelbold">
+                ${resource.File_comment}
+            </label>
+        </td>
+        <td>
+            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="Posttextarea"/>
+        </td>
+    </tr>
+    <tr class="PostViewUnderline">
+        <td></td>
+        <td>
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            &#160;
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+        </td>
+    </tr>
+    </c:forEach>
+    </c:if>
+    </forums:isAllowed>
+</table>
+
+<!-- hookup the buttons -->
+<div class="forumformbuttonrow">
+    <ul>
+        <li>
+            <h:commandButton action="#{replyTopic.preview}" value="${resource.Preview}"
+                             id="Preview"
+                             styleClass="buttonMed"
+                             tabindex="5"/>
+        </li>
+        <li>
+            <!--TODO: Missing execution of javascript checking form - onclick="return checkForm(this.parentNode)" -->
+            <h:commandButton action="#{replyTopic.execute}" value="${resource.Submit}"
+                             id="Submit"
+                             styleClass="buttonMed"
+                             accesskey="s" tabindex="6">
+              <f:actionListener type="org.jboss.portlet.forums.ui.event.FloodControlListener" />
+            </h:commandButton>
+        </li>
+        <li>
+            <h:commandButton action="#{replyTopic.cancel}" value="${resource.Cancel}"
+                             id="Cancel" accesskey="c" tabindex="7" styleClass="buttonMed"/>
+        </li>
+    </ul>
+</div>
+</h:form>
+</div>
+
+</ui:define>
+</ui:composition>
+
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_preview.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_preview.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_preview.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,61 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="PostviewStyle">
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%" name="table" id="table" >
+    <tr>
+        <td colspan="2" class="PostViewMainHeader">
+            ${resource.Preview}
+        </td>
+    </tr>
+    <tr class="PostViewMainDescription">
+        <td colspan="2">
+            ${resource.Posted}: ${replyTopic.postDate}
+            &#160;&#160;&#160; ${resource.Post_subject}: ${replyTopic.subject}
+        </td>
+    </tr>
+    <tr>
+        <td class="row1">
+            <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                    <td>
+                        <span class="postbody">
+                            <h:outputText value="#{forums:formatMessage(replyTopic.message,false)}" escape="false" />
+                        </span>
+                    </td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+<hr />
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,976 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:choose> 
+
+    <c:when test="#{topic.initialized &amp;&amp; topic.topic!=null &amp;&amp; topic.topic.id!=-1}">
+    
+    <!-- make sure the user is allowed to access both the forum and the category that the specified topic belongs to -->
+    <forums:isAllowed fragment="acl://readCategory" contextData="#{topic.topic.forum.category}">
+    <forums:isAllowed fragment="acl://readForum" contextData="#{topic.topic.forum}">
+    
+    <a name="top" />
+    
+    <div id="miviewtopicbody1" class="forumbread">
+        <ul>
+            <li class="first">
+            
+                <h:outputLink id="outputLink1" value="#{forums:outputLink(shared.links['category'],true)}">
+                    <h:outputText value="#{shared.mainPageName}"/>
+                </h:outputLink>
+                
+                <ul>
+                    <li>&gt; 
+                        <h:outputLink id="outputLink2" value="#{forums:outputLink(shared.links['category'],true)}">
+                            <f:param name="c" value="#{topic.topic.forum.category.id}"/>
+                            <h:outputText value="#{topic.topic.forum.category.title}"/>
+                        </h:outputLink>
+                        
+                        <ul>
+                            <li>&gt; 
+                                <h:outputLink id="outputLink3" value="#{forums:outputLink(shared.links['forum'],true)}">
+                                    <f:param name="f" value="#{topic.topic.forum.id}"/>
+                                    <h:outputText value="#{topic.topic.forum.name}"/>
+                                </h:outputLink>
+                                
+                                <ul>
+                                    <li>&gt; 
+                                        <h:outputLink id="outputLink4" value="#{forums:outputLink(shared.links['topic'],true)}">
+                                            <f:param name="f" value="#{topic.topic.forum.id}"/>
+                                            <f:param name="t" value="#{topic.topic.id}"/>
+                                            <h:outputText value="#{topic.topic.subject}"/>
+                                        </h:outputLink>                                        
+                                    </li>
+                                </ul>                                
+                                
+                            </li>
+                        </ul>
+                        
+                    </li>
+                </ul>
+                
+            </li>
+        </ul>
+    </div>
+    
+    <div id="miviewtopicbody2" class="forumfloatright">
+        
+        <h:form>
+        
+        <c:if test="${forums:feedsConfigured()}">
+            <!--  feeds -->
+            <a href="#{topic.rssFeed}" >
+                <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                RSS
+            </a>
+            &#160;
+            <a href="#{topic.atomFeed}" >
+                <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+                ATOM
+            </a>
+            &#160;
+        </c:if>
+    
+        <c:if test="#{shared.anonymous==false}">
+        <c:choose>
+        
+            <c:when test="#{topicWatch.watched}">
+                <h:commandLink id="deActivateWatch" action="#{topicWatch.deActivateWatch}">
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img src="#{forums:themeURL('resourceIconUnSubscribeURL')}"
+                             alt="${resource.Unsubscribe_from_topic}"
+                             name="unSubscribe"
+                             border="0"
+                             id="unSubscribe" />
+                    </f:verbatim>
+                </h:commandLink>
+            </c:when>
+            
+            <c:otherwise>
+                <h:outputLink id="outputLink5" value="#{forums:outputLink(shared.links['topicWatch'],true)}">
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <img src="#{forums:themeURL('resourceIconSubscribeURL')}"
+                         alt="${resource.Subscribe_to_topic}"
+                         name="subscribe"
+                         border="0"
+                         id="subscribe" />
+                    </h:outputLink>
+            </c:otherwise>
+                            
+        </c:choose>
+        </c:if>
+        </h:form>
+    </div>
+    
+    <div id="miviewtopicbody3" class="forumtitletext">
+        <input type="hidden" name="f" value="#{forum.forum.id}" />
+        <h4>
+            ${forum.forum.name}
+        </h4>
+    </div>
+    
+    <!-- PAGINATION -->
+    <c:if test="#{topic.pageNavigator.totalPages gt 1}">
+    <div id="miviewtopicbody4" class="forumpagination">
+        <ul>
+            <li class="disablepage">
+                <h:outputFormat value="#{resource.PageNumber}">
+                    <f:param value="${topic.pageNavigator.pageNumber}"/>
+                    <f:param value="${topic.pageNavigator.totalPages}"/>
+                </h:outputFormat>
+            </li>
+            
+            <c:choose>
+                <c:when test="#{topic.pageNavigator.currentPage eq 0}">
+                    <li class="disablepage">
+                        ${resource.First}
+                    </li>
+                    <li class="disablepage">
+                        &#60; ${resource.Previous}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink id="outputLink6" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${resource.First}"/>
+                        </h:outputLink>    
+                    </li>
+                    <li>
+                        <h:outputLink id="outputLink7" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.currentPage-1}"/>
+                            <h:outputText value="&#60; ${resource.Previous}"/>
+                        </h:outputLink>    
+                    </li>
+                </c:otherwise>
+            </c:choose>
+            
+            <c:forEach items="#{topic.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                <li>
+                    <h:outputLink id="_${pageNumber-1}outputLink8" value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <li class="currentpage">
+                ${topic.pageNavigator.currentPage+1}
+            </li>
+            
+            <c:forEach items="#{topic.pageNavigator.currentPaginationRight}" var="pageNumber">
+                <li>
+                    <h:outputLink id="_${pageNumber-1}outputLink9" value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <c:choose>
+                <c:when test="#{topic.pageNavigator.currentPage eq (topic.pageNavigator.totalPages-1) }">
+                    <li class="disablepage">
+                        ${resource.Next} &#62;
+                    </li>
+                    <li class="disablepage">
+                        ${resource.Last}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink id="outputLink10" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.currentPage+1}"/>
+                            <h:outputText value="${resource.Next} &#62;"/>
+                        </h:outputLink>
+                    </li>
+                    <li>
+                        <h:outputLink id="outputLink11" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.totalPages-1}"/>
+                            <h:outputText value="${resource.Last}"/>
+                        </h:outputLink>
+                    </li>
+                </c:otherwise>
+            </c:choose>
+        </ul>
+    </div>
+    </c:if>
+
+    <!-- insert the newTopic and replyTopic buttons here -->
+    <div id="miviewtopicbody5" class="actionbuttons">
+    <h:form>
+    <c:choose>
+    
+        <c:when test="#{topic.topic.forum.status == forums:constantInt('FORUM_LOCKED')}">
+        
+            <!-- new topic -->
+            <img border="0"
+                 src="#{forums:themeURL('resourcePostLockedURL')}"
+                 alt="${resource.Forum_locked}" />
+                 
+            <!-- reply -->
+            <img border="0"
+                 src="#{forums:themeURL('resourceReplyLockedURL')}"
+                 alt="${resource.Forum_locked}" />
+        </c:when>
+        
+        <c:when test="#{(topic.topic.status == forums:constantInt('TOPIC_LOCKED'))
+                      &amp;&amp; (topic.topic.forum.status != forums:constantInt('FORUM_LOCKED'))}">
+                      
+            <!-- new topic -->
+            <forums:isAllowed fragment="acl://newTopic" contextData="#{topic.topic.forum}">
+            <h:commandLink id="newTopic" action="#{newTopic.start}">
+                <f:param name="f" value="#{topic.topic.forum.id}"/>
+                <f:verbatim>
+                    <img border="0"
+                         src="#{forums:themeURL('resourcePostNewURL')}"
+                         alt="${resource.Post_new_topic}"/>
+                </f:verbatim>
+            </h:commandLink>
+            </forums:isAllowed>
+
+            <!-- reply -->
+            <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+            <img border="0"
+                 src="#{forums:themeURL('resourceReplyLockedURL')}"
+                 alt="${resource.Topic_locked}" />
+            </forums:isAllowed>
+        </c:when>
+        
+        <c:otherwise>
+
+            <!-- new topic -->
+            <forums:isAllowed fragment="acl://newTopic" contextData="#{topic.topic.forum}">
+                <h:commandLink id="newTopic" action="#{newTopic.start}">
+                    <f:param name="f" value="#{topic.topic.forum.id}"/>
+                    <f:verbatim>
+                        <img border="0"
+                             src="#{forums:themeURL('resourcePostNewURL')}"
+                             alt="${resource.Post_new_topic}"/>
+                    </f:verbatim>
+                </h:commandLink> 
+            </forums:isAllowed>
+                        
+            <!-- reply -->
+            <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+                <h:commandLink id="replyTopic" action="#{replyTopic.start}">
+                    <f:param name="f" value="#{topic.topic.forum.id}"/>
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img border="0"
+                             src="#{forums:themeURL('resourceReplyNewURL')}"
+                             alt="${resource.Reply_to_topic}" />
+                    </f:verbatim>
+                </h:commandLink>
+            </forums:isAllowed>
+            
+        </c:otherwise>
+        
+    </c:choose>
+    </h:form>
+    </div>
+
+    <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+        <tr>
+            <!-- POLL DISPLAY -->
+            <c:if test="#{topic.pollPresent &amp;&amp; topic.ballotView}">
+                <ui:include src="/views/topics/viewtopic_poll_ballot.xhtml">
+                    <ui:param name="t" value="#{topic.topic.id}"/>
+                    <ui:param name="poll" value="#{topic.topic.poll}"/>
+                </ui:include>
+            </c:if>
+            <c:if test="#{topic.pollPresent &amp;&amp; !topic.ballotView}">
+                <ui:include src="/views/topics/viewtopic_poll_result.xhtml">
+                    <ui:param name="t" value="#{topic.topic.id}"/>
+                    <ui:param name="poll" value="#{topic.topic.poll}"/>
+                </ui:include>
+            </c:if>
+        </tr>
+        
+        <tr class="header">
+            <td class="forumheaderfirst">${resource.Author}</td>
+            <td class="forumheaderopen">${resource.Message}</td>
+        </tr>
+        
+        <!-- iterate and display each post on this topic in the forum -->
+        <c:forEach items="#{topic.page}" var="postrow" varStatus="status" >
+        <tr class="oddRow">
+            <td class="forumpostleftcolumn">
+                <c:choose>
+                    
+                    <c:when test="#{category.anonymous}">
+                        ${postrow.poster.user.userName}
+                    </c:when>
+                    
+                    <c:otherwise>
+                        <h:outputLink id="_#{postrow.id}outputLink12" value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid" value="${postrow.poster.user.id}"/>
+                            <h:outputText value="${postrow.poster.user.userName}"/>
+                        </h:outputLink>
+                    </c:otherwise>
+                    
+                </c:choose>
+                
+                <!-- TODO: NEED TO BE REIMPLEMENTED
+                <span class="postdetails">
+                    ${POSTER_RANK}
+                    <br />
+                    ${RANK_IMAGE}${POSTER_AVATAR}
+                    <br />
+                    ${POSTER_JOINED}
+                    <br />
+                    ${POSTER_POSTS}
+                    <br />
+                    ${POSTER_FROM}
+                </span>
+                -->
+            </td>
+            <td class="forumpostspacer">
+            
+                <a name="${postrow.id}" />
+            
+                <div id="miviewtopicbody6" class="forumpostactions">
+                <h:form>
+                    <ul>
+                    
+                        <!-- add the quote link -->
+                        <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+                        <li>
+                            <h:commandLink action="#{replyTopic.startQuote}">
+                                <f:param name="f" value="#{topic.topic.forum.id}"/>
+                                <f:param name="t" value="#{topic.topic.id}"/>
+                                <f:param name="p" value="#{postrow.id}"/>
+                                <f:verbatim>
+                                    <img border="0" src="#{forums:themeURL('resourceIconQuoteURL')}"/>
+                                </f:verbatim>
+                            </h:commandLink>
+                        </li>
+                        </forums:isAllowed>
+                        
+                        <!-- add the edit post link -->
+                        <forums:isAllowed fragment="acl://editPost" contextData="#{postrow}">
+                        <li>
+                            <h:commandLink action="#{editPost.start}">
+                                <f:param name="p" value="#{postrow.id}"/>
+                                <f:verbatim>
+                                    <img border="0" src="#{forums:themeURL('resourceIconEditURL')}"/>
+                                </f:verbatim>
+                            </h:commandLink>
+                        </li>
+                        </forums:isAllowed>
+                        
+                        <!-- add the delete post link -->                        
+                        <forums:isAllowed fragment="acl://deletePost" contextData="#{postrow}">
+                        <li>
+                            <h:outputLink id="_#{postrow.id}outputLink14" value="#{forums:outputLink('/views/topics/delete_post.jsf',true)}">
+                                <f:param name="p" value="#{postrow.id}"/>
+                                <f:param name="t" value="#{topic.topic.id}"/>
+                                <f:param name="f" value="#{topic.topic.forum.id}"/>
+                                <f:verbatim>
+                                    <img border="0" src="#{forums:themeURL('resourceIconDelpostURL')}"/>
+                                </f:verbatim>
+                            </h:outputLink>
+                        </li>
+                        </forums:isAllowed>
+                        
+                    </ul>
+                </h:form>
+                </div>
+                
+                <div id="miviewtopicbody7" class="forumpostinfo">
+                    <ul>
+                        <li>
+                            <a name="${postrow.id}" />
+                            <h:outputLink id="_${postrow.id}outputLink15" value="#{forums:postPermlink(postrow.id)}" style="text-decoration: none;">
+                                <h:outputText value="${resource.Permalink}"/>
+                            </h:outputLink>
+                        </li>
+                        <li>${resource.Posted}:&#160;#{forums:dateStr(postrow.createDate)}</li>
+                        <li>${resource.Post_subject}:&#160;${postrow.message.subject}</li>
+                    </ul>
+                </div>
+            </td>
+        </tr>
+        <tr>
+            <td class="forumpostleftcolumn">&#160;</td>
+            <td class="forumpostcontent">
+
+                <p>
+                    <h:outputText value="#{forums:formatMessage(postrow.message.text,false)}" escape="false" />
+                    <br /><br />
+                    ${forums:userProperty(postrow.poster.user,'INFO_USER_SIGNATURE')}
+                </p>
+
+                <!-- show the attachments of this post here -->
+                <p>
+                    <c:if test="#{postrow.attachments!=null}">
+                        <ui:include src="/views/topics/attachmentsview.xhtml">
+                            <ui:param name="attachments" value="#{postrow.attachments}"/>
+                        </ui:include>
+                    </c:if>
+                </p>
+
+                <c:if test="${postrow.editCount gt 0}">
+                <p>
+                    <em>
+                        <c:choose>
+                            <c:when test="${postrow.editCount eq 1}">
+                                <h:outputFormat value="#{resource.Edited_time_total}">
+                                    <f:param value="${postrow.poster.user.userName}"/>
+                                    <f:param value="${postrow.editDate}"/>
+                                    <f:param value="${postrow.editCount}"/>
+                                </h:outputFormat>
+                            </c:when>
+                            <c:otherwise>
+                                <h:outputFormat value="#{resource.Edited_times_total}">
+                                    <f:param value="${postrow.poster.user.userName}"/>
+                                    <f:param value="${postrow.editDate}"/>
+                                    <f:param value="${postrow.editCount}"/>
+                                </h:outputFormat>
+                            </c:otherwise>
+                        </c:choose>
+                    </em>
+                </p>
+                </c:if>
+                
+            </td>
+        </tr>
+        <tr>
+            <td class="forumpostleftcolumn">
+                <a href="#top">${resource.Back_to_top}</a>
+            </td>
+            <td class="forumthreaduserinfo">
+                <ul>
+                    <li>
+                        <h:outputLink id="_${postrow.id}outputLink16" value="#{forums:outputLink(shared.links['profile'],true)}">
+                            <f:param name="uid"
+                                     value="#{postrow.poster.user.id}"/>
+                            <f:verbatim>
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconProfileURL')}"
+                                     alt="${resource.Read_profile}"/>
+                            </f:verbatim>
+                        </h:outputLink>
+                    </li>
+                    
+                    <!-- TODO: WAITING FOR MISSING FUNCTIONALITY -->
+                    <!--
+                    <li>
+                        <h:outputLink value="#{forums:outputLink(shared.links['message'],true)}">
+                            <f:param name="uid" value="#{postrow.poster.user.id}"/>
+                            <f:verbatim>
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconPMURL')}"
+                                     alt="${resource.Private_Message}"/>
+                            </f:verbatim>
+                        </h:outputLink>
+                    </li>
+                    -->
+                    
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_EMAIL_FAKE') ne null}">
+                        <li>
+                            <a href="mailto:${forums:userProperty(postrow.poster.user,'INFO_USER_EMAIL_FAKE')}">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconEmailURL')}"
+                                     alt="${resource.Send_email}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_HOMEPAGE') ne null}">
+                        <li>
+                            <a href="${forums:userProperty(postrow.poster.user,'INFO_USER_HOMEPAGE')}">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconWWWURL')}"
+                                     alt="${resource.Visit_website}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_AIM') ne null}">
+                        <li>
+                            <a href="aim:goim?screenname=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_AIM')}&amp;message=Hello+Are+you+there?">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconAIMURL')}"
+                                     alt="${resource.AIM}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_YIM') ne null}">
+                        <li>
+                            <a href="http://edit.yahoo.com/config/send_webmesg?.target=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_YIM')}&amp;.src=pg">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconYIMURL')}"
+                                     alt="${resource.YIM}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_SKYPE') ne null}">
+                        <li>
+                            <!-- TODO: some more functionality may be added. Like automatic skype instalation and status checker.-->
+                            <a href="skype:#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_SKYPE')}?add">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconSkypeURL')}"
+                                     alt="${resource.L_SKYPE}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_MSNM') ne null}">
+                        <li>
+                            <h:outputLink id="_${postrow.id}outputLink17" value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid"
+                                         value="#{postrow.poster.user.id}"/>
+                                <f:verbatim>
+                                    <img border="0"
+                                         src="#{forums:themeURL('resourceIconMSNMURL')}"
+                                         alt="${resource.Read_profile}"/>
+                                </f:verbatim>
+                            </h:outputLink>
+                         </li>
+                    </c:if>
+                    <c:if test="${forums:userProperty(postrow.poster.user,'INFO_USER_IM_ICQ') ne null}">
+                        <li>
+                            <a href="http://www.icq.com/scripts/search.dll?to=#{forums:userProperty(postrow.poster.user,'INFO_USER_IM_ICQ')}">
+                                <img border="0"
+                                     src="#{forums:themeURL('resourceIconICQURL')}"
+                                     alt="${resource.ICQ}"/>
+                            </a>
+                        </li>
+                    </c:if>
+                    
+                    <!-- TODO: Status for ICQ. Might be cool for other communicators too.-->
+                    <!-- <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(' ${ICQ_IMG}');
+                    else
+                        document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div id="miviewtopicbody8" style="position:relative"><div id="miviewtopicbody9" style="position:absolute">${ICQ_IMG}</div><div id="miviewtopicbody10" style="position:absolute;left:3px;top:-1px">${ICQ_STATUS_IMG}</div></div>');
+                    </script>
+                    <noscript>${ICQ_IMG}</noscript> -->
+                </ul>
+            </td>
+        </tr> 
+        <tr>
+            <td colspan="2" class="forumthreadfooter" />
+        </tr>
+        </c:forEach>
+                  
+        <!-- TODO: THIS PART OF CODE IS WAITING FOR FORUMSMODULE METHODS NEEDED FOR THIS FEATURE -->
+        <!--
+        <tr align="center">
+            <td class="catBottom" colspan="2" height="28">
+                <table cellspacing="0" cellpadding="0" border="0">
+                    <tr>
+                        <h:form>
+                            <td align="center">
+                                <span class="gensmall">
+                                    ${resource.Display_posts}:
+                                    <h:selectOneMenu value="#{topic.postDays}">
+                                        <f:selectItem itemValue="0" itemLabel="All Posts" />
+                                        <f:selectItem itemValue="86400000" itemLabel="#{resource.period_1_Day}" />
+                                        <f:selectItem itemValue="604800000" itemLabel="#{resource.period_7_Days}" />
+                                        <f:selectItem itemValue="1209600000" itemLabel="#{resource.period_2_Weeks}" />
+                                        <f:selectItem itemValue="2592000000" itemLabel="#{resource.period_1_Month}" />
+                                        <f:selectItem itemValue="7776000000" itemLabel="#{resource.period_3_Months}" />
+                                        <f:selectItem itemValue="15552000000" itemLabel="#{resource.period_6_Months}" />
+                                        <f:selectItem itemValue="31104000000" itemLabel="#{resource.period_1_Year}" />
+                                    </h:selectOneMenu>
+                                    <h:selectOneMenu>
+                                        <f:selectItem itemValue="0" itemLabel="#{resource.L_ASCENDING}" />
+                                        <f:selectItem itemValue="1" itemLabel="#{resource.L_DESCENDING}" />
+                                    </h:selectOneMenu>
+                                    <input type="button" value="${resource.Go}" class="liteoption"  />
+                                </span>
+                            </td>
+                        </h:form>
+                    </tr>
+                </table>
+            </td>
+        </tr>-->
+        
+    </table>   
+
+    <!-- PAGINATION -->
+    <c:if test="#{topic.pageNavigator.totalPages gt 1}">
+    <div id="miviewtopicbody11" class="forumpagination">
+        <ul>
+            <li class="disablepage">
+                <h:outputFormat value="#{resource.PageNumber}">
+                    <f:param value="${topic.pageNavigator.pageNumber}"/>
+                    <f:param value="${topic.pageNavigator.totalPages}"/>
+                </h:outputFormat>
+            </li>
+            
+            <c:choose>
+                <c:when test="#{topic.pageNavigator.currentPage eq 0}">
+                    <li class="disablepage">
+                        ${resource.First}
+                    </li>
+                    <li class="disablepage">
+                        &#60; ${resource.Previous}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink id="outputLink18" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="0"/>
+                            <h:outputText value="${resource.First}"/>
+                        </h:outputLink>    
+                    </li>
+                    <li>
+                        <h:outputLink id="outputLink19" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.currentPage-1}"/>
+                            <h:outputText value="&#60; ${resource.Previous}"/>
+                        </h:outputLink>    
+                    </li>
+                </c:otherwise>
+            </c:choose>
+            
+            <c:forEach items="#{topic.pageNavigator.currentPaginationLeft}" var="pageNumber">
+                <li>
+                    <h:outputLink id="_${pageNumber-1}outputLink20" value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <li class="currentpage">
+                ${topic.pageNavigator.currentPage+1}
+            </li>
+            
+            <c:forEach items="#{topic.pageNavigator.currentPaginationRight}" var="pageNumber">
+                <li>
+                    <h:outputLink id="_${pageNumber-1}outputLink21" value="#{forums:outputLink(shared.links['topic'],true)}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:param name="page" value="${pageNumber-1}"/>
+                        <h:outputText value="${pageNumber}"/>
+                    </h:outputLink>  
+                </li>
+            </c:forEach>
+            
+            <c:choose>
+                <c:when test="#{topic.pageNavigator.currentPage eq (topic.pageNavigator.totalPages-1) }">
+                    <li class="disablepage">
+                        ${resource.Next} &#62;
+                    </li>
+                    <li class="disablepage">
+                        ${resource.Last}
+                    </li>
+                </c:when>
+                <c:otherwise>
+                    <li>
+                        <h:outputLink id="outputLink22" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.currentPage+1}"/>
+                            <h:outputText value="${resource.Next} &#62;"/>
+                        </h:outputLink>
+                    </li>
+                    <li>
+                        <h:outputLink id="outputLink23" value="#{forums:outputLink(shared.links['topic'],true)}">
+                            <f:param name="t" value="#{topic.topic.id}"/>
+                            <f:param name="page" value="${topic.pageNavigator.totalPages-1}"/>
+                            <h:outputText value="${resource.Last}"/>
+                        </h:outputLink>
+                    </li>
+                </c:otherwise>
+            </c:choose>
+        </ul>
+    </div>
+    </c:if>
+
+    <!-- insert the newTopic and replyTopic buttons here -->
+    <div id="miviewtopicbody12" class="actionbuttons">
+    <h:form>
+    <c:choose>
+    
+        <c:when test="#{topic.topic.forum.status == forums:constantInt('FORUM_LOCKED')}">
+        
+            <!-- new topic -->
+            <img border="0"
+                 src="#{forums:themeURL('resourcePostLockedURL')}"
+                 alt="${resource.Forum_locked}" />
+                 
+            <!-- reply -->
+            <img border="0"
+                 src="#{forums:themeURL('resourceReplyLockedURL')}"
+                 alt="${resource.Forum_locked}" />
+        </c:when>
+        
+        <c:when test="#{(topic.topic.status == forums:constantInt('TOPIC_LOCKED'))
+                      &amp;&amp; (topic.topic.forum.status != forums:constantInt('FORUM_LOCKED'))}">
+                      
+            <!-- new topic -->
+            <forums:isAllowed fragment="acl://newTopic" contextData="#{topic.topic.forum}">
+            <h:commandLink id="newTopic" action="#{newTopic.start}">
+                <f:param name="f" value="#{topic.topic.forum.id}"/>
+                <f:verbatim>
+                    <img border="0"
+                         src="#{forums:themeURL('resourcePostNewURL')}"
+                         alt="${resource.Post_new_topic}"/>
+                </f:verbatim>
+            </h:commandLink>
+            </forums:isAllowed>
+
+            <!-- reply -->
+            <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+            <img border="0"
+                 src="#{forums:themeURL('resourceReplyLockedURL')}"
+                 alt="${resource.Topic_locked}" />
+            </forums:isAllowed>
+        </c:when>
+        
+        <c:otherwise>
+
+            <!-- new topic -->
+            <forums:isAllowed fragment="acl://newTopic" contextData="#{topic.topic.forum}">
+                <h:commandLink id="newTopic" action="#{newTopic.start}">
+                    <f:param name="f" value="#{topic.topic.forum.id}"/>
+                    <f:verbatim>
+                        <img border="0"
+                             src="#{forums:themeURL('resourcePostNewURL')}"
+                             alt="${resource.Post_new_topic}"/>
+                    </f:verbatim>
+                </h:commandLink> 
+            </forums:isAllowed>
+                        
+            <!-- reply -->
+            <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+                <h:commandLink id="replyTopic" action="#{replyTopic.start}">
+                    <f:param name="f" value="#{topic.topic.forum.id}"/>
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img border="0"
+                             src="#{forums:themeURL('resourceReplyNewURL')}"
+                             alt="${resource.Reply_to_topic}" />
+                    </f:verbatim>
+                </h:commandLink>
+            </forums:isAllowed>
+            
+        </c:otherwise>
+        
+    </c:choose>
+    </h:form>
+    </div>
+
+    <forums:isAllowed fragment="acl://reply" contextData="#{topic.topic}">
+    <div class="foruminstantreply">
+    
+        <!-- instant reply widget -->
+        <script language='JavaScript' type='text/javascript'>
+            function checkForm()
+	        {
+                formErrors = false;
+                if (document.getElementById('post:message').value.length &#60; 1)
+	            {
+                    formErrors = "${resource.Empty_message}";
+                }
+	            if (formErrors)
+                {
+                    alert(formErrors);
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            }
+        </script>
+        
+        <h:form id="post">
+        
+            <input type="hidden" name="f" value="#{topic.topic.forum.id}"/>
+            <input type="hidden" name="t" value="#{topic.topic.id}"/>
+            <!-- add this reply and navigate to the page that will have this reply -->
+            <input type="hidden" name="page" value="#{topic.pageNavigator.pageAfterAdd}"/>
+            
+            <label class="forumformlabelbold">${resource.Instant_reply}</label>
+            <br />
+            <h:inputTextarea id="message" value="#{replyTopic.message}" rows="8" styleClass="forumformtextfield550px"></h:inputTextarea>
+            <div class="forumformbuttonrow">
+                <ul>
+                    <li>
+                        <h:commandButton action="#{replyTopic.startInstantReplyPreview}"
+                                         value="${resource.Preview}"
+                                         styleClass="buttonMed"
+                                         onclick="return checkForm();"/>
+                    </li>
+                    <li>
+                        <h:commandButton action="#{replyTopic.executeInstantReply}"
+                                         value="${resource.Submit}"
+                                         styleClass="buttonMed"
+                                         onclick="return checkForm();">
+                          <f:actionListener type="org.jboss.portlet.forums.ui.event.FloodControlListener" />
+                        </h:commandButton>
+                    </li>
+                </ul>
+            </div>
+        </h:form>
+    </div>
+    </forums:isAllowed>
+
+    <hr class="forumdashedHR" />
+
+    <div id="miviewtopicbody15" class="forumlegendjumpboxfloat">
+        <ui:include src="/views/jumpbox.xhtml"/>
+    </div>
+
+    <forums:isAllowed fragment="acl://moderateForum" contextData="#{forum.forum}">
+    <c:if test="#{moderator.initialized &amp;&amp; moderator.forum!=null &amp;&amp; moderator.forum.id!=-1}">
+    <div id="miviewtopicbody16" class="admintools">
+    <h:form>
+        <ul>
+        
+            <li>
+                ${resource.Thread_moderation}:
+            </li>
+            
+            <forums:isAllowed fragment="acl://deleteTopics" contextData="#{forum.forum}">
+            <li>
+                <h:commandLink action="#{moderator.deleteConfirm}">
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img width="17" height="17" border="0"
+                             src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                             alt="${resource.Delete_topic}" />
+                    </f:verbatim>
+                </h:commandLink>
+            </li>
+            </forums:isAllowed>
+            
+            <forums:isAllowed fragment="acl://moveTopics" contextData="#{forum.forum}">
+            <li>
+                <h:commandLink action="#{moderator.moveConfirm}">
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img width="17" height="17" border="0"
+                             src="#{forums:themeURL('resourceTopicModMoveURL')}"
+                             alt="${resource.Move_topic}" />
+                    </f:verbatim>
+                </h:commandLink>
+            </li>
+            </forums:isAllowed>
+            
+            <forums:isAllowed fragment="acl://lockTopics" contextData="#{forum.forum}">
+            <c:choose>
+            
+                <c:when test="#{topic.topic.status!=forums:constantInt('TOPIC_LOCKED')}">
+                <li>
+                    <h:commandLink action="#{moderator.lockTopic}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:verbatim>
+                            <img width="17" height="17" border="0"
+                                 src="#{forums:themeURL('resourceTopicModLockURL')}"
+                                 alt="${resource.Lock_topic}"/>
+                        </f:verbatim>
+                    </h:commandLink>
+                </li>
+                </c:when>
+                
+                <c:otherwise>
+                <li>
+                    <h:commandLink action="#{moderator.unlockTopic}">
+                        <f:param name="t" value="#{topic.topic.id}"/>
+                        <f:verbatim>
+                            <img width="17" height="17" border="0"
+                                 src="#{forums:themeURL('resourceTopicModUnlockURL')}"
+                                 alt="${resource.Unlock_topic}"/>
+                        </f:verbatim>
+                    </h:commandLink>
+                </li>
+                </c:otherwise>
+                
+            </c:choose>
+            </forums:isAllowed>
+            
+            <forums:isAllowed fragment="acl://splitTopic" contextData="#{forum.forum},#{topic.topic}">
+            <li>
+                <h:outputLink id="outputLink24" value="#{forums:outputLink(shared.links['topicSplit'],true)}">
+                    <f:param name="t" value="#{topic.topic.id}"/>
+                    <f:verbatim>
+                        <img width="17" height="17" border="0"
+                             src="#{forums:themeURL('resourceTopicModSplitURL')}"
+                             alt="${resource.Split_topic}"/>
+                    </f:verbatim>
+                </h:outputLink>
+            </li>
+            </forums:isAllowed>
+            
+        </ul>
+    </h:form>
+    </div>
+    </c:if>
+    </forums:isAllowed>
+
+    </forums:isAllowed>
+    </forums:isAllowed>
+    </c:when>
+
+    <c:otherwise>
+        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+            <tr>
+                <td>
+                    <table width="100%" cellspacing="0" cellpadding="1" border="0">
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                        <tr>
+                            <td align="center">
+                                ${resource.No_posts_topic}
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>&#160;</td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </c:otherwise>
+</c:choose>
+
+</ui:define>
+</ui:composition>
+</div>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,77 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.                   *
+ ******************************************************************************/
+-->
+
+<td  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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      colspan="2">
+
+<h:form>
+    <input type="hidden" name="t" value="#{t}" />
+    <table cellspacing="0" cellpadding="0" border="0" class="forumPollTable">
+        <tr>
+            <td colspan="2" class="questionCell">#{poll.title}</td>
+        </tr>
+        
+        <c:forEach items="#{poll.options}" var="optionrow" varStatus="status">
+        <tr>
+            <forums:isAllowed fragment="acl://votePoll" contextData="#{poll}"> 
+            <td class="radioCell">
+                <input type="radio" name="vote" value="#{(status.index)}"/>
+            </td>
+            </forums:isAllowed>
+            <td class="answerCell">
+                #{optionrow.question}
+            </td>
+        </tr>
+        </c:forEach>
+        
+        <forums:isAllowed fragment="acl://votePoll" contextData="#{poll}">
+        <tr>
+            <td class="buttonCell" colspan="2">
+            <h:commandButton action="#{pollController.vote}"
+                             value="${resource.Submit_vote}"
+                             styleClass="buttonMed"/>
+            </td>
+        </tr>
+        </forums:isAllowed>
+        
+        <tr>
+            <td class="linkCell" colspan="2">
+                <!-- view results link -->
+                <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                    <f:param name="t" value="${t}"/>
+                    <f:param name="results" value="1"/>
+                    <h:outputText value="${resource.View_results}"/>
+                </h:outputLink>
+            </td>
+        </tr>
+    </table>
+</h:form>
+</td>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,89 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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.                   *
+ ******************************************************************************/
+-->
+
+<td  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:t="http://myfaces.apache.org/tomahawk"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      colspan="2">
+
+<table cellspacing="0" cellpadding="0" border="0" class="forumPollTable">
+
+    <!-- title -->
+    <tr>
+        <td class="questionCell" colspan="6">#{poll.title}</td>
+    </tr>
+    
+    <!-- option results -->
+    <c:forEach items="#{poll.options}" var="optionrow" varStatus="status">
+    <tr>
+        <td>#{optionrow.question}</td>
+        <td>
+            <table cellspacing="0" cellpadding="0" border="0" class="forumPollTableGraph">
+                <tr>
+                    <td>
+                        <img src="#{forums:themeURL('resourcePollVotingLBar')}"
+                             width="4"
+                             height="12" />
+                    </td>
+                    <td>
+                        <img src="#{forums:themeURL('resourcePollVotingBar')}"
+                             width="#{(forums:votePercent(poll,optionrow))*205}"
+                             height="12" />
+                    </td>
+                    <td>
+                        <img src="#{forums:themeURL('resourcePollVotingRBar')}" width="4" height="12" />
+                    </td>
+                </tr>
+            </table>
+        </td>
+        <td>${forums:percentStr(forums:votePercent(poll,optionrow))}</td>
+        <td>[ #{optionrow.votes} ]</td>
+    </tr>
+    </c:forEach>
+    
+    <!-- total result -->
+    <tr>
+        <td class="totalCell" colspan="6">Total Votes : #{poll.votesSum}</td>
+    </tr>
+    
+    <!-- switch back to the voting screen -->
+    <forums:isAllowed fragment="acl://votePoll" contextData="#{poll}">
+    <tr>
+        <td class="linkCell" colspan="6">
+            <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+                <f:param name="t" value="${t}"/>
+                <h:outputText value="${resource.View_ballot}"/>
+            </h:outputLink>
+        </td>
+    </tr>
+    </forums:isAllowed>
+    
+</table>
+
+</td>

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,100 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{forumWatch.anonymous==false}">
+<div class="forumsubscriptionconfirm">
+<h:form>
+
+    <h3>${resource.Subscribe_to_forum}</h3>
+    <p>${resource.Selected_forum}:</p>
+    <h4>#{forumWatch.forum.name}</h4>
+    <label>${resource.Notification_type}:</label>
+    <br />
+    <select name="notified_watch_type" id="notification">
+        <option value="-1">${resource.SELECT_NOTIFICATION_TYPE}</option>
+        <option value="2">${resource.EMAIL_NO_NOTIFICATION}</option>
+        <option value="0">${resource.EMAIL_LINKED_NOTIFICATION}</option>
+        <option value="1">${resource.EMAIL_EMBEDED_NOTIFICATION}</option>
+    </select>
+    <div class="forumformbuttonrow">
+        <ul>
+           <li>
+               <h:commandButton value="${resource.Add_Subscribtion}" 
+                                styleClass="buttonMed"
+                                action="#{forumWatch.activateWatch}" />
+           </li>
+           <li>
+               <h:commandButton action="#{forumWatch.cancel}"
+                                value="${resource.Cancel}"
+                                accesskey="c"
+                                tabindex="7"
+                                styleClass="buttonMed" />
+           </li>
+       </ul>
+       <input type="hidden" name="f" value="${forumWatch.selectedForum}" />
+   </div>
+   
+</h:form>
+</div>
+</c:if>
+
+<!-- in case of anonymous access -->
+<c:if test="#{forumWatch.anonymous==true}">
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+   <tr>
+      <td>
+         <table width="100%" cellspacing="0" cellpadding="1" border="0">
+            <tr>
+               <td>&#160;</td>
+            </tr>
+            <tr>
+               <td align="center">
+                    <h:outputText value="${resource.Watch_Login_Requirement}"/>
+               </td>
+            </tr>
+            <tr>
+               <td>&#160;</td>
+            </tr>
+         </table>
+      </td>
+   </tr>
+</table>
+</c:if>
+
+</ui:define>
+</ui:composition>
+   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/topicWatch.xhtml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/topicWatch.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/portal-forums-war/views/watches/topicWatch.xhtml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,100 @@
+<!--
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, 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="forumscontainer">
+     
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{topicWatch.anonymous==false}">
+<div class="forumsubscriptionconfirm">
+<h:form>
+
+    <h3>${resource.Subscribe_to_topic}</h3>
+    <p>${resource.Selected_topic}:</p>
+    <h4>#{topicWatch.topic.subject}</h4>
+    <label>${resource.Notification_type}:</label>
+    <br />
+    <select name="notified_watch_type" id="notification">
+        <option value="-1">${resource.SELECT_NOTIFICATION_TYPE}</option>
+        <option value="2">${resource.EMAIL_NO_NOTIFICATION}</option>
+        <option value="0">${resource.EMAIL_LINKED_NOTIFICATION}</option>
+        <option value="1">${resource.EMAIL_EMBEDED_NOTIFICATION}</option>
+    </select>
+    <div class="forumformbuttonrow">
+        <ul>
+           <li>
+               <h:commandButton value="${resource.Add_Subscribtion}" 
+                                styleClass="buttonMed"
+                                action="#{topicWatch.activateWatch}" />
+           </li>
+           <li>
+               <h:commandButton action="#{topicWatch.cancel}"
+                                value="${resource.Cancel}"
+                                accesskey="c"
+                                tabindex="7"
+                                styleClass="buttonMed" />
+           </li>
+       </ul>
+       <input type="hidden" name="t" value="${topicWatch.topicId}" />
+   </div>
+   
+</h:form>
+</div>
+</c:if>
+
+<!-- in case of anonymous access -->
+<c:if test="#{topicWatch.anonymous==true}">
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+   <tr>
+      <td>
+         <table width="100%" cellspacing="0" cellpadding="1" border="0">
+            <tr>
+               <td>&#160;</td>
+            </tr>
+            <tr>
+               <td align="center">
+                    <h:outputText value="${resource.Watch_Login_Requirement}"/>
+               </td>
+            </tr>
+            <tr>
+               <td>&#160;</td>
+            </tr>
+         </table>
+      </td>
+   </tr>
+</table>
+</c:if>
+
+</ui:define>
+</ui:composition>
+   
+</div>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/setup/setup.sql
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/setup/setup.sql	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/setup/setup.sql	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,6 @@
+-- Luca Stancapiano -- I add insert for jbp_forums_instances and jbp_forum_instance_id field into 
+-- jbp_forums_categories table 
+insert into jbp_forums_instances (jbp_id, jbp_name) values ('1', 'First Forum Instance');
+insert into jbp_forums_categories (jbp_id, jbp_order, jbp_title, jbp_forum_instance_id) values ('1', '10', 'Dummy demo category','1');
+insert into jbp_forums_forums (jbp_id, jbp_category_id, jbp_description, jbp_last_post_id, jbp_name, jbp_order, jbp_topic_count, jbp_post_count, jbp_prune_enable, jbp_prune_next, jbp_status, jbp_type) values ('1', '1', 'First description', null, 'First forum', '10', '0', '0', '1', '0', '0', '0');
+insert into jbp_forums_forums (jbp_id, jbp_category_id, jbp_description, jbp_last_post_id, jbp_name, jbp_order, jbp_topic_count, jbp_post_count, jbp_prune_enable, jbp_prune_next, jbp_status, jbp_type) values ('2', '1', 'Second description', null, 'Second forum', '20', '0', '0', '1', '0', '0', '0');

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/test/forums.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/test/forums.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/test/forums.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<dataset>
+   <jbp_forums_categories jbp_id="1" jbp_order="10" jbp_title="Dummy demo category"/>
+   <jbp_forums_forums jbp_id="1" jbp_category_id="1" jbp_description="First description" jbp_name="First forum"
+                      jbp_order="10" jbp_topic_size="0" jbp_post_size="0" jbp_prune_enable="1" jbp_prune_next="0"
+                      jbp_status="0" jbp_type="0"/>
+   <jbp_forums_forums jbp_id="2" jbp_category_id="1" jbp_description="Second description" jbp_name="Second forum"
+                      jbp_order="20" jbp_topic_size="0" jbp_post_size="0" jbp_prune_enable="1" jbp_prune_next="0"
+                      jbp_status="0" jbp_type="0"/>
+   <jbp_forums_forumswatch/>
+   <jbp_forums_polls/>
+   <jbp_forums_posts/>
+   <jbp_forums_topics/>
+   <jbp_forums_topicswatch/>
+   <jbp_forums_users/>
+</dataset>   
+   
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/test/hibernate.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/test/hibernate.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/test/hibernate.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,6 @@
+hibernate.dialect=org.hibernate.dialect.MySQLDialect
+hibernate.connection.driver_class=org.gjt.mm.mysql.Driver
+hibernate.connection.url=jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false
+hibernate.connection.username=portal
+hibernate.connection.password=portalpassword
+hibernate.connection.pool_size=1

Added: labs/jbossforums/branches/forums120P26/forums/src/resources/test/log4j.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/forums/src/resources/test/log4j.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/forums/src/resources/test/log4j.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,33 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+#log4j.appender.file=org.apache.log4j.FileAppender
+#log4j.appender.file.File=hibernate.log
+#log4j.appender.file.layout=org.apache.log4j.PatternLayout
+#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+
+log4j.rootLogger=info, stdout
+
+log4j.logger.net.sf.hibernate=info
+
+### log just the SQL
+log4j.logger.net.sf.hibernate.SQL=debug
+
+### log JDBC bind parameters ###
+log4j.logger.net.sf.hibernate.type=error
+
+### log schema export/update ###
+log4j.logger.net.sf.hibernate.tool.hbm2ddl=error
+
+### log cache activity ###
+#log4j.logger.net.sf.hibernate.cache=error
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+ant-1.6.2.jar
+licence : ASL 2.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/lib/ant.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/apache-ant/lib/ant.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+myfaces-api-1.1.1.jar
+tomahawk-1.1.1.jar
+licence : ASL 2.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-api.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-impl.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/myfaces-impl.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/tomahawk.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/apache-myfaces/lib/tomahawk.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+dbunit-2.1.jar
+licence : custom
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/lib/dbunit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/dbunit-dbunit/lib/dbunit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/dom4j/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/dom4j/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/dom4j/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,19 @@
+<project name="dom4j-component-info">
+
+   <!-- ============================================================ -->
+   <!-- DOM4J                                                        -->
+   <!-- ============================================================ -->
+
+   <component id="dom4j"
+              licenseType="dom4j"
+              version="1.6.1jboss"
+              projectHome="http://dom4j.org/"
+              description="Library for XML, XPath and XSLT on the Java platform">
+      <artifact id="dom4j.jar"/>
+      <export>
+         <include input="dom4j.jar"/>
+      </export>
+   </component>
+
+
+</project>

Added: labs/jbossforums/branches/forums120P26/thirdparty/dom4j/lib/dom4j.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/dom4j/lib/dom4j.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/facelets/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/facelets/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/facelets/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,4 @@
+version: 1.1.13
+el-api.jar
+el-impl.jar
+jsf-facelets.jar

Added: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-api.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-ri.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/el-ri.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-example.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-example.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-facelets.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/facelets/lib/jsf-facelets.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,13 @@
+aspectjrt-1.1.1.jar
+licence : MPL 1.1
+
+commons-httpclient-2.0.jar
+licence : ASL 1.1
+
+commons-logging-1.0.3.jar
+licence : ASL 1.1
+
+-cactus-ant-1.6.1.jar
+-cactus-1.6.1.jar
+licence : ASL 2.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/aspectjrt.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/aspectjrt.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus-ant.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus-ant.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/cactus.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-httpclient.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-httpclient.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-logging.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-cactus/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-beanutils.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-beanutils.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-codec.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-codec.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-collections.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-collections.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-digester-1.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-digester-1.6.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-el.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-el.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-lang-2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons/lib/commons-lang-2.1.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons-jexl/lib/commons-jexl-1.0.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-commons-jexl/lib/commons-jexl-1.0.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+commons-fileupload-1.1-dev.jar
+licence : ASL 2.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/lib/commons-fileupload.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-fileupload/lib/commons-fileupload.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+log4j-1.2.8.jar
+licence : ASL 1.1
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/lib/log4j.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-log4j/lib/log4j.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+lucene-1.4.3.jar
+licence : ASL 2.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/lib/lucene.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jakarta-lucene/lib/lucene.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/javassist/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/javassist/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/javassist/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,18 @@
+<project name="javassist-component-info">
+   <!-- ============================================================ -->
+   <!-- Javassist                                                    -->
+   <!-- ============================================================ -->
+
+   <component id="javassist"
+              licenseType="lgpl"
+              version="3.3.0.GA"
+              projectHome="http://sourceforge.net/projects/jboss"
+              description="Simple Java bytecode manipulation (cvstag Javassist_3_3_GA)">
+      <artifact id="javassist.jar"/>
+      <export>
+         <include input="javassist.jar"/>
+      </export>
+   </component>
+
+
+</project>

Added: labs/jbossforums/branches/forums120P26/thirdparty/javassist/lib/javassist.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/javassist/lib/javassist.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,20 @@
+<project name="jboss-cache-component-info">
+
+   <!-- ============================================================ -->
+   <!-- jboss/cache                                                      -->
+   <!-- ============================================================ -->
+
+   <component id="jboss/cache"
+              version="1.4.1.SP5"
+              licenseType="lgpl"
+              projectHome="http://www.jboss.org/products/jbosscache"
+              description="JBoss Cache is a product designed to cache 
+              frequently accessed Java objects in order to dramatically improve 
+              the performance of e-business applications."
+   >
+      <artifact id="jboss-cache-jdk50.jar"/>
+      <export>
+         <include input="jboss-cache-jdk50.jar"/>
+      </export>
+   </component>
+</project>


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/component-info.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/lib/jboss-cache-jdk50.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-cache/lib/jboss-cache-jdk50.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,17 @@
+cglib-2.1.jar
+licence : ASL 2.0
+
+commons-logging-1.0.4.jar
+licence : ASL 1.1
+
+odmg-3.0.jar
+licence : LGPL
+
+hibernate-3.2.4.SP1_CP.jar
+licence : LGPL
+
+commons-collections-2.1.1.jar
+licence : ASL 1.1
+
+ehcache-1.1.jar
+licence : ASL 1.1

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-collections.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-collections.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-logging.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ehcache.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ehcache.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ejb3-persistence.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/ejb3-persistence.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate-commons-annotations.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate-commons-annotations.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/hibernate3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/odmg.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate/lib/odmg.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/hibernate-search.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/hibernate-search.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/lucene-core.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-hibernate-search/lib/lucene-core.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+jboss-j2ee-4.0.3SP1.jar
+licence : LGPL
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/lib/jboss-j2ee.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-j2ee/lib/jboss-j2ee.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-acl.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-acl.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-identity-management.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-identity-management.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-security-common.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-jaae-engine/lib/jboss-security-common.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+jboss-4.0.3SP1.jar
+licence : LGPL
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/lib/jboss.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-server/lib/jboss.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,6 @@
+jboss-common-4.0.3SP1.jar
+jboss-jmx-4.0.3SP1.jar
+jboss-system-4.0.3SP1.jar
+mail-4.0.4.jar
+licence : LGPL
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-common.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-common.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-jmx.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-jmx.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-system.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/jboss-system.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/mail.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jboss-system/lib/mail.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jbportal/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jbportal/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,2 @@
+JBoss Portal Version = 2.6.4GA
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/jboss-portlet-api-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/jboss-portlet-api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-api-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-common-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-common-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-test-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-core-test-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-faces-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-faces-lib.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-format-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-format-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-identity-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-identity-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-jems-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-jems-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-jsr168api-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-jsr168api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-portlet-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-server-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jbportal/lib/portal-server-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jdom/lib/jdom.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jdom/lib/jdom.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jflex/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jflex/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jflex/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,14 @@
+<project name="jflex-component-info">
+   <component id="jflex"
+              licenseType="gpl"
+              version="1.4.0"
+              projectHome="http://jflex.de/"
+              description="lexical analyzer generator">
+      <artifact id="jflex.jar"/>
+      
+      <export>
+         <include input="jflex.jar"/>         
+      </export>
+   </component>
+
+</project>
\ No newline at end of file

Added: labs/jbossforums/branches/forums120P26/thirdparty/jflex/lib/jflex.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jflex/lib/jflex.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jgroups/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jgroups/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jgroups/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,15 @@
+<project name="jgroups-component-info">
+
+   <component id="jgroups"
+      licenseType="lgpl"
+      version="2.4.1.SP4"
+      projectHome="http://www.jgroups.org"
+      description="JGroups is a toolkit for reliable multicast communication">
+
+      <artifact id="jgroups.jar"/>
+
+      <export>
+         <include input="jgroups.jar"/>
+      </export>
+   </component>
+</project>
\ No newline at end of file


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jgroups/component-info.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/thirdparty/jgroups/lib/jgroups.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jgroups/lib/jgroups.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+junit-3.8.1.jar
+licence : CPL 1.0
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/junit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/junit-junit/lib/junit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.httpunit.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.httpunit.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.httpunit.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,13 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated      
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation   
+the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and  
+to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions     
+of the Software.
+                                                                                                                  
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO  
+THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF         
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER          
+DEALINGS IN THE SOFTWARE.

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.jwebunit.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.jwebunit.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.jwebunit.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,36 @@
+/********************************************************************************
+ * jWebUnit, simplified web testing API for HttpUnit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 500
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., jWebUnit, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************/

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.nekohtml.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.nekohtml.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/LICENSE.nekohtml.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,47 @@
+The CyberNeko Software License, Version 1.0
+
+ 
+(C) Copyright 2002, Andy Clark.  All rights reserved.
+ 
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer. 
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in
+   the documentation and/or other materials provided with the
+   distribution.
+
+3. The end-user documentation included with the redistribution,
+   if any, must include the following acknowledgment:  
+     "This product includes software developed by Andy Clark."
+   Alternately, this acknowledgment may appear in the software itself,
+   if and wherever such third-party acknowledgments normally appear.
+
+4. The names "CyberNeko" and "NekoHTML" must not be used to endorse
+   or promote products derived from this software without prior 
+   written permission. For written permission, please contact 
+   andy at cyberneko.net.
+
+5. Products derived from this software may not be called "NekoHTML",
+   nor may "NekoHTML" appear in their name, without prior written
+   permission of the author.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+====================================================================
+
+This license is based on the Apache Software License, version 1.1.

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,21 @@
+jwebunit-1.2.jar
+licence : custom
+
+httpunit-1.5.4.jar
+licence : custom
+
+junit-3.8.1.jar
+licence : CPL 1.0
+
+nekohtml-0.8.1.jar
+licence : custom
+
+xercesImpl-2.6.2.jar
+licence : ASL 1.1
+
+js-1.5R4.1.jar
+licence : NPL 1.1
+
+xml-apis-1.0.b2.jar
+licence : ASL 1.1
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/httpunit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/httpunit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/js.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/js.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/junit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/junit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/jwebunit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/jwebunit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/nekohtml.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/nekohtml.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xerces.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xerces.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xml-apis.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/jwebunit-jwebunit/lib/xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/LICENSE.oswego.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/LICENSE.oswego.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/LICENSE.oswego.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,7 @@
+All classes are released to the public domain and may be used for any purpose
+whatsoever without permission or acknowledgment. Portions of the
+CopyOnWriteArrayList and ConcurrentReaderHashMap classes are adapted from Sun
+JDK source code. These are copyright of Sun Microsystems, Inc, and are used
+with their kind permission, as described in this license.
+http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/sun-u.c.license.pdf
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,3 @@
+concurrent-1.3.3.jar
+licence : custom
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/lib/concurrent.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/oswego-concurrent/lib/concurrent.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/rome/lib/rome-0.9.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/rome/lib/rome-0.9.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/component-info.xml
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/component-info.xml	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/component-info.xml	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,16 @@
+<project name="sun-javacc-component-info">
+
+   <component id="sun-javacc"
+              version="3.2-portal"
+              licenseType="bsd"
+              projectHome="https://javacc.dev.java.net/"
+              description="JavaCC is a parser/scanner generator for java"
+   >
+      <artifact id="JavaCC.zip"/>
+      <export>
+         <include input="JavaCC.zip"/>
+      </export>
+   </component>
+
+</project>
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/lib/JavaCC.zip
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/sun-javacc/lib/JavaCC.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/sun-portlet/lib/jsf-portlet.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/sun-portlet/lib/jsf-portlet.jar
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/jsp-api.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/jsp-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/servlet-api.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/sun-servlet/lib/servlet-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/README.txt
===================================================================
--- labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/README.txt	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/README.txt	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,12 @@
+xdoclet-1.2.3.jar
+xdoclet-ejb-module-1.2.3.jar
+xdoclet-hibernate-module-1.2.3.jar
+xdoclet-java-module-1.2.3.jar
+xdoclet-jboss-module-1.2.3.jar
+xdoclet-jmx-module-1.2.3.jar
+xdoclet-portlet-module-1.2.3.jar
+xdoclet-web-module-1.2.3.jar
+xdoclet-xdoclet-module-1.2.3.jar
+xdoclet-xjavadoc-1.2.3.jar
+license : BSD
+

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-collections-2.0.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-collections-2.0.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-logging.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-ejb-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-ejb-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-hibernate-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-hibernate-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-java-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-java-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jboss-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jboss-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jmx-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-jmx-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-portlet-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-portlet-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-web-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-web-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xdoclet-module.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xdoclet-module.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xjavadoc.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet-xjavadoc.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/thirdparty/xdoclet-xdoclet/lib/xdoclet.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/.donotremove
===================================================================

Added: labs/jbossforums/branches/forums120P26/tools/.project
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/.project	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/.project	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>tools</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Added: labs/jbossforums/branches/forums120P26/tools/bin/ant
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/ant	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/ant	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,192 @@
+#! /bin/sh
+
+#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+#   reserved.
+
+# load system-wide ant configuration
+if [ -f "/etc/ant.conf" ] ; then 
+  . /etc/ant.conf
+fi
+
+# provide default values for people who don't use RPMs
+if [ -z "$rpm_mode" ] ; then
+  rpm_mode=false;
+fi
+if [ -z "$usejikes" ] ; then
+  usejikes=false;
+fi
+
+# load user ant configuration
+if [ -f "$HOME/.antrc" ] ; then 
+  . "$HOME/.antrc"
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home   
+           fi
+           ;;
+esac
+
+if [ -z "$ANT_HOME" ] ; then
+  # try to find ANT
+  if [ -d /opt/ant ] ; then 
+    ANT_HOME=/opt/ant
+  fi
+
+  if [ -d "${HOME}/opt/ant" ] ; then 
+    ANT_HOME="${HOME}/opt/ant"
+  fi
+
+  ## resolve links - $0 may be a link to ant's home
+  PRG="$0"
+  progname=`basename "$0"`
+  saveddir=`pwd`
+
+  # need this for relative symlinks
+  cd `dirname "$PRG"`
+  
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+	PRG="$link"
+    else
+	PRG=`dirname "$PRG"`"/$link"
+    fi
+  done
+  
+  ANT_HOME=`dirname "$PRG"`/..
+
+  cd "$saveddir"
+
+  # make it fully qualified
+  ANT_HOME=`cd "$ANT_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$ANT_HOME" ] &&
+    ANT_HOME=`cygpath --unix "$ANT_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# set ANT_LIB location
+ANT_LIB="${ANT_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then 
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD=java
+  fi
+fi
+ 
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "  We cannot execute $JAVACMD"
+  exit 1
+fi
+
+if [ -n "$CLASSPATH" ] ; then
+  LOCALCLASSPATH="$CLASSPATH"
+fi
+
+# in rpm_mode get ant/optional/xml parser&api from JAVALIBDIR 
+if $rpm_mode; then
+  JAVALIBDIR=/usr/share/java
+  for i in ant ant-optional jaxp_parser xml_apis 
+  do
+    if [ -z "$LOCALCLASSPATH" ] ; then
+      LOCALCLASSPATH="$JAVALIBDIR/$i.jar"
+    else
+      LOCALCLASSPATH="$JAVALIBDIR/$i.jar":"$LOCALCLASSPATH"
+    fi
+  done
+
+  # in rpm mode ant/lib is in /usr/share/java/ant
+  ANT_LIB="${JAVALIBDIR}/ant"
+fi
+
+# add in the dependency .jar files in non-RPM mode (the default)
+for i in "${ANT_LIB}"/*.jar
+do
+  # if the directory is empty, then it will return the input string
+  # this is stupid, so case for it
+  if [ -f "$i" ] ; then
+    if [ -z "$LOCALCLASSPATH" ] ; then
+      LOCALCLASSPATH="$i"
+    else
+      LOCALCLASSPATH="$i":"$LOCALCLASSPATH"
+    fi
+  fi
+done
+
+if [ -n "$JAVA_HOME" ] ; then
+  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
+  fi
+
+  if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
+    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
+  fi
+
+  # OSX hack to make Ant work with jikes
+  if $darwin ; then
+    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
+    if [ -d ${OSXHACK} ] ; then
+      for i in ${OSXHACK}/*.jar
+      do
+        JIKESPATH="$JIKESPATH:$i"
+      done
+    fi
+  fi
+else
+  echo "Warning: JAVA_HOME environment variable is not set."
+  echo "  If build fails because sun.* classes could not be found"
+  echo "  you will need to set the JAVA_HOME environment variable"
+  echo "  to the installation directory of java."
+fi
+
+# Allow Jikes support (off by default)
+if $usejikes; then
+  ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
+  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
+  CYGHOME=`cygpath --path --windows "$HOME"`
+fi
+
+if [ -n "$CYGHOME" ]; then
+  if [ -n "$JIKESPATH" ]; then
+    JIKESPATH=`cygpath --path --windows "$JIKESPATH"`
+    "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" -Dcygwin.user.home="$CYGHOME" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
+  else
+    "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
+  fi
+else
+  if [ -n "$JIKESPATH" ]; then
+    "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
+  else
+    "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
+  fi
+fi
+


Property changes on: labs/jbossforums/branches/forums120P26/tools/bin/ant
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossforums/branches/forums120P26/tools/bin/ant.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/ant.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/ant.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,95 @@
+ at echo off
+
+REM   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+REM   reserved.
+
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
+
+if "%OS%"=="Windows_NT" @setlocal
+
+rem %~dp0 is expanded pathname of the current script under NT
+set DEFAULT_ANT_HOME=%~dp0..
+
+if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
+set DEFAULT_ANT_HOME=
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_CMD_LINE_ARGS=%1
+if ""%1""=="""" goto doneStart
+shift
+:setupArgs
+if ""%1""=="""" goto doneStart
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+rem This label provides a place for the argument list loop to break out 
+rem and for NT handling to skip to.
+:doneStart
+
+rem find ANT_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+if exist "%ANT_HOME%" goto checkJava
+
+rem check for ant in Program Files on system drive
+if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
+set ANT_HOME=%SystemDrive%\Program Files\ant
+goto checkJava
+
+:checkSystemDrive
+rem check for ant in root directory of system drive
+if not exist %SystemDrive%\ant\nul goto checkCDrive
+set ANT_HOME=%SystemDrive%\ant
+goto checkJava
+
+:checkCDrive
+rem check for ant in C:\ant for Win9X users
+if not exist C:\ant\nul goto noAntHome
+set ANT_HOME=C:\ant
+goto checkJava
+
+:noAntHome
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
+goto end
+
+:checkJava
+set LOCALCLASSPATH=%CLASSPATH%
+for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+set _JAVACMD=%JAVA_HOME%\bin\java.exe
+if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\tools.jar"
+if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\classes.zip"
+goto checkJikes
+
+:noJavaHome
+set _JAVACMD=java.exe
+echo.
+echo Warning: JAVA_HOME environment variable is not set.
+echo   If build fails because sun.* classes could not be found
+echo   you will need to set the JAVA_HOME environment variable
+echo   to the installation directory of java.
+echo.
+
+:checkJikes
+if not "%JIKESPATH%"=="" goto runAntWithJikes
+
+:runAnt
+"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
+goto end
+
+:runAntWithJikes
+"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
+goto end
+
+:end
+set LOCALCLASSPATH=
+set _JAVACMD=
+set ANT_CMD_LINE_ARGS=
+
+if "%OS%"=="Windows_NT" @endlocal
+
+:mainEnd
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
+

Added: labs/jbossforums/branches/forums120P26/tools/bin/antRun
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/antRun	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/antRun	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+#   reserved.
+
+# Args: DIR command
+cd "$1"
+CMD="$2"
+shift
+shift
+
+exec "$CMD" "$@"

Added: labs/jbossforums/branches/forums120P26/tools/bin/antRun.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/antRun.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/antRun.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,31 @@
+ at echo off
+
+REM   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+REM   reserved.
+
+if "%OS%"=="Windows_NT" @setlocal
+
+if ""%1""=="""" goto runCommand
+
+rem Change drive and directory to %1
+if "%OS%"=="Windows_NT" cd /d ""%1""
+if not "%OS%"=="Windows_NT" cd ""%1""
+shift
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of agruments (up to the command line limit, anyway).
+set ANT_RUN_CMD=%1
+if ""%1""=="""" goto runCommand
+shift
+:loop
+if ""%1""=="""" goto runCommand
+set ANT_RUN_CMD=%ANT_RUN_CMD% %1
+shift
+goto loop
+
+:runCommand
+rem echo %ANT_RUN_CMD%
+%ANT_RUN_CMD%
+
+if "%OS%"=="Windows_NT" @endlocal
+

Added: labs/jbossforums/branches/forums120P26/tools/bin/antRun.pl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/antRun.pl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/antRun.pl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+#######################################################################
+#
+# antRun.pl
+#
+# wrapper script for invoking commands on a platform with Perl installed
+# this is akin to antRun.bat, and antRun the SH script 
+#
+# created:         2001-10-18
+# last modified:   2001-11-13
+# author:          Jeff Tulley jtulley at novell.com 
+#######################################################################
+#be fussy about variables
+use strict;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info (currently unused)
+my $debug=1;
+
+#######################################################################
+# change drive and directory to "%1"
+my $ANT_RUN_CMD = @ARGV[0];
+
+# assign current run command to "%2"
+chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
+if ($^O eq "NetWare") {
+    # There is a bug in Perl 5 on NetWare, where chdir does not
+    # do anything.  On NetWare, the following path-prefixed form should 
+    # always work. (afaict)
+    $ANT_RUN_CMD .= "/". at ARGV[1];
+}
+else {
+    $ANT_RUN_CMD = @ARGV[1];
+}
+
+# dispose of the first two arguments, leaving only the command's args.
+shift;
+shift;
+
+# run the command
+my $returnValue = system $ANT_RUN_CMD, @ARGV;
+if ($returnValue eq 0) {
+    exit 0;
+}
+else {
+    # only 0 and 1 are widely recognized as exit values
+    # so change the exit value to 1
+    exit 1;
+}

Added: labs/jbossforums/branches/forums120P26/tools/bin/antx.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/antx.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/antx.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,6 @@
+ at echo off
+ at setlocal
+set CLASSPATH=%~dp0..\lib\ant.jar;%CLASSPATH%
+java org.apache.tools.ant.Launcher %*
+rem java -jar %ANT_HOME%\lib\ant.jar org.apache.tools.ant.Launcher
+ at endlocal

Added: labs/jbossforums/branches/forums120P26/tools/bin/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,83 @@
+ at echo off
+rem
+rem  Invokes the 'ant.bat' script from the 'tools' module.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:16:53 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+rem If not started by the loader script then setup some values
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..
+if x%MODULE_ROOT%==x set MODULE_ROOT=.
+
+rem Setup ant variables
+set ANT=%TOOLS_ROOT%\bin\ant.bat
+set ANT_HOME=%TOOLS_ROOT%
+if x%ANT_LOGGER%==x set ANT_LOGGER=org.apache.tools.ant.NoBannerLogger
+set ANT_OPTIONS=%ANT_OPTIONS% -logger %ANT_LOGGER%
+
+rem Set the minimum and maximum VM heap size
+if x%JVM_MS%==x set JVM_MS=32m
+if x%JVM_MX%==x set JVM_MX=640m
+if x%ANT_OPTS%==x set ANT_OPTS=-Xms%JVM_MS% -Xmx%JVM_MX%
+
+rem Save the arguments to the script
+set ARGS=%*
+
+rem Ignore the user's classpath
+set CLASSPATH=
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:set-jaxp
+set ANT_OPTS=%ANT_OPTS% -Djavax.xml.parsers.DocumentBuilderFactory=%1
+set ANT_OPTS=%ANT_OPTS% -Djavax.xml.parsers.SAXParserFactory=%2
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug MODULE_ROOT=%MODULE_ROOT%
+
+rem Setup JAXP impl
+if x%JAXP%==x set JAXP=crimson
+if %JAXP%==crimson call :set-jaxp org.apache.crimson.jaxp.DocumentBuilderFactoryImpl org.apache.crimson.jaxp.SAXParserFactoryImpl
+if %JAXP%==xerces call :set-jaxp org.apache.xerces.jaxp.DocumentBuilderFactoryImpl org.apache.xerces.jaxp.SAXParserFactoryImpl
+rem could complain if invalid JAXP here, but for now forget it
+
+rem Check if the script exits
+if exist %ANT% goto :execute-ant & goto :EOF
+
+echo %PROGNAME%: *ERROR* The ant script does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %ANT%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools'
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:execute-ant
+call :debug Ant JVM options: %ANT_OPTS%
+
+echo Executing %ANT% %ANT_OPTIONS% %ARGS%
+call %ANT% %ANT_OPTIONS% %ARGS%
+
+if x%NOPAUSE%==x pause
+
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/tools/bin/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,145 @@
+#!/bin/sh
+##
+##  Sets up the basic environment for Ant and then starts it.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:16:53 vietj Exp $
+
+# If we are running under Cygwin do some translation
+if [ ! -z "$COMSPEC" ]; then
+    temp=`cygpath --unix $0`
+else
+    temp="$0"
+fi
+PROGNAME=`basename $temp`
+DIRNAME=`dirname $temp`
+
+# If we have not been included from the loader script setup some values
+if [ "x$TOOLS_ROOT" = "x" ]; then
+    TOOLS_ROOT=`cd $DIRNAME/.. && pwd`
+fi
+if [ "x$MODULE_ROOT" = "x" ]; then
+    MODULE_ROOT=`pwd`;
+fi
+if [ "$CYGWIN" = true ]; then
+    TOOLS_ROOT=`cygpath --unix $TOOLS_ROOT`
+fi
+
+# Include common /bin/sh functions
+. "$TOOLS_ROOT/bin/common.shlib"
+
+# The minimum and maximum VM heap size
+xset JVM_MS="32m"
+xset JVM_MX="640m"
+
+# Detect which OS we are on
+check_os
+
+TOOLS_ROOT=`convertpath --unix $TOOLS_ROOT`
+MODULE_ROOT=`convertpath --unix $MODULE_ROOT`
+debug "TOOLS_ROOT: $TOOLS_ROOT"
+debug "MODULE_ROOT: $MODULE_ROOT"
+
+# Setup defaults
+xset MAX_FD "maximum"
+xset JAXP "crimson"
+
+# Ignore user's ANT_HOME if it is set
+if [ "x$ANT_HOME" != "x" ]; then
+    warn "Ignoring environment value for \$ANT_HOME"
+fi
+ANT_HOME=`convertpath --unix $TOOLS_ROOT`
+debug "Ant home: $ANT_HOME"
+
+# Use the color logger if requested
+if [ "x$ANT_COLOR" != "x" ]; then
+    xset ANT_LOGGER "org.apache.tools.ant.listener.AnsiColorLogger"
+else
+    xset ANT_LOGGER "org.apache.tools.ant.NoBannerLogger"
+fi
+debug "Using Ant logger: $ANT_LOGGER"
+
+# The nitty gritty dirty fluffy fluff
+main() {
+    # if there is a build config file. then source it
+    maybe_source "$MODULE_ROOT/build.conf" "$HOME/.build.conf"
+
+    # Increase the maximum file descriptors if we can
+    if [ $WIN32 = "false" ]; then
+	MAX_FD_LIMIT=`ulimit -H -n`
+	if [ $? -eq 0 ]; then
+	    if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+		# use the system max
+		MAX_FD="$MAX_FD_LIMIT"
+	    fi
+
+	    ulimit -n $MAX_FD
+	    if [ $? -ne 0 ]; then
+		warn "Could not set maximum file descriptor limit: $MAX_FD"
+	    fi
+	else
+	    warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+	fi
+    fi
+
+    # Make sure we have one
+    ANT="$ANT_HOME/bin/ant"
+    if [ ! -x "$ANT" ]; then
+	die "Ant script is not executable: $ANT"
+    fi
+
+    # Specify the jaxp parser impls to use
+    debug "JAXP type: $JAXP"
+    case "$JAXP" in
+	crimson)
+	    JAXP_DOM_FACTORY="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
+	    JAXP_SAX_FACTORY="org.apache.crimson.jaxp.SAXParserFactoryImpl"
+	    ;;
+	   
+	xerces)
+	    JAXP_DOM_FACTORY="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
+	    JAXP_SAX_FACTORY="org.apache.xerces.jaxp.SAXParserFactoryImpl"
+	    ;;
+
+        *)
+	    die "Unknown JAXP impl: $JAXP; define \$JAXP_DOM_FACTORY and \$JAXP_SAX_FACTORY"
+	    ;;
+    esac
+
+    # Set the options which ant will pass to its JVM
+    xset ANT_OPTS "-Xms$JVM_MS -Xmx$JVM_MX"
+
+    if [ "x$JAXP_DOM_FACTORY" != "x" ]; then
+	ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.DocumentBuilderFactory=$JAXP_DOM_FACTORY"
+    fi
+    if [ "x$JAXP_SAX_FACTORY" != "x" ]; then
+	ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.SAXParserFactory=$JAXP_SAX_FACTORY"
+    fi
+    debug "Ant JVM options: $ANT_OPTS"
+
+    # Add some options to Ant
+    xset ANT_OPTIONS "-logger $ANT_LOGGER"
+
+    # Unset the classpath so it will not interfear
+    CLASSPATH=""
+
+    # Export some stuff for Ant
+    export ANT ANT_HOME ANT_OPTS CLASSPATH
+
+    # Change to the directory where the script lives so users are not forced
+    # to be in the same directory as build.xml
+    debug "Entering $MODULE_ROOT"
+    cd $MODULE_ROOT
+
+    notice "Executing: $ANT $ANT_OPTIONS $@"
+    if [ "x$TRACE" != "x" ]; then
+	exec /bin/sh -x $ANT $ANT_OPTIONS "$@"
+    else
+	exec $ANT $ANT_OPTIONS "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"

Added: labs/jbossforums/branches/forums120P26/tools/bin/common.shlib
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/common.shlib	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/common.shlib	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,189 @@
+#!/bin/sh
+##
+##  Definitions of common /bin/sh functions.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: common.shlib,v 1.1.1.1 2005/01/14 23:16:53 vietj Exp $
+
+xset() # <var_name> <value>
+{
+    id=$1; shift; eval "value=\${$id}"
+    if [ "$value" = "" ]; then
+	eval "${id}=\"$*\""
+    fi
+}
+
+xset UNAME "uname"
+xset GAWK "gawk"
+xset EGREP "egrep"
+
+die() {
+    echo "${PROGNAME}: *FATAL* $*"
+    exit 1
+}
+
+warn() {
+    echo "${PROGNAME}: *WARNING* $*"
+}
+
+notice() {
+    echo "${PROGNAME}: $*"
+}
+
+debug() {
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: $*"
+    fi
+}
+
+search() {
+    mode="$1"; shift
+    suffix="$1"; shift
+    search="$*"
+
+    for d in $search; do
+	x="$d/$suffix"
+	if [ $mode "$x" ]; then
+	    # found a match
+	    echo $d
+	    break
+	fi
+    done
+}
+
+call () # <func_name>
+{
+    if [ -r "$RC" ]; then
+    	temp=`$EGREP "^${1} \(\)" $RC`
+	if [ "$temp" != "" ]; then
+	    eval $1
+	fi
+    fi
+}
+
+push () # <var_name> <list>
+{
+    _id=$1; _value=; shift
+    while [ "$1" != "" ]; do
+        eval "_value=$`echo $_id`"
+        eval "${_id}='`echo $_value` $1'"
+        shift
+    done
+    unset _id _value
+}
+
+prepend () # <var_name> <value>
+{
+    _id=$1; _value=; shift
+    eval "_value=$`echo $_id`"
+    eval "${_id}='${1}`echo $_value`'"
+    unset _id _value
+}
+
+append () # <var_name> <value>
+{
+    _id=$1; _value=; shift
+    eval "_value=$`echo $_id`"
+    eval "${_id}='`echo $_value`$1'"
+    unset _id _value
+}
+
+source () # <file_list>
+{
+    for file in "$*"; do
+	. $file
+    done
+}
+
+dump_var () # <var_name>
+{
+    _id=$1; _value=
+    eval "_value=$`echo $_id`"
+    echo "${_id}: $_value"
+}
+
+math () # <expression>
+{
+    echo `$GAWK "BEGIN { print $* }"`
+}
+
+pick () # <index> <list>
+{
+    c=1; i="$1"; shift
+    while [ "$c" -lt "$i" ]; do
+	c=`math $c + 1`
+	shift
+    done
+    echo "$1"
+}
+
+random () # <list>
+{
+    c=`echo $* | $WC -w`
+    i=`$GAWK "BEGIN{ srand(); print int( 1 + ( 1000000 * rand() ) % $c ) }"`
+    echo "`pick $i $*`"
+}
+
+check_arg () # <option_name> <expected_value>
+{
+    if [ "$2" = "" ]; then
+	die "option '$1' requires an additional argument"
+    fi
+}
+
+check_os() 
+{
+    # OS specific support (must be 'true' or 'false').
+    CYGWIN=false
+    DARWIN=false
+    WIN32=false
+    export CYGWIN DARWIN WIN32
+
+    systype=`$UNAME`
+    debug "System Type: $systype"
+    if [ -z "$systype" ]; then
+	die "Unable to determine system type; uname return null output."
+    fi
+
+    case "$systype" in
+	CYGWIN*)
+	    CYGWIN=true
+	    WIN32=true
+	    debug "Detected CYGWIN"
+	    ;;
+
+	Darwin*)
+	    DARWIN=true
+	    debug "Detected DARWIN (MacOS X)"
+	    ;;
+
+	*)
+	    if [ ! -z "$COMSPEC" ]; then
+		WIN32=true
+		debug "Detected generic win32 environemnt"
+	    fi
+	    ;;
+    esac
+}
+
+maybe_source() {
+    for file in $*; do
+	if [ -f "$file" ]; then
+	    . $file
+	fi
+    done
+}
+
+convertpath()
+{
+    options=$1; shift
+    temp=$*
+    if [ "$CYGWIN" = true ]; then
+	temp=`cygpath $options $temp`
+    fi
+    echo $temp
+}
+
+debug "Common functions loaded"

Added: labs/jbossforums/branches/forums120P26/tools/bin/complete-ant-cmd.pl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/complete-ant-cmd.pl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/complete-ant-cmd.pl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+#
+#   Copyright (c) 2001 The Apache Software Foundation.  All rights
+#   reserved.
+#
+# A script to allow Bash or Z-Shell to complete an Ant command-line.  
+#
+# To install for Bash 2.0 or better, add the following to ~/.bashrc:
+# 
+#     $ complete -C complete-ant-cmd ant build.sh
+#
+# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:
+#
+#     function ant_complete () {
+#         local args_line args
+#         read -l args_line
+#         set -A args $args_line
+#         set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)
+#     }
+#     compctl -K ant_complete ant build.sh
+#     
+# @author Mike Williams <mikew at cortexebusiness.com.au>
+
+my $cmdLine = $ENV{'COMP_LINE'};
+my $antCmd = $ARGV[0];
+my $word = $ARGV[1];
+
+my @completions;
+if ($word =~ /^-/) {
+    list( restrict( $word, getArguments() ));
+} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {
+    list( getBuildFiles($word) );
+} else {
+    list( restrict( $word, getTargets() ));
+}
+
+exit(0);
+
+sub list {
+    for (@_) {
+        print "$_\n";
+    }
+}
+
+sub restrict {
+    my ($word, @completions) = @_;
+    grep( /^\Q$word\E/, @completions );
+}
+
+sub getArguments {
+    qw(-buildfile -debug -emacs -f -find -help -listener -logfile 
+       -logger -projecthelp -quiet -verbose -version); 
+}
+
+
+sub getBuildFiles {
+    my ($word) = @_;
+    grep( /\.xml$/, glob( "$word*" ));
+}
+
+sub getTargets {
+
+    # Look for build-file
+    my $buildFile = 'build.xml';
+    if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {
+        $buildFile = $2;
+    }
+    return () unless (-f $buildFile);
+
+    # Run "ant -projecthelp" to list targets.  Keep a cache of results in a
+    # cache-file.
+    my $cacheFile = $buildFile;
+    $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
+    if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+        open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";
+        open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return(); 
+        my %targets;
+        while( <HELP> ) {
+            if (/^\s+(\S+)/) {
+                $targets{$1}++;
+            }
+        }
+        my @targets = sort keys %targets;
+        for (@targets) { print CACHE "$_\n"; }
+        return @targets;
+    }
+    
+    # Read the target-cache
+    open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";
+    my @targets;
+    while (<CACHE>) {
+        chop;
+        s/\r$//;  # for Cygwin
+        push( @targets, $_ );
+    }
+    close( CACHE );
+    @targets;
+
+}
+
+
+

Added: labs/jbossforums/branches/forums120P26/tools/bin/lcp.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/lcp.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/lcp.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,16 @@
+REM   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+REM   reserved.
+
+set _CLASSPATHCOMPONENT=%1
+if ""%1""=="""" goto gotAllArgs
+shift
+
+:argCheck
+if ""%1""=="""" goto gotAllArgs
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+shift
+goto argCheck
+
+:gotAllArgs
+set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH%
+

Added: labs/jbossforums/branches/forums120P26/tools/bin/runant.pl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/runant.pl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/runant.pl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,162 @@
+#!/usr/bin/perl
+#
+#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+#   reserved.
+#
+#######################################################################
+#
+# runant.pl
+#
+# wrapper script for invoking ant in a platform with Perl installed
+# this may include cgi-bin invocation, which is considered somewhat daft.
+# (slo: that should be a separate file which can be derived from this
+# and returns the XML formatted output)
+#
+# the code is not totally portable due to classpath and directory splitting
+# issues. oops. (NB, use File::Spec::Functions  will help and the code is
+# structured for the catfile() call, but because of perl version funnies
+# the code is not included. 
+#
+# created:         2000-8-24
+# last modified:   2000-8-24
+# author:          Steve Loughran steve_l at sourceforge.net
+#######################################################################
+#
+# Assumptions:
+#
+# - the "java" executable/script is on the command path
+# - ANT_HOME has been set
+# - target platform uses ":" as classpath separator or perl indicates it is dos/win32
+# - target platform uses "/" as directory separator.
+
+#be fussy about variables
+use strict;
+
+#platform specifics (disabled)
+#use File::Spec::Functions;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info
+my $debug=0;
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+
+my $HOME = $ENV{ANT_HOME};
+if ($HOME eq "")
+        {
+    die "\n\nANT_HOME *MUST* be set!\n\n";
+        }
+
+my $JAVACMD = $ENV{JAVACMD};
+$JAVACMD = "java" if $JAVACMD eq "";
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+  $onnetware = 1;
+}
+
+#ISSUE: what java wants to split up classpath varies from platform to platform 
+#and perl is not too hot at hinting which box it is on.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed.
+my $s=":";
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||
+   ($onnetware == 1))
+        {
+        $s=";";
+        }
+
+#build up standard classpath
+my $localpath=$ENV{CLASSPATH};
+if ($localpath eq "")
+        {
+        print "warning: no initial classpath\n" if ($debug);
+        $localpath="";
+        }
+if ($onnetware == 1)
+{
+# avoid building a command line bigger than 512 characters - make localpath
+# only include the "extra" stuff, and add in the system classpath as an expanded
+# variable. 
+  $localpath="";
+} 
+
+#add jar files. I am sure there is a perl one liner to do this.
+my $jarpattern="$HOME/lib/*.jar";
+my @jarfiles =glob($jarpattern);
+print "jarfiles=@jarfiles\n" if ($debug);
+my $jar;
+foreach $jar (@jarfiles )
+        {
+        $localpath.="$s$jar";
+        }
+
+#if Java home is defined, look for tools.jar & classes.zip and add to classpath
+my $JAVA_HOME = $ENV{JAVA_HOME};
+if ($JAVA_HOME ne "")
+        {
+        my $tools="$JAVA_HOME/lib/tools.jar";
+        if (-e "$tools")
+                {
+                $localpath .= "$s$tools";
+                }
+        my $classes="$JAVA_HOME/lib/classes.zip";
+        if (-e $classes)
+                {
+                $localpath .= "$s$classes";
+                }
+        }
+else
+        {
+    print "\n\nWarning: JAVA_HOME environment variable is not set.\n".
+                "If the build fails because sun.* classes could not be found\n".
+                "you will need to set the JAVA_HOME environment variable\n".
+                "to the installation directory of java\n";
+        }
+
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
+#jikes
+if($ENV{JIKESPATH} ne "")
+        {
+        push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
+        }
+
+#construct arguments to java
+my @ARGS;
+if ($onnetware == 1)
+{
+# make classpath literally $CLASSPATH; and then the contents of $localpath
+# this is to avoid pushing us over the 512 character limit
+# even skip the ; - that is already in $localpath
+  push @ARGS, "-classpath", "\$CLASSPATH$localpath";
+}
+else
+{
+  push @ARGS, "-classpath", "$localpath";
+}
+push @ARGS, "-Dant.home=$HOME";
+push @ARGS, @ANT_OPTS;
+push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;
+push @ARGS, @ARGV;
+
+print "\n $JAVACMD @ARGS\n\n" if ($debug);
+
+my $returnValue = system $JAVACMD, @ARGS;
+if ($returnValue eq 0)
+        {
+        exit 0;
+        }
+else
+        {
+        # only 0 and 1 are widely recognized as exit values
+        # so change the exit value to 1
+        exit 1;
+        }

Added: labs/jbossforums/branches/forums120P26/tools/bin/runant.py
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/runant.py	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/runant.py	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+"""
+
+ runant.py
+
+	This script is a translation of the runant.pl written by Steve Loughran.
+	It runs ant with/out arguments, it should be quite portable (thanks to
+	the python os library)
+	This script has been tested with Python2.0/Win2K
+
+        Copyright (c) 2001 The Apache Software Foundation.  All rights
+        reserved.
+
+ created:         2001-04-11
+ author:          Pierre Dittgen pierre.dittgen at criltelecom.com
+
+ Assumptions:
+
+ - the "java" executable/script is on the command path
+ - ANT_HOME has been set
+"""
+import os, os.path, string, sys
+
+# Change it to 1 to get extra debug information
+debug = 0
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+if not os.environ.has_key('ANT_HOME'):
+	print '\n\nANT_HOME *MUST* be set!\n\n'
+	sys.exit(1)
+else:
+	ANT_HOME = os.environ['ANT_HOME']
+
+if not os.environ.has_key('JAVACMD'):
+	JAVACMD = 'java'
+else:
+	JAVACMD = os.environ['JAVACMD']
+
+# Sets the separator char for CLASSPATH
+SEPARATOR = ':'
+if os.name == 'dos' or os.name == 'nt':
+	SEPARATOR = ';'
+
+# Build up standard classpath
+localpath = ''
+if os.environ.has_key('CLASSPATH'):
+	localpath = os.environ['CLASSPATH']
+else:
+	if debug:
+		print 'Warning: no initial classpath\n'
+
+# Add jar files
+LIBDIR = os.path.join(ANT_HOME, 'lib')
+jarfiles = []
+for file in os.listdir(LIBDIR):
+	if file[-4:] == '.jar':
+		jarfiles.append(os.path.join(LIBDIR,file))
+if debug:
+	print 'Jar files:'
+	for jar in jarfiles:
+		print jar
+localpath = localpath + SEPARATOR + string.join(jarfiles, SEPARATOR)
+
+# If JAVA_HOME is defined, look for tools.jar & classes.zip
+# and add to classpath
+if os.environ.has_key('JAVA_HOME') and os.environ['JAVA_HOME'] != '':
+	JAVA_HOME = os.environ['JAVA_HOME']
+	TOOLS = os.path.join(JAVA_HOME, os.path.join('lib', 'tools.jar'))
+	if os.path.exists(TOOLS):
+		localpath = localpath + SEPARATOR + TOOLS
+	CLASSES = os.path.join(JAVA_HOME, os.path.join('lib', 'classes.zip'))
+	if os.path.exists(CLASSES):
+		localpath = localpath + SEPARATOR + CLASSES
+else:
+	print '\n\nWarning: JAVA_HOME environment variable is not set.\n', \
+		'If the build fails because sun.* classes could not be found\n', \
+		'you will need to set the JAVA_HOME environment variable\n', \
+		'to the installation directory of java\n'
+
+# Jikes
+ANT_OPTS = []
+if os.environ.has_key('ANT_OPTS'):
+	ANT_OPTS = string.split(os.environ['ANT_OPTS'])
+if os.environ.has_key('JIKESPATH'):
+	ANT_OPTS.append('-Djikes.class.path=' + os.environ['JIKESPATH'])
+
+# Builds the commandline
+cmdline = '%s -classpath %s -Dant.home=%s %s org.apache.tools.ant.Main %s' \
+	 % (JAVACMD, localpath, ANT_HOME, string.join(ANT_OPTS,' '), \
+	 	string.join(sys.argv[1:], ' '))
+
+if debug:
+	print '\n%s\n\n' % (cmdline)
+
+# Run the biniou!
+os.system(cmdline)

Added: labs/jbossforums/branches/forums120P26/tools/bin/ubuild.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/bin/ubuild.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/bin/ubuild.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,81 @@
+ at echo off
+rem
+rem  Invokes the 'build.sh' script from the 'tools' module with
+rem  the ASH shell provided by the 'tools-win32' module.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: ubuild.bat,v 1.1.1.1 2005/01/14 23:16:53 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+rem If not started by the loader script then setup some values
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..
+if x%MODULE_ROOT%==x set MODULE_ROOT=.
+
+set SHELL=%TOOLS_ROOT%\win32\ash.exe
+set SHELL_OPTS=
+if not x%TRACE%==x set SHELL_OPTS=-x
+
+set BUILD_SH=%TOOLS_ROOT%\bin\build.sh
+set FALLBACK_BUILD_BAT=%TOOLS_ROOT%\bin\fb-build.bat
+set ARGS=%*
+
+rem Setup the command search path to include our binaries
+set PATH=%TOOLS_ROOT%\win32;%TOOLS_ROOT%\bin;%PATH%
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug MODULE_ROOT=%MODULE_ROOT%
+call :debug SHELL=%SHELL%
+call :debug PATH=%PATH%
+
+if exist %SHELL% goto :check-script & goto :EOF
+rem else fail, we can not go on (might consider just calling ant here 
+rem %FALLBACK_BUILD_BAT%)
+
+echo %PROGNAME%: *ERROR* The command shell does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %SHELL%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools-win32' 
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:check-script
+call :debug BUILD_SH=%BUILD_SH%
+if exist %BUILD_SH% goto :execute-shell & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target script does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %BUILD_SH%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' 
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:execute-shell
+call :debug Executing %SHELL% %SHELL_OPTS% %BUILD_SH% %ARGS%
+%SHELL% %SHELL_OPTS% %BUILD_SH% %ARGS%
+
+if x%NOPAUSE%==x pause
+
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/autoload.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/autoload.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/autoload.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,20 @@
+### ====================================================================== ###
+##                                                                          ##
+##  BuildMagic tasks which will be autoloaded.                              ##
+##                                                                          ##
+### ====================================================================== ###
+
+###  $Id: autoload.properties,v 1.1.1.1 2005/01/14 23:16:57 vietj Exp $ ###
+
+### Stuff that glues things together  ###
+
+resolveproperties=org.jboss.tools.buildmagic.task.ResolveProperties
+resolver=org.jboss.tools.buildmagic.task.ResolveProperties
+propertyfilter=org.jboss.tools.buildmagic.task.PropertyFilter
+require=org.jboss.tools.buildmagic.task.Require
+call=org.jboss.tools.buildmagic.task.CallTarget
+
+### Project/Module tasks ###
+
+execmodules=org.jboss.tools.buildmagic.task.module.ExecuteModules
+moduleconfig=org.jboss.tools.buildmagic.task.module.ModuleConfig

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/buildmagic.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/buildmagic.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/buildmagic.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,328 @@
+<!-- $Id: buildmagic.ent,v 1.9 2006/02/12 13:33:34 julien Exp $ -->
+
+<!-- ================================================================== -->
+<!-- Initialization                                                     -->
+<!-- ================================================================== -->
+
+<!-- Initialize the build system. -->
+<target name="_buildmagic:init" unless="init.disable">
+
+  <!-- Make sure we have the right version of Ant -->
+  <property name="buildmagic.ant.baseversion" value="1.5"/>
+
+  <!--
+     | Add new conditions for other supported Ant versions when they
+     | become avaialble.
+   -->
+
+  <condition property="buildmagic.ant.compatible">
+    <and>
+      <contains string="${ant.version}" 
+	        substring="Ant version ${buildmagic.ant.baseversion}"/>
+    </and>
+  </condition>
+
+  <!--fail unless="buildmagic.ant.compatible">
+
+  Unsupported Ant version:
+
+    ${ant.version}
+
+  Please install a version which is compatible with Ant ${buildmagic.ant.baseversion}.
+
+  </fail-->
+
+  <!-- JDK Detection -->
+  <available classname="java.lang.Void" property="HAVE_JDK_1.1"/>
+  <available classname="java.lang.ThreadLocal" property="HAVE_JDK_1.2"/>
+  <available classname="java.lang.StrictMath" property="HAVE_JDK_1.3"/>
+  <available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
+
+  <!-- Setup the project environment. -->
+  <dirname property="project.root" file="${basedir}"/>
+  <property name="project.build" value="${project.root}/build"/>
+  <property name="project.tools" value="${project.root}/tools"/>
+  <property name="project.thirdparty" value="${project.root}/thirdparty"/>
+
+  <!-- Setup the module environment. -->
+  <property name="module.root" value="${basedir}"/>
+  <property name="module.source" value="${module.root}/src"/>
+  <property name="module.output" value="${module.root}/output"/>
+  <property name="module.tools" value="${module.root}/tools"/>
+  <property name="module.thirdparty" value="${module.root}/thirdparty"/>
+
+  <!-- Load Buildmagic extention tasks. -->
+  <property name="buildmagic.local.classpath" value="."/>
+  <path id="buildmagic.task.classpath">
+    <fileset dir="${project.tools}/lib">
+      <include name="*"/>
+    </fileset>
+    <pathelement location="${project.tools}/lib"/>
+    <pathelement location="${project.tools}/etc"/>
+    <pathelement location="${project.tools}"/>
+    <pathelement path="${buildmagic.local.classpath}"/>
+  </path>
+  <taskdef file="${project.tools}/etc/buildfragments/autoload.properties"
+           classpathref="buildmagic.task.classpath"/>
+  <taskdef name="property" classname="org.jboss.tools.buildmagic.task.Property"
+           classpathref="buildmagic.task.classpath"/>
+
+  <!-- Include user and project property overrides. -->
+  <call target="_buildmagic:init:module-local-properties">
+    <available file="${module.root}/etc/local.properties-example" property="init.have-local-properties"/>
+  </call>
+  <property file="${module.root}/local.properties"/>
+  <call target="_buildmagic:init:project-local-properties">
+    <available file="${project.build}/etc/local.properties-example" property="init.have-local-properties"/>
+  </call>
+  <property file="${project.build}/local.properties"/>
+  <property file="${user.home}/.buildmagic.properties"/>
+  <property file="${user.home}/.ant.properties"/>
+
+  <!-- Setup the JBoss environment -->
+  <property environment="env"/>
+  <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+
+  <!-- Setup the build.log -->
+  <call target="_buildmagic:init:buildlog" unless="init-buildlog.disable"/>
+
+  <!-- Load common properties -->
+  <property file="${project.tools}/etc/buildfragments/common.properties"/>
+
+  <loadproperties srcFile="${project.root}/build/etc/hsqldb.properties">
+    <filterchain>
+      <prefixlines prefix="hsqldb."/>
+    </filterchain>
+  </loadproperties>
+  <loadproperties srcFile="${project.root}/build/etc/mysql.properties">
+    <filterchain>
+      <prefixlines prefix="mysql."/>
+    </filterchain>
+  </loadproperties>
+  <loadproperties srcFile="${project.root}/build/etc/oracle.properties">
+    <filterchain>
+      <prefixlines prefix="oracle."/>
+    </filterchain>
+  </loadproperties>
+  <loadproperties srcFile="${project.root}/build/etc/postgresql.properties">
+    <filterchain>
+      <prefixlines prefix="postgresql."/>
+    </filterchain>
+  </loadproperties>
+  <loadproperties srcFile="${project.root}/build/etc/sqlserver.properties">
+    <filterchain>
+      <prefixlines prefix="sqlserver."/>
+    </filterchain>
+  </loadproperties>
+
+  <!-- Do not continue if the database properties file does not exist -->
+  <condition property="database.properties.is.here">
+    <and>
+      <available file="${project.root}/build/etc/${portal.database}.properties"/>
+    </and>
+  </condition>
+  <fail unless="database.properties.is.here">
+The database properties file is not present
+  </fail>
+
+  <!-- Load database specific properties -->
+  <property file="${project.root}/build/etc/${portal.database}.properties"/>
+  <property name="hibernate.properties" value="${project.root}/build/etc/${portal.database}.properties"/>
+
+  <!-- Load single/clustered environment -->
+  <condition property="__file.to.load" value="clustered">
+     <istrue value="${portal.clustered}"/>
+  </condition>
+  <condition property="__file.to.load" value="single">
+     <not>
+        <isset property="${file.to.load}"/>
+     </not>
+  </condition>
+  <property file="${project.root}/build/etc/${__file.to.load}.properties"/>
+
+  <!-- Setup the build timestamp & build identifer properties -->
+  <tstamp>
+    <format property="build.number" pattern="yyyyMMddHHmm"/>
+    <format property="YEAR" pattern="yyyy"/>
+  </tstamp>
+  <property name="build.id" value="${build.number}"/>
+
+  <!-- Invoke the configure task -->
+  <call target="configure" unless="configure.disable"/>
+
+  <!-- Load common task properties -->
+  <property file="${project.tools}/etc/buildfragments/task.properties"/>
+
+  <property name="build-bypass.marker" value="${module.output}/build-marker"/>
+
+  <!-- Install filters -->
+  <propertyfilter all="${buildmagic.propertyfilter.all}"/>
+
+  <call target="_buildmagic:init:show-environment" if="init.verbose"/>
+
+  <!-- Finish up -->
+  <property name="init.disable" value="true"/>
+</target>
+
+<!-- Install the local.properties forthe module example if it is there -->
+<target name="_buildmagic:init:module-local-properties">
+  <!-- Setup the module local.properties file as needed -->
+  <copy file="${module.root}/etc/local.properties-example"
+        tofile="${module.root}/local.properties" filtering="yes"/>
+</target>
+
+<!-- Install the local.properties for the project example if it is there -->
+<target name="_buildmagic:init:project-local-properties">
+  <!-- Setup the project local.properties file as needed -->
+  <copy file="${project.build}/etc/local.properties-example"
+        tofile="${project.build}/local.properties" filtering="yes"/>
+</target>
+
+<!-- Initialize the build.log -->
+<target name="_buildmagic:init:buildlog">
+  <property name="buildlog.level" value="info"/>
+  <record name="${basedir}/build.log" append="no" loglevel="${buildlog.level}"/>
+  <property name="init-buildlog.disable" value="true" system="true"/>
+</target>
+
+<!-- Show the running environment if -Dinit.verbose=true -->
+<target name="_buildmagic:init:show-environment">
+  <echo><![CDATA[
+project.root:    ${project.root}
+module.root:     ${module.root}
+user.home:       ${user.home}
+build.compiler:  ${build.compiler}
+java.home:       ${java.home}
+java.class.path: ${java.class.path}
+java.version:    ${java.version}
+java.vendor:     ${java.vendor}
+java.vm.version: ${java.vm.version}
+java.vm.name:    ${java.vm.name}
+java.vm.info:    ${java.vm.info}
+os.name:         ${os.name}
+os.arch:         ${os.arch}
+os.version:      ${os.version}
+]]></echo>
+</target>
+
+<!-- ================================================================== -->
+<!-- Build Bypass                                                       -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:build-bypass-checker" depends="init" unless="build-bypass.disabled">
+
+   <uptodate property="build-bypass.on" targetfile="${build-bypass.marker}">
+      <srcfiles dir="${module.source}" includes="**/*"/>
+      <srcfiles dir="${module.root}" includes="build.xml,local.properties"/>
+      <srcfiles dir="${project.root}" includes="build/build.xml,build/local.properties"/>
+   </uptodate>
+
+</target>
+
+<target name="_buildmagic:build-bypass-notice" if="build-bypass.on">
+   <echo>
+Build disabled because module is already built. To force the module
+to build define build-bypass.disabled=true.
+   </echo>
+</target>
+
+<target name="_buildmagic:build-bypass-check" depends="_buildmagic:build-bypass-checker, _buildmagic:build-bypass-notice"/>
+
+
+<!-- ================================================================== -->
+<!-- Cleaning                                                           -->
+<!-- ================================================================== -->
+
+<!-- Clean up all build output -->
+<target name="_buildmagic:clean" depends="init">
+  <delete dir="${module.output}"/>
+</target>
+
+<!-- Clean up all generated files -->
+<target name="_buildmagic:clobber" depends="init">
+  <delete file="${module.root}/local.properties"/>
+
+  <!-- Try to stop the build log before we delete the file. -->
+  <record name="${module.root}/build.log" action="stop"/>
+
+  <!-- 
+     | This file may be opened still due and fail to be removed on win32
+     | systems, so lets just ignore those errors for now.
+   -->
+  <delete file="${module.root}/build.log" quiet="true" failonerror="false"/>
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Help                                                               -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:help:standard" depends="init">
+  <projecthelp taskname="help">
+    <header><![CDATA[
+  The ${module.Name} module.
+]]></header>
+      <footer><![CDATA[
+    -projecthelp for all targets
+    -help for full options
+]]></footer>
+  </projecthelp>
+</target>
+
+<target name="_buildmagic:help:build" depends="init">
+  <projecthelp taskname="help">
+      <header><![CDATA[
+  The ${module.Name} module.
+]]></header>
+      <footer><![CDATA[
+    -Dgroups=<group>[(,<group>)*]      Specify the module groups.
+    -Dmodules=<module>[(,<module>)*]   Specify the modules.
+                                       (overrides groups).
+    -projecthelp for all targets
+    -help for full options
+]]></footer>
+  </projecthelp>
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Release                                                            -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:release:zip" depends="init">
+  <zip zipfile="${module.output}/${release.id}.zip">
+    <fileset dir="${module.output}">
+      <include name="${release.id}/**"/>
+    </fileset>
+  </zip>
+</target>
+
+<target name="_buildmagic:release:tar" depends="init">
+  <tar tarfile="${module.output}/${release.id}.tar" longfile="gnu"
+       basedir="${module.output}"
+       includes="${release.id}/**">
+  </tar>
+</target>
+
+<target name="_buildmagic:release:tgz" depends="_buildmagic:release:tar">
+  <gzip src="${module.output}/${release.id}.tar"
+	zipfile="${module.output}/${release.id}.tgz"/>
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Install                                                            -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:install:default" depends="init">
+  <!-- Copy the output directory to the install directory -->
+  <mkdir dir="${install.root}"/>
+  <copy todir="${install.root}" filtering="no">
+    <fileset dir="${module.output}">
+       <include name="**/*"/>
+       <exclude name="${install.id}/**"/>
+    </fileset>
+  </copy>
+</target>
+
+

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/common.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/common.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/common.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,36 @@
+### ====================================================================== ###
+##                                                                          ##
+##  Copyright (c) 1998-2000 by Jason Dillon <jason at planet57.com>            ##
+##                                                                          ##
+##  This file is part of BuildMagic; an extension to Ant.                   ##
+##                                                                          ##
+##  This library 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 of the      ##
+##  License, or (at your option) any later version.                         ##
+##                                                                          ##
+##  This library 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.                         ##
+##                                                                          ##
+### ====================================================================== ###
+##                                                                          ##
+##  Common Properties                                                       ##
+##                                                                          ##
+### ====================================================================== ###
+
+###  $Id: common.properties,v 1.1.1.1 2005/01/14 23:16:57 vietj Exp $ ###
+
+buildmagic.resolveproperties.force=false
+buildmagic.propertyfilter.all=true
+
+### Jython Support ###
+
+true=1
+false=0
+
+### Misc ###
+
+/=${file.separator}
+sun.boot.classpath=${sun.boot.class.path}

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/defaults.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/defaults.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/defaults.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,149 @@
+<!-- $Id: defaults.ent,v 1.3 2005/02/18 11:11:57 theute Exp $ -->
+
+<target name="configure-defaults" unless="configure-defaults.disable">
+
+  <!-- =============== -->
+  <!-- Module defaults -->
+  <!-- =============== -->
+
+  <basename property="module.name" file="${basedir}"/>
+  <property name="module.Name" value="${ant.project.name}"/>
+
+  <property name="version.major" value="4"/>
+  <property name="version.minor" value="0"/>
+  <property name="version.revision" value="0"/>
+  <property name="version.tag" value="DR3"/>
+  <property name="version.name" value="Matrix2"/>
+  <property name="module.version" value="${version.major}.${version.minor}.${version.revision}${version.tag}"/>
+
+  <!-- This must be set to the CVS tag for any release -->
+  <property name="version.cvstag" value="JBoss_4_0_0_DR3"/>
+
+  <!-- Manifest version info -->
+  <property name="specification.title" value="JBoss"/>
+  <property name="specification.version" value="${version.major}.${version.minor}"/>
+  <property name="specification.vendor" value="JBoss Group, LLC (http://jboss.org)"/>
+
+  <property name="implementation.title" value="JBoss [${version.name}]"/>
+  <property name="implementation.url" value="http://jboss.org"/>
+  <property name="implementation.version" 
+            value="${version.major}.${version.minor}.${version.revision}${version.tag} (build: CVSTag=${version.cvstag} date=${build.id})"/>
+  <property name="implementation.vendor" value="JBoss Group, LLC"/>
+  <property name="implementation.vendor.id" value="${implementation.url}"/>
+
+
+  <!-- ========= -->
+  <!-- Locations -->
+  <!-- ========= -->
+
+  <!-- Where source files live -->
+  <property name="source.classes" value="${module.source}/main"/>
+  <property name="source.docs" value="${module.source}/docs"/>
+  <property name="source.etc" value="${module.source}/etc"/>
+  <property name="source.examples" value="${module.source}/examples"/>
+  <property name="source.bin" value="${module.source}/bin"/>
+  <property name="source.resources" value="${module.source}/resources"/>
+  <property name="source.stylesheets" value="${module.source}/stylesheets"/>
+  <property name="source.web" value="${module.source}/web"/>
+  <property name="source.test" value="${module.source}/test"/>
+
+  <!-- Where build generated files will go -->
+  <property name="build.api" value="${module.output}/api"/>
+  <property name="build.bin" value="${module.output}/bin"/>
+  <property name="build.classes" value="${module.output}/classes"/>
+  <property name="build.docs" value="${module.output}/docs"/>
+  <property name="build.stylesheets" value="${module.output}/stylesheets"/>
+  <property name="build.etc" value="${module.output}/etc"/>
+  <property name="build.examples" value="${module.output}/examples"/>
+  <property name="build.gen" value="${module.output}/gen"/>
+  <property name="build.gen.classes" value="${build.gen}/classes"/>
+  <property name="build.jmx-api" value="${module.output}/jmx-api"/>
+  <property name="build.jmx-doc" value="${module.output}/jmx-doc"/>
+  <property name="build.lib" value="${module.output}/lib"/>
+  <property name="build.deploy" value="${module.output}/deploy"/>
+  <property name="build.reports" value="${module.output}/reports"/>
+  <property name="build.resources" value="${module.output}/resources"/>
+  <property name="build.todo" value="${module.output}/todo"/>
+  <property name="build.web" value="${module.output}/web"/>
+  <property name="build.log" value="${module.output}/log"/>
+  <property name="build.cache" value="${module.output}/cache"/>
+  <property name="build.test" value="${module.output}/test"/>
+  <property name="build.gen.test" value="${build.gen}/test"/>
+
+  <!-- Legacy -->
+  <property name="build.metadata" value="${module.output}/metadata"/>
+  <property name="build.gen-src" value="${build.gen.classes}"/>
+  <property name="source.java" value="${source.classes}"/>
+  <property name="source.metadata" value="${module.source}/metadata"/>
+
+  <!-- Install/Release structure -->
+  <property name="install.id" value="${module.name}-${module.version}"/>
+  <property name="release.id" value="${install.id}"/>
+  <property name="install.root" value="${module.output}/${install.id}"/>
+
+  <property name="install.docs" value="${install.root}/docs"/>
+  <property name="install.api" value="${install.docs}/api"/>
+  <property name="install.jmx-api" value="${install.docs}/jmx-api"/>
+  <property name="install.todo" value="${install.docs}/todo"/>
+  <property name="install.examples" value="${install.docs}/examples"/>
+  <property name="install.dtd" value="${install.docs}/dtd"/>
+  <property name="install.bin" value="${install.root}/bin"/>
+  <property name="install.etc" value="${install.root}/etc"/>
+  <property name="install.client" value="${install.root}/client"/>
+  <property name="install.lib" value="${install.root}/lib"/>
+  <property name="install.tools" value="${install.root}/tools"/>
+  <property name="install.tools.xdoclet" value="${install.tools}/xdoclet"/>
+
+
+  <!-- ============= -->
+  <!-- Task defaults -->
+  <!-- ============= -->
+
+  <property name="xdoclet.mergedir" value="${project.tools}/etc/xdoclet/templates"/>
+
+  <!-- Access to environment variables -->
+  <property environment="env"/>
+
+  <!-- The combined thirdparty classpath -->
+  <path id="thirdparty.classpath">
+    <path refid="library.classpath"/>
+    <path refid="dependentmodule.classpath"/>
+  </path>
+
+  <property name="jar.update" value="true"/>
+  <property name="jar.index" value="true"/>
+
+  <property name="javac.depend.dump" value="true"/>
+  <property name="javac.depend.closure" value="false"/>
+  <property name="javac.depend.cachedir" value="${build.cache}/depends"/>
+
+
+  <property name="javac.source" value="1.5"/>
+  <property name="javac.target" value="1.5"/>
+  <property name="rmic.stubVersion" value="1.2"/>
+
+  <!-- classpath and local.classpath must have a value using with a path -->
+  <property name="classpath" value=""/>
+  <property name="local.classpath" value=""/>
+
+  <!-- The classpath required to build classes. -->
+  <path id="javac.classpath">
+    <pathelement path="${classpath}"/>
+    <pathelement path="${local.classpath}"/>
+    <path refid="thirdparty.classpath"/>
+  </path>
+
+  <!-- The classpath required to build javadocs. -->
+  <path id="javadoc.classpath">
+    <path refid="javac.classpath"/>
+  </path>
+
+  <!-- Packages to include when generating api documentation -->
+  <property name="javadoc.packages" value="org.jboss.*"/>
+
+  <!-- Override JUnit defaults -->
+  <property name="junit.timeout" value="240000"/> <!-- 4 minutes -->
+  <property name="junit.batchtest.todir" value="${build.reports}"/>
+  <property name="junit.jvm.options" value="-Ddummy"/>
+
+</target>

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/libraries.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/libraries.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/libraries.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,251 @@
+<!-- $Id: libraries.ent,v 1.24 2005/12/08 01:14:42 julien Exp $ -->
+
+<target name="libraries" depends="configure-libraries"/>
+
+<target name="configure-libraries" unless="configure-libraries.disable">
+
+  <!-- Apache Ant -->
+  <property name="apache.ant.root" value="${project.tools}"/>
+  <property name="apache.ant.lib" value="${apache.ant.root}/lib"/>
+  <path id="apache.ant.classpath">
+    <filelist dir="${apache.ant.lib}" files="ant.jar"/>
+  </path>
+
+  <!-- XDoclet -->
+  <property name="xdoclet.version" value="1.2.1"/>
+  <property name="xdoclet.xdoclet.root" value="${project.thirdparty}/xdoclet-xdoclet"/>
+  <property name="xdoclet.xdoclet.lib" value="${xdoclet.xdoclet.root}/lib"/>
+  <path id="xdoclet.xdoclet.classpath">
+    <filelist dir="${xdoclet.xdoclet.lib}" files="commons-collections-2.0.jar,commons-logging.jar,xdoclet.jar,xdoclet-xjavadoc.jar,xdoclet-ejb-module.jar,xdoclet-java-module.jar,xdoclet-jboss-module.jar,xdoclet-hibernate-module.jar,xdoclet-jmx-module.jar,xdoclet-porltet-module.jar,xdoclet-web-module.jar,xdoclet-xdoclet-module.jar"/>
+    <!--<path refid="apache.commons.classpath"/>-->
+  </path>
+
+  <!-- oswego-concurrent -->
+  <property name="oswego.concurrent.root" value="${project.thirdparty}/oswego-concurrent"/>
+  <property name="oswego.concurrent.lib" value="${oswego.concurrent.root}/lib"/>
+  <path id="oswego.concurrent.classpath">
+    <filelist dir="${oswego.concurrent.lib}" files="concurrent.jar"/>
+  </path>
+
+  <!-- Jakarta Log4j -->
+  <property name="jakarta.log4j.root" value="${project.thirdparty}/jakarta-log4j"/>
+  <property name="jakarta.log4j.lib" value="${jakarta.log4j.root}/lib"/>
+  <path id="jakarta.log4j.classpath">
+    <filelist dir="${jakarta.log4j.lib}" files="log4j.jar"/>
+  </path>
+
+  <!-- JBoss Server -->
+  <property name="jboss.server.root" value="${project.thirdparty}/jboss-server"/>
+  <property name="jboss.server.lib" value="${jboss.server.root}/lib"/>
+  <path id="jboss.server.classpath">
+    <pathelement path="${jboss.server.lib}/jboss.jar"/>
+  </path>
+
+  <!-- JBoss Cache -->
+  <property name="jboss.cache.root" value="${project.thirdparty}/jboss-cache"/>
+  <property name="jboss.cache.lib" value="${jboss.cache.root}/lib"/>
+  <path id="jboss.cache.classpath">
+    <pathelement path="${jboss.cache.lib}/jboss-cache-jdk50.jar"/>
+  </path>
+
+  <!-- JGroups -->
+  <property name="jgroups.root" value="${project.thirdparty}/jgroups"/>
+  <property name="jgroups.lib" value="${jgroups.root}/lib"/>
+  <path id="jgroups.classpath">
+    <pathelement path="${jgroups.lib}/jgroups.jar"/>
+  </path>
+
+  <!-- JBoss J2EE -->
+  <property name="jboss.j2ee.root" value="${project.thirdparty}/jboss-j2ee"/>
+  <property name="jboss.j2ee.lib" value="${jboss.j2ee.root}/lib"/>
+  <path id="jboss.j2ee.classpath">
+    <pathelement path="${jboss.j2ee.lib}/jboss-j2ee.jar"/>
+  </path>
+
+  <!-- JBoss System -->
+  <property name="jboss.system.root" value="${project.thirdparty}/jboss-system"/>
+  <property name="jboss.system.lib" value="${jboss.system.root}/lib"/>
+  <path id="jboss.system.classpath">
+    <pathelement path="${jboss.system.lib}/dtdparser121.jar"/>
+    <pathelement path="${jboss.system.lib}/jboss-common.jar"/>
+    <pathelement path="${jboss.system.lib}/jboss-jmx.jar"/>
+    <pathelement path="${jboss.system.lib}/jboss-system.jar"/>
+    <pathelement path="${jboss.system.lib}/jbossall-client.jar"/>
+    <pathelement path="${jboss.system.lib}/mail.jar"/>
+  </path>
+
+  <!-- JUnit -->
+  <property name="junit.junit.root" value="${project.thirdparty}/junit-junit"/>
+  <property name="junit.junit.lib" value="${junit.junit.root}/lib"/>
+  <path id="junit.junit.classpath">
+    <filelist dir="${junit.junit.lib}" files="junit.jar"/>
+  </path>
+
+  <!-- Sun servlet -->
+  <property name="sun.servlet.root" value="${project.thirdparty}/sun-servlet"/>
+  <property name="sun.servlet.lib" value="${sun.servlet.root}/lib"/>
+  <path id="sun.servlet.classpath">
+    <filelist dir="${sun.servlet.lib}" files="servlet-api.jar,jsp-api.jar"/>
+  </path>
+
+  <!-- Cactus -->
+  <property name="jakarta.cactus.root" value="${project.thirdparty}/jakarta-cactus"/>
+  <property name="jakarta.cactus.lib" value="${jakarta.cactus.root}/lib"/>
+  <path id="jakarta.cactus.classpath">
+    <filelist dir="${jakarta.cactus.lib}" files="cactus.jar, cactus-ant.jar, commons-httpclient.jar, commons-logging.jar, aspectjrt.jar"/>
+  </path>
+
+  <!-- Jakarta Lucene -->
+  <property name="jakarta.lucene.root" value="${project.thirdparty}/jakarta-lucene"/>
+  <property name="jakarta.lucene.lib" value="${jakarta.lucene.root}/lib"/>
+  <path id="jakarta.lucene.classpath">
+    <filelist dir="${jakarta.lucene.lib}" files="lucene.jar"/>
+  </path>
+
+  <!-- FileUpload -->
+  <property name="jakarta.fileupload.root" value="${project.thirdparty}/jakarta-fileupload"/>
+  <property name="jakarta.fileupload.lib" value="${jakarta.fileupload.root}/lib"/>
+  <path id="jakarta.fileupload.classpath">
+    <pathelement path="${jakarta.fileupload.lib}/commons-fileupload.jar"/>
+  </path>
+
+  <!-- jWebUnit -->
+  <property name="jwebunit.jwebunit.root" value="${project.thirdparty}/jwebunit-jwebunit"/>
+  <property name="jwebunit.jwebunit.lib" value="${jwebunit.jwebunit.root}/lib"/>
+  <path id="jwebunit.jwebunit.classpath">
+    <pathelement path="${jwebunit.jwebunit.lib}/jwebunit.jar"/>
+    <pathelement path="${jwebunit.jwebunit.lib}/httpunit.jar"/>
+    <pathelement path="${jwebunit.jwebunit.lib}/junit.jar"/>
+  </path>
+
+  <!-- DBUnit -->
+  <property name="dbunit.dbunit.root" value="${project.thirdparty}/dbunit-dbunit"/>
+  <property name="dbunit.dbunit.lib" value="${dbunit.dbunit.root}/lib"/>
+  <path id="dbunit.dbunit.classpath">
+    <pathelement path="${dbunit.dbunit.lib}/dbunit.jar"/>
+  </path>
+
+  <!-- Apache MyFaces -->
+  <property name="apache.myfaces.root" value="${project.thirdparty}/apache-myfaces"/>
+  <property name="apache.myfaces.lib" value="${apache.myfaces.root}/lib"/>
+  <path id="apache.myfaces.classpath">
+    <filelist dir="${apache.myfaces.lib}" files="myfaces-api.jar,myfaces-impl.jar,tomahawk.jar"/>
+  </path>
+
+  <!-- Facelets -->
+  <property name="facelets.root" value="${project.thirdparty}/facelets"/>
+  <property name="facelets.lib" value="${facelets.root}/lib"/>
+  <path id="facelets.classpath">
+    <filelist dir="${facelets.lib}" files="jsf-facelets.jar,el-api.jar,el-ri.jar,jsf-example.jar"/>
+  </path>
+
+  <!-- Hibernate -->
+  <property name="jboss.hibernate.root" value="${project.thirdparty}/jboss-hibernate"/>
+  <property name="jboss.hibernate.lib" value="${jboss.hibernate.root}/lib"/>
+  <path id="jboss.hibernate.classpath">
+    <filelist dir="${jboss.hibernate.lib}" files="cglib.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="commons-collections.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="commons-logging.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="hibernate3.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="odmg.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="hibernate-commons-annotations.jar"/>
+    <filelist dir="${jboss.hibernate.lib}" files="ejb3-persistence.jar"/>
+  </path>
+
+  <!-- Hibernate Search -->
+  <property name="jboss.hibernate.search.root" value="${project.thirdparty}/jboss-hibernate-search"/>
+  <property name="jboss.hibernate.search.lib" value="${jboss.hibernate.search.root}/lib"/>
+  <path id="jboss.hibernate.search.classpath">
+    <filelist dir="${jboss.hibernate.search.lib}" files="hibernate-search.jar"/>
+    <filelist dir="${jboss.hibernate.search.lib}" files="lucene-core.jar"/>
+  </path>
+
+  <!-- JBoss Portal Core dependency -->
+  <property name="jbportal.root" value="${project.thirdparty}/jbportal"/>
+  <property name="jbportal.lib" value="${jbportal.root}/lib"/>
+  <path id="jbportal.classpath">
+    <filelist dir="${jbportal.lib}" 
+		files="portal-core-lib.jar,
+		portal-format-lib.jar,
+		portal-common-lib.jar,
+		portal-portlet-lib.jar,
+		portal-server-lib.jar,
+		portal-portlet-jsr168api-lib.jar,
+		portal-identity-lib.jar,
+		portal-jems-lib.jar,
+		jboss-portlet-api-lib.jar,
+		portal-core-test-lib.jar,
+		portal-api-lib.jar,
+		portal-faces-lib.jar
+		"
+   />
+  </path>
+
+  <!-- JBoss JAAE engine dependency for the authorization plugin -->  
+  <property name="jboss-jaae-engine.root" value="${project.thirdparty}/jboss-jaae-engine"/>
+  <property name="jboss-jaae-engine.lib" value="${jboss-jaae-engine.root}/lib"/>
+  <path id="jboss-jaae-engine.classpath">
+    <filelist dir="${jboss-jaae-engine.lib}" files="jboss-acl.jar,jboss-identity-management.jar,jboss-security-common.jar"/>
+  </path>
+
+  <!-- Jakarta Common JEXL dependency -->  
+  <property name="jakarta-commons-jexl.root" value="${project.thirdparty}/jakarta-commons-jexl"/>
+  <property name="jakarta-commons-jexl.lib" value="${jakarta-commons-jexl.root}/lib"/>
+  <path id="jakarta-commons-jexl.classpath">
+    <filelist dir="${jakarta-commons-jexl.lib}" files="commons-jexl-1.0.jar"/>
+  </path>
+  
+  <!-- Rome -->
+  <property name="rome.root" value="${project.thirdparty}/rome"/>
+  <property name="rome.lib" value="${rome.root}/lib"/>
+  <path id="rome.classpath">
+    <filelist dir="${rome.lib}" files="rome-0.9.jar"/>
+  </path>
+
+  <!-- JDOM -->
+  <property name="jdom.root" value="${project.thirdparty}/jdom"/>
+  <property name="jdom.lib" value="${jdom.root}/lib"/>
+  <path id="jdom.classpath">
+    <filelist dir="${jdom.lib}" files="jdom.jar"/>
+  </path>
+
+  <!-- Jakarta commons -->
+  <property name="jakarta.commons.root" value="${project.thirdparty}/jakarta-commons"/>
+  <property name="jakarta.commons.lib" value="${jakarta.commons.root}/lib"/>
+  <path id="jakarta.commons.classpath">
+    <filelist dir="${commons.lib}" files="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.6.jar,commons-el.jar,commons-lang-2.1.jar"/>
+  </path>
+
+  <!-- Sun portlet -->
+  <property name="sun.portlet.root" value="${project.thirdparty}/sun-portlet"/>
+  <property name="sun.portlet.lib" value="${sun.portlet.root}/lib"/>
+  <path id="sun.portlet.classpath">
+    <filelist dir="${sun.portlet.lib}" files="jsf-portlet.jar"/>
+  </path>
+
+  <!-- JFlex -->
+  <property name="jflex.jflex.root" value="${project.thirdparty}/jflex"/>
+  <property name="jflex.jflex.lib" value="${jflex.jflex.root}/lib"/>
+  <path id="jflex.jflex.classpath">
+    <pathelement path="${jflex.jflex.lib}/jflex.jar"/>
+  </path>
+
+  <!-- JavaCC -->
+  <property name="sun.javacc.root" value="${project.thirdparty}/sun-javacc"/>
+  <property name="sun.javacc.lib" value="${sun.javacc.root}/lib"/>
+
+  <!-- Javassist -->
+  <property name="jboss.javassist.root" value="${project.thirdparty}/javassist"/>
+  <property name="jboss.javassist.lib" value="${jboss.javassist.root}/lib"/>
+  <path id="jboss.javassist.classpath">
+    <pathelement path="${jboss.javassist.lib}/javassist.jar"/>
+  </path>
+
+  <!-- Dom4j -->
+  <property name="dom4j.dom4j.root" value="${project.thirdparty}/dom4j"/>
+  <property name="dom4j.dom4j.lib" value="${dom4j.dom4j.root}/lib"/>
+  <path id="dom4j.dom4j.classpath">
+    <pathelement path="${dom4j.dom4j.lib}/dom4j.jar"/>
+  </path>
+
+</target>

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/modules.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/modules.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/modules.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,19 @@
+<!-- $Id: modules.ent,v 1.7 2005/11/25 23:44:07 julien Exp $ -->
+
+<target name="configure-modules" unless="configure-modules.disabled">
+
+  <!-- main forums module -->
+  <property name="forums.root" value="${project.root}/forums/output"/>
+  <property name="forums.lib" value="${forums.root}/lib"/>
+  <path id="forums.classpath">
+    <pathelement path="${forums.lib}/portal-forums-ui.jar"/>
+  </path>
+
+  <!-- Authorization plugin based on JAAE module -->
+  <property name="authz-jaae-plugin.root" value="${project.root}/authz-jaae-plugin/output"/>
+  <property name="authz-jaae-plugin.lib" value="${authz-jaae-plugin.root}/lib"/>
+  <path id="authz-jaae-plugin.classpath">
+    <pathelement path="${authz-jaae-plugin.lib}/forums-authz-plugin.jar"/>
+  </path>
+
+</target>

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/targets.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/targets.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/targets.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,883 @@
+<!-- $Id: targets.ent,v 1.3 2006/02/02 04:36:57 claprun Exp $ -->
+<!--
+   $Log: targets.ent,v $
+   Revision 1.3  2006/02/02 04:36:57  claprun
+   Updated for missing libraries.
+
+   Revision 1.2  2005/02/18 11:11:57  theute
+   Now it will compile as 1.4 if you use jdk 1.4 or 1.5
+
+   Revision 1.1.1.1  2005/01/14 23:16:58  vietj
+   portal reimport
+
+   Revision 1.2  2004/11/12 23:08:47  theute
+   Added some magic to build magic:
+   * Main build will no longer fail if there is no src/etc or src/resources directory.
+   * Changed wrong path for xdoclet
+   * Added deploy task, so now in nukes-2/build a simple "sh build.sh deploy" should compile everything and deploy nukes-core.sar
+
+   Revision 1.1.1.1  2004/08/16 13:57:29  vietj
+   tools structure for the build
+
+   Revision 1.1.1.1  2004/08/01 19:53:15  julien
+   blah
+
+   Revision 1.1.1.1  2004/06/23 22:00:52  julien
+   initial import
+
+   Revision 1.3  2004/03/02 22:36:04  vietj
+   the path for the xslt file was not good, fixed it
+
+   Revision 1.2  2004/03/02 22:21:12  vietj
+   added xslt target default:compile-ddl which compile XML ddl files into plain text ddl files
+
+   Revision 1.1.1.1  2003/11/02 12:50:55  cooperfbi
+   Reimport of the tools (HEAD) for nukes
+
+   Revision 1.17  2003/05/23 04:41:04  user57
+    o using latest bm w/o Ant override
+
+   Revision 1.16  2003/05/15 14:58:18  yanikc
+   Replaced tabs with spaces to make this file compliant with the
+   JBoss coding standards. Added the Log entry to display
+   cvs history in comment at the beginning of the file.
+
+-->
+
+<!-- ================================================================== -->
+<!-- Initialization                                                     -->
+<!-- ================================================================== -->
+
+<!--
+   | Initialize the build system.  Must depend on '_buildmagic:init'.
+   | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+<target name="_default:init" unless="init.disable" depends="_buildmagic:init">
+   <available property="source.resources.exists"
+               file="${source.resources}"
+               type="dir"
+               />
+   <available property="source.etc.exists"
+               file="${source.etc}"
+               type="dir"
+               />
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Compile                                                            -->
+<!-- ================================================================== -->
+
+<!-- Compile all class files -->
+<target name="_default:compile-classes" depends="init" unless="compile.disable">
+  <mkdir dir="${build.classes}"/>
+
+  <!-- Hack, required to avoid duplicate javac targets -->
+  <mkdir dir="${build.gen.classes}"/>
+
+  <!-- Remove classes which depend on changed files, so they will rebuild. -->
+  <depend srcdir="${source.java}:${build.gen.classes}"
+          destdir="${build.classes}"
+          dump="${javac.depend.dump}"
+          closure="${javac.depend.closure}">
+     <include name="${javac.includes}"/>
+     <exclude name="${javac.excludes}"/>
+  </depend>
+
+  <javac destdir="${build.classes}"
+         optimize="${javac.optimize}"
+         target="${javac.target}"
+         debug="${javac.debug}"
+         source="${javac.source}"
+    depend="${javac.depend}"
+    verbose="${javac.verbose}"
+    deprecation="${javac.deprecation}"
+    includeAntRuntime="${javac.include.ant.runtime}"
+    includeJavaRuntime="${javac.include.java.runtime}"
+    failonerror="${javac.fail.onerror}">
+     <src path="${source.java}:${build.gen.classes}"/>
+     <classpath refid="javac.classpath"/>
+     <include name="${javac.includes}"/>
+     <exclude name="${javac.excludes}"/>
+  </javac>
+</target>
+
+<!-- Compile all module test class files -->
+<target name="_default:compile-test-classes" depends="init" unless="compile.disable">
+
+  <mkdir dir="${build.test}"/>
+
+  <!-- Hack, required to avoid duplicate javac targets -->
+  <mkdir dir="${build.gen.test}"/>
+
+  <!-- Remove classes which depend on changed files, so they will rebuild. -->
+  <depend srcdir="${source.test}:${build.gen.test}"
+          destdir="${build.test}"
+          dump="${javac.depend.dump}"
+          closure="${javac.depend.closure}">
+     <include name="${javac.includes}"/>
+     <exclude name="${javac.excludes}"/>
+  </depend>
+
+  <javac destdir="${build.test}"
+         optimize="${javac.optimize}"
+         target="${javac.target}"
+         debug="${javac.debug}"
+    depend="${javac.depend}"
+    verbose="${javac.verbose}"
+    deprecation="${javac.deprecation}"
+    includeAntRuntime="${javac.include.ant.runtime}"
+    includeJavaRuntime="${javac.include.java.runtime}"
+    failonerror="${javac.fail.onerror}">
+     <src path="${source.test}:${build.gen.test}"/>
+     <classpath>
+       <path refid="javac.classpath"/>
+       <pathelement location="${build.classes}"/>
+     </classpath>
+     <include name="${javac.includes}"/>
+     <exclude name="${javac.excludes}"/>
+  </javac>
+</target>
+
+<target name="_default:check-exists-etc">
+  <condition property="source.etc.exists">
+       <available file="${source.etc}" type="dir"/>
+  </condition>
+</target>
+
+<!-- Compile manifests -->
+<target name="_default:compile-etc" depends="init, _default:check-exists-etc" unless="compile.disable" if="source.etc.exists">
+  <mkdir dir="${build.etc}"/>
+  <copy todir="${build.etc}" filtering="yes">
+    <fileset dir="${source.etc}">
+       <include name="**"/>
+    </fileset>
+  </copy>
+</target>
+
+<target name="_default:check-exists-resources">
+  <condition property="source.resources.exists">
+       <available file="${source.resources}" type="dir"/>
+  </condition>
+</target>
+
+<!-- Compile resource files -->
+<target name="_default:compile-resources" depends="init, _default:check-exists-resources" unless="compile.disable" if="source.resources.exists">
+  <mkdir dir="${build.resources}"/>
+  <copy todir="${build.resources}" filtering="yes">
+    <fileset dir="${source.resources}">
+      <patternset refid="compile-resources.filter.pattern"/>
+    </fileset>
+  </copy>
+  <copy todir="${build.resources}" filtering="no">
+    <fileset dir="${source.resources}">
+      <patternset refid="compile-resources.pattern"/>
+    </fileset>
+  </copy>
+</target>
+
+<patternset id="compile-resources.filter.pattern">
+  <include name="**/*"/>
+</patternset>
+
+<patternset id="compile-resources.pattern">
+  <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<!-- Compile stylesheets files -->
+<target name="_default:compile-stylesheets" depends="init" unless="compile.disable">
+  <mkdir dir="${build.stylesheets}"/>
+  <copy todir="${build.stylesheets}" filtering="yes">
+    <fileset dir="${source.stylesheets}">
+       <include name="**/*"/>
+    </fileset>
+  </copy>
+</target>
+
+<!-- Compile bin scripts -->
+<target name="_default:compile-bin" depends="init" unless="compile.disable">
+  <mkdir dir="${build.bin}"/>
+  <copy todir="${build.bin}" filtering="yes">
+    <fileset dir="${source.bin}">
+       <include name="**/*"/>
+    </fileset>
+  </copy>
+
+  <call target="_default:fix-bin"/>
+</target>
+
+<target name="_default:fix-bin" depends="init">
+  <fixcrlf srcdir="${build.bin}"
+        eol="lf" eof="remove"
+        includes="**/*.sh"/>
+
+  <fixcrlf srcdir="${build.bin}"
+        eol="crlf" eof="remove"
+        includes="**/*.bat, **/*.cmd"/>
+
+  <chmod perm="+x">
+    <fileset dir="${build.bin}">
+       <include name="**/*.sh"/>
+    </fileset>
+  </chmod>
+</target>
+
+<target name="_default:compile-web" depends="init" unless="compile.disable">
+  <mkdir dir="${build.web}"/>
+  <copy todir="${build.web}" filtering="yes">
+    <fileset dir="${source.web}">
+      <patternset refid="compile-web.filter.pattern"/>
+    </fileset>
+  </copy>
+  <copy todir="${build.web}" filtering="no">
+    <fileset dir="${source.web}">
+      <patternset refid="compile-web.pattern"/>
+    </fileset>
+  </copy>
+</target>
+
+<patternset id="compile-web.pattern">
+  <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<patternset id="compile-web.filter.pattern">
+  <include name="**/*"/>
+</patternset>
+
+<target name="_default:compile-checksums" depends="init" unless="compile.disable">
+  <checksum>
+    <fileset dir="${build.lib}">
+      <include name="*.jar"/>
+      <include name="*.zip"/>
+    </fileset>
+  </checksum>
+</target>
+
+<!-- Compile RMI stubs -->
+<target name="_default:compile-rmi" depends="init" unless="compile.disable">
+  <rmic base="${build.classes}"
+        verify="${rmic.verify}"
+   iiop="${rmic.iiop}"
+   iiopopts="${rmic.iiopops}"
+   idl="${rmic.idl}"
+   idlopts="${rmic.idlops}"
+   debug="${rmic.debug}"
+        stubVersion="${rmic.stubVersion}">
+    <classpath refid="javac.classpath"/>
+    <patternset refid="compile-rmi.pattern"/>
+  </rmic>
+</target>
+
+<patternset id="compile-rmi.pattern">
+  <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<!-- Compile ddl files for each database -->
+<target name="_default:compile-ddl" depends="init" unless="compile.disable">
+   <xslt
+      basedir="${build.resources}"
+      destdir="${build.resources}"
+      includes="*/setup.xml"
+      style="${jboss.nukes.root}/resources/setup-xml2ddl.xsl"
+      extension=".ddl"/>
+</target>
+
+<!-- ================================================================== -->
+<!-- Tests                                                              -->
+<!-- ================================================================== -->
+<!-- default test target.  To test a module, include
+  <target name="tests" depends="_default:tests"/>
+  in the module build file-->
+
+  <target name="_default:tests" depends="compile" unless="tests.disable">
+    <echo message="build.reports: ${build.reports}"/>
+    <echo message="build.test: ${build.test}"/>
+
+    <mkdir dir="${build.test}"/>
+
+    <!-- Hack, required to avoid duplicate javac targets -->
+    <mkdir dir="${build.gen.test}"/>
+
+    <path id="tests.classpath">
+      <pathelement path="${classpath}"/>
+      <pathelement path="${local.classpath}"/>
+      <pathelement path="${project.tools}/lib/ant.jar"/>
+      <pathelement path="${project.tools}/lib/junit.jar"/>
+      <pathelement path="${project.tools}/lib/optional.jar"/>
+      <path refid="thirdparty.classpath"/>
+<!-- FIXME: Need to add at least log4j here, what else? -->
+      <path refid="apache.log4j.classpath"/>
+    </path>
+
+    <!--default value, reset earlier if desired-->
+    <property name="log4j.configuration" value="file:${project.root}/testsuite/src/resources/log4j.xml"/>
+    <property name="test.pattern" value="**/*TestCase.class"/>
+    <echo message="test.pattern: ${test.pattern}"/>
+
+    <property name="jbosstest.data.dir" location="${module.output}/data"/>
+    <echo message="jbosstest.data.dir: ${jbosstest.data.dir}"/>
+
+    <mkdir dir="${build.reports}"/>
+    <mkdir dir="${build.log}"/>
+    <junit dir="${module.output}"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="${junit.fork}"
+           timeout="${junit.timeout}"
+           jvm="${junit.jvm}">
+
+      <jvmarg value="${junit.jvm.options}"/>
+      <sysproperty key="build.log" value="${build.log}"/>
+      <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
+      <sysproperty key="jbosstest.data.dir" value="${jbosstest.data.dir}"/>
+
+      <classpath>
+        <pathelement location="${build.classes}"/>
+        <pathelement location="${build.test}"/>
+        <pathelement location="${build.resources}"/>
+        <path refid="tests.classpath"/>
+      </classpath>
+
+      <formatter type="xml" usefile="${junit.formatter.usefile}"/>
+
+      <batchtest todir="${build.reports}"
+                 haltonerror="${junit.batchtest.haltonerror}"
+                 haltonfailure="${junit.batchtest.haltonfailure}"
+                 fork="${junit.batchtest.fork}">
+
+        <fileset dir="${build.test}">
+          <include name="${test.pattern}"/>
+        </fileset>
+      </batchtest>
+    </junit>
+  </target>
+  <!-- end _default:tests-->
+
+<!-- ================================================================== -->
+<!-- Documents                                                          -->
+<!-- ================================================================== -->
+
+<target name="_default:docs" description="Builds all documentation."
+   depends="docs-api,
+                 docs-todo"/>
+
+<!-- ======== -->
+<!-- JavaDocs -->
+<!-- ======== -->
+
+
+
+<target name="docs-javadocs-check" depends="init">
+
+  <!-- if index.html is newer than the sources we are up to date -->
+  <uptodate property="docs-javadocs.disable"
+         targetfile="${build.api}/index.html">
+    <srcfiles dir="${source.java}" includes="**/*.java"/>
+  </uptodate>
+</target>
+<target name="docs-javadocs" depends="init">
+   <call target="docs-javadocs_1_4" if="HAVE_JDK_1.4" />
+   <call target="docs-javadocs_1_3" unless="HAVE_JDK_1.4" />
+</target>
+  <!-- Generate Javadoc if we are out of date -->
+<target name="docs-javadocs_1_4"
+     depends="docs-javadocs-check"
+     unless="docs-javadocs.disable">
+
+  <mkdir dir="${build.api}"/>
+  <javadoc packagenames="${javadoc.packages}"
+             sourcepath="${source.classes}:${build.gen.classes}"
+             destdir="${build.api}"
+             classpathref="javadoc.classpath"
+             windowtitle="${javadoc.windowtitle}"
+        splitindex="${javadoc.splitindex}"
+             author="${javadoc.author}"
+             version="${javadoc.version}"
+             public="${javadoc.public}"
+             package="${javadoc.package}"
+             protected="${javadoc.protected}"
+             private="${javadoc.private}"
+             use="${javadoc.use}"
+        verbose="${javadoc.verbose}">
+    <doctitle><![CDATA[<h1>${module.Name} API Documentation</h1>]]></doctitle>
+    <bottom><![CDATA[
+      <i>
+      <div align="center">
+        <font size="-1">Copyright &#169; 2002 JBoss Group, LLC. All Rights Reserved.</font>
+      </div>
+      </i>
+    ]]></bottom>
+
+    <!--
+    <link href="http://java.sun.com/j2se/1.3/docs/api"/>
+      -->
+
+    <!-- Added links and tags by Yanik Crepeau <yanik at exScriptis.com> 2003-05-13 -->
+    <!--Thes tag declarations will shut down the Unknown tag warning during the javadoc process -->
+    <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+    <tag name="ejb.interface-method" description="ejb interface method delcaration" enabled="false" />
+    <tag name="ejb.persistence" description="ejb persistence declaration" enabled="false" />
+    <tag name="ejb.pk-field" description="ejb primary-key field declaration" enabled="false" />
+    <tag name="ejb.pk" description="ejb" enabled="false" />
+    <tag name="ejb.bean" description="ejb" enabled="false" />
+    <tag name="ejb.transaction" description="ejb" enabled="false" />
+    <tag name="ejb.finder" description="ejb" enabled="false" />
+    <tag name="ejb.relation" description="ejb" enabled="false" />
+    <tag name="ejb.create-method" description="ejb" enabled="false" />
+
+    <tag name="jboss.query" description="jboss" enabled="false" />
+    <tag name="jboss.lazy-load-group" description="jboss" enabled="false" />
+    <tag name="jboss.load-group" description="jboss" enabled="false" />
+    <tag name="jboss.persistence" description="jboss" enabled="false" />
+    <tag name="jboss.entity-command" description="jboss" enabled="false" />
+    <tag name="jboss.method-attribute" description="jboss" enabled="false" />
+    <tag name="jboss.relation" description="jboss" enabled="false" />
+    <tag name="jboss.method-attribute" description="jboss" enabled="false" />
+    <tag name="jboss.relation-read-ahead" description="jboss" enabled="false" />
+    <tag name="jboss.relation-table" description="jboss" enabled="false" />
+    <tag name="jboss.table-attribute" description="jboss" enabled="false" />
+
+    <tag name="jmx.managed-attribute" description="jmx" enabled="false" />
+    <tag name="jmx.managed-constructor" description="jmx" enabled="false" />
+    <tag name="jboss.method-attributes" description="jboss" enabled="false" />
+
+  </javadoc>
+</target>
+
+<target name="docs-javadocs_1_3"
+     depends="docs-javadocs-check"
+     unless="docs-javadocs.disable">
+
+  <mkdir dir="${build.api}"/>
+  <javadoc packagenames="${javadoc.packages}"
+             sourcepath="${source.classes}:${build.gen.classes}"
+             destdir="${build.api}"
+             classpathref="javadoc.classpath"
+             windowtitle="${javadoc.windowtitle}"
+        splitindex="${javadoc.splitindex}"
+             author="${javadoc.author}"
+             version="${javadoc.version}"
+             public="${javadoc.public}"
+             package="${javadoc.package}"
+             protected="${javadoc.protected}"
+             private="${javadoc.private}"
+             use="${javadoc.use}"
+        verbose="${javadoc.verbose}">
+    <doctitle><![CDATA[<h1>${module.Name} API Documentation</h1>]]></doctitle>
+    <bottom><![CDATA[
+      <i>
+      <div align="center">
+        <font size="-1">Copyright &#169; 2002 JBoss Group, LLC. All Rights Reserved.</font>
+      </div>
+      </i>
+    ]]></bottom>
+
+    <!--
+    <link href="http://java.sun.com/j2se/1.3/docs/api"/>
+      -->
+
+  </javadoc>
+</target>
+
+<target name="docs-api" depends="docs-javadocs"/>
+
+<target name="javadocs" depends="docs-javadocs"/>
+
+<!-- ========= -->
+<!-- TODO Docs -->
+<!-- ========= -->
+
+<target name="docs-todo-check" depends="init">
+
+  <!-- if index.html is newer than the sources we are up to date -->
+  <uptodate property="docs-todo.disable"
+         targetfile="${build.todo}/index.html">
+    <srcfiles dir="${source.java}" includes="**/*.java"/>
+  </uptodate>
+  </target>
+
+  <!-- Generate TODO list from @todo tags -->
+  <target name="docs-todo"
+     depends="docs-todo-check"
+     unless="docs-todo.disable">
+
+  <mkdir dir="${build.todo}"/>
+  <todo destdir="${build.todo}">
+    <fileset dir="${source.java}">
+      <include name="**/*.java"/>
+    </fileset>
+
+    <info/>
+  </todo>
+</target>
+
+<target name="todo" depends="docs-todo"/>
+
+<!-- ============== -->
+<!-- JMX MBean Docs -->
+<!-- ============== -->
+
+<target name="jmx-docs" depends="init">
+
+  <mkdir dir="${build.jmx-doc}"/>
+  <jmxdoclet destdir="${build.jmx-doc}"
+             force="false"
+        excludedtags="@version, at author">
+    <fileset dir="${source.java}">
+      <include name="**/*.java"/>
+    </fileset>
+    <jbossXmlDoc/>
+  </jmxdoclet>
+
+</target>
+
+<!-- Generate the plain HTML jmx docs -->
+<target name="docs-jmx-html-plain" depends="jmx-docs">
+
+  <!-- Force the use of SAXON XSLT -->
+  <property system="true"
+         name="javax.xml.transform.TransformerFactory"
+         value="com.icl.saxon.TransformerFactoryImpl"/>
+
+  <mkdir dir="${build.jmx-api}"/>
+  <style style="${project.thirdparty}/oasis/docbook-xsl/html/docbook.xsl"
+      processor="trax"
+      extension=".html"
+      basedir="${build.jmx-doc}"
+      destdir="${build.jmx-api}">
+    <include name="**/*.xml"/>
+    <param name="quiet" expression="${oasis.docbook.xsl.chunker.quiet}"/>
+    <param name="base.dir" expression="${build.jmx-api}${file.separator}"/>
+    <xmlcatalog>
+      <dtd
+          publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
+          location="${project.thirdparty}/oasis/docbook-xml/docbookx.dtd"/>
+    </xmlcatalog>
+  </style>
+
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Cleaning                                                           -->
+<!-- ================================================================== -->
+
+<!-- Clean up all build output -->
+<target name="_default:clean"
+     description="Cleans up most generated files."
+     depends="_buildmagic:clean">
+</target>
+
+<!-- Clean up all generated files -->
+<target name="_default:clobber"
+     description="Cleans up all generated files."
+     depends="_buildmagic:clobber, clean">
+</target>
+
+<target name="rebuild" depends="clean,most"/>
+
+
+<!-- ================================================================== -->
+<!-- Misc.                                                              -->
+<!-- ================================================================== -->
+
+<target name="_default:main"
+   description="Executes the default target (most)."
+   depends="most"/>
+
+<target name="_default:all"
+   description="Builds everything."
+   depends="most,docs"/>
+
+<target name="_default:most"
+   description="Builds almost everything."
+   depends="output"/>
+
+<target name="_default:help"
+        description="Show this help message."
+   depends="_buildmagic:help:standard"/>
+
+
+<!-- ================================================================== -->
+<!-- Install & Release                                                  -->
+<!-- ================================================================== -->
+
+<!--
+   | These are almost never overriden, so no need to force module build.xml
+   | to define them.
+ -->
+
+<target name="release-zip"
+   description="Builds a ZIP distribution."
+   depends="output, _buildmagic:release:zip"/>
+
+<target name="release-tar"
+   description="Builds a TAR distribution."
+   depends="output, _buildmagic:release:tar"/>
+
+<target name="release-tgz"
+   description="Builds a TAR-GZ distribution."
+   depends="output, _buildmagic:release:tgz"/>
+
+<target name="release-all"
+   description="Builds a distribution for each archive type."
+   depends="release-zip, release-tgz"/>
+
+
+  <!-- ================================================================== -->
+  <!-- Project (build module) Targets                                     -->
+  <!-- ================================================================== -->
+
+<!-- jason: this needs to be cleaned up -->
+
+<target name="configure-project" unless="configure-project.disable">
+
+    <!-- Bits for building source archives -->
+    <patternset id="source.ignore">
+      <exclude name="**/output/**"/>
+    </patternset>
+    <patternset id="source.free">
+      <exclude name="tools/**"/>
+      <exclude name="thirdparty/**"/>
+      <include name="**"/>
+    </patternset>
+    <patternset id="source.external">
+      <include name="tools/**"/>
+      <include name="thirdparty/**"/>
+    </patternset>
+
+    <!-- The header and footer displayed during each module execution -->
+    <property name="executemodules.header"><![CDATA[
+ ==============================================================
+ ==
+ ==  Executing '@TARGET@' in module '@MODULE@'...
+ ==
+ ==]]></property>
+
+    <property name="executemodules.footer"><![CDATA[
+ ==
+ ==
+ ==  Finished '@TARGET@' in module '@MODULE@'.
+ ==
+ ==============================================================
+    ]]></property>
+
+    <property name="executemodules.exportproperties">
+       version.major,
+       version.minor,
+       version.revision,
+       version.tag,
+       version.name,
+       version.cvstag,
+
+       specification.title,
+       specification.version,
+       specification.vendor,
+
+       implementation.title,
+       implementation.version,
+       implementation.vendor,
+       implementation.vendor.id,
+       implementation.url
+    </property>
+
+    <!-- Show the module configuration -->
+    <echo>groups:  ${groups}</echo>
+    <echo>modules: ${modules}</echo>
+
+    <property name="configure-project.disable" value="true" system="true"/>
+
+</target>
+
+  <!-- ================================================================== -->
+  <!-- Module Pass-through Targets                                        -->
+  <!-- ================================================================== -->
+
+  <!--
+     | These targets will execute all configured modules with the specified
+     | target.
+   -->
+
+  <target name="modules-all" depends="_buildmagic:modules:all"/>
+  <target name="modules-most" depends="_buildmagic:modules:most"/>
+  <target name="modules-main" depends="_buildmagic:modules:main"/>
+  <target name="modules-release" depends="_buildmagic:modules:release"/>
+  <target name="modules-tests" depends="_buildmagic:modules:tests"/>
+  <target name="modules-clean" depends="_buildmagic:modules:clean"/>
+  <target name="modules-clobber" depends="_buildmagic:modules:clobber"/>
+
+
+<!-- ================================================================== -->
+<!-- Module Pass-through Targets                                        -->
+<!-- ================================================================== -->
+
+<!-- Invoke the 'all' on all configured modules -->
+<target name="_buildmagic:modules:all" depends="init">
+  <execmodules target="all"
+       modules="${modules}"
+       root="${project.root}/@MODULE@"
+       exportproperties="${executemodules.exportproperties}">
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'most' on all configured modules -->
+<target name="_buildmagic:modules:most" depends="init">
+  <execmodules target="most"
+          modules="${modules}"
+          root="${project.root}/@MODULE@"
+          exportproperties="${executemodules.exportproperties}">
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'main' on all configured modules -->
+<target name="_buildmagic:modules:main" depends="init">
+  <execmodules target="main"
+          modules="${modules}"
+          root="${project.root}/@MODULE@"
+          exportproperties="${executemodules.exportproperties}">
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'release' on all configured modules -->
+<target name="_buildmagic:modules:release" depends="init">
+  <execmodules target="release"
+          modules="${modules}"
+          root="${project.root}/@MODULE@"
+          exportproperties="${executemodules.exportproperties}">
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'tests' on all configured modules -->
+<target name="_buildmagic:modules:tests" depends="init">
+  <execmodules target="tests"
+          modules="${modules}"
+          root="${project.root}/@MODULE@"
+          exportproperties="${executemodules.exportproperties}">
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+    <property name="build.reports" value="${project.root}/testsuite/output/reports"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'clean' on all configured modules -->
+<target name="_buildmagic:modules:clean" depends="init">
+  <execmodules target="clean"
+          modules="${modules}"
+          root="${project.root}/@MODULE@">
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+<!-- Invoke the 'clobber' on all configured modules -->
+<target name="_buildmagic:modules:clobber" depends="init">
+  <execmodules target="clobber"
+       modules="${modules}"
+       root="${project.root}/@MODULE@">
+    <before target="_module- at MODULE@- at TARGET@-prepare"/>
+    <header message="${executemodules.header}"/>
+    <footer message="${executemodules.footer}"/>
+    <after target="_module- at MODULE@- at TARGET@"/>
+    <property name="init.have-parent" value="true"/>
+  </execmodules>
+</target>
+
+
+  <!-- ================================================================== -->
+  <!-- Source Archives                                                    -->
+  <!-- ================================================================== -->
+
+  <target name="source-free-zip" depends="init"
+     description="Builds a ZIP free source distribution.">
+    <mkdir dir="${module.output}"/>
+    <zip zipfile="${module.output}/${release.id}-free-src.zip">
+      <fileset dir="${project.root}">
+        <patternset refid="source.ignore"/>
+        <patternset refid="source.free"/>
+      </fileset>
+    </zip>
+  </target>
+
+  <target name="source-external-zip" depends="init"
+     description="Builds a ZIP external source distribution.">
+    <mkdir dir="${module.output}"/>
+    <zip zipfile="${module.output}/${release.id}-external-src.zip">
+      <fileset dir="${project.root}">
+        <patternset refid="source.ignore"/>
+        <patternset refid="source.external"/>
+      </fileset>
+    </zip>
+  </target>
+
+  <target name="source-zip" depends="source-free-zip, source-external-zip"
+     description="Builds a ZIP source distribution."/>
+
+  <target name="source-free-tar" depends="init"
+     description="Builds a TAR free source distribution.">
+    <mkdir dir="${module.output}"/>
+    <tar tarfile="${module.output}/${release.id}-free-src.tar" longfile="gnu"
+    basedir="${project.root}">
+        <patternset refid="source.ignore"/>
+        <patternset refid="source.free"/>
+    </tar>
+  </target>
+
+  <target name="source-external-tar" depends="init"
+     description="Builds a TAR external source distribution.">
+    <mkdir dir="${module.output}"/>
+    <tar tarfile="${module.output}/${release.id}-external-src.tar" longfile="gnu"
+    basedir="${project.root}">
+        <patternset refid="source.ignore"/>
+        <patternset refid="source.external"/>
+    </tar>
+  </target>
+
+  <target name="source-tar" depends="source-free-tar, source-external-tar"
+     description="Builds a TAR source distribution."/>
+
+  <target name="source-free-tgz" depends="source-free-tar"
+     description="Builds a TAR-GZIP free source distribution.">
+    <gzip src="${module.output}/${release.id}-free-src.tar"
+     zipfile="${module.output}/${release.id}-free-src.tgz"/>
+  </target>
+
+  <target name="source-external-tgz" depends="source-external-tar"
+     description="Builds a TAR-GZIP external source distribution.">
+    <gzip src="${module.output}/${release.id}-external-src.tar"
+     zipfile="${module.output}/${release.id}-external-src.tgz"/>
+  </target>
+
+  <target name="source-tgz" depends="source-free-tgz, source-external-tgz"
+     description="Builds a TAR-GZIP source distribution."/>
+
+  <target name="source-all"
+     depends="source-tar, source-tgz, source-zip"
+     description="Builds all source distributions."/>

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/task.properties
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/task.properties	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/task.properties	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,83 @@
+### ====================================================================== ###
+##                                                                          ##
+##  Default Task Properties                                                 ##
+##                                                                          ##
+### ====================================================================== ###
+
+###  $Id: task.properties,v 1.1.1.1 2005/01/14 23:16:58 vietj Exp $ ###
+
+### Javac Defaults ###
+
+javac.includes=**/*.java
+javac.excludes=
+javac.defaultexcludes=yes
+
+javac.boot.classpath=${sun.boot.classpath}
+javac.classpath=${classpath}
+
+javac.debug=off
+javac.optimize=on
+javac.deprecation=on
+javac.target=1.2
+javac.verbose=off
+javac.depend=off
+javac.source=1.5
+
+javac.include.ant.runtime=no
+javac.include.java.runtime=no
+javac.fail.onerror=true
+
+classpath=
+classpath.local=
+classpath.thirdparty=
+
+### Javadoc Defaults ###
+
+javadoc.classpath=${javac.classpath}
+javadoc.sourcepath=
+javadoc.source.path=
+javadoc.source.files=
+
+javadoc.public=false
+javadoc.package=false
+javadoc.protected=true
+javadoc.private=false
+javadoc.version=true
+javadoc.author=true
+javadoc.use=true
+javadoc.verbose=false
+
+javadoc.windowtitle=${module.Name} API
+javadoc.doctitle=${module.Name}
+javadoc.splitindex=no
+
+### RMIC Defaults ###
+
+rmic.base=${build.classes}
+rmic.stubVersion=${javac.target}
+rmic.verify=true
+rmic.sourcebase=
+rmic.debug=false
+rmic.iiop=false
+rmic.iiopopts=
+rmic.idl=false
+rmic.idlopts=
+rmic.includes=
+rmic.excludes=
+
+### JUnit Defaults ###
+
+junit.printsummary=true
+junit.haltonerror=false
+junit.haltonfailure=false
+junit.fork=true
+junit.timeout=300000
+junit.jvm=java
+junit.jvm.options=
+
+junit.formatter.type=xml
+junit.formatter.usefile=true
+
+junit.batchtest.fork=${junit.fork}
+junit.batchtest.haltonerror=${junit.haltonerror}
+junit.batchtest.haltonfailure=${junit.haltonfailure}

Added: labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/tools.ent
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/tools.ent	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/buildfragments/tools.ent	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,155 @@
+<!-- $Id: tools.ent,v 1.6 2005/05/24 20:38:14 julien Exp $ -->
+
+<target name="configure-tools" unless="configure-tools.disable">
+
+  <call target="_configure:explode:task" unless="_configure:explode:task.done">
+    <available file="${project.tools}/lib/explode.jar"/>
+  </call>
+
+  <call target="_configure:jflex:task" unless="_configure:jflex:task.done">
+    <available file="${jflex.jflex.lib}/jflex.jar"/>
+  </call>
+
+  <call target="_configure:jbossaop:task" unless="_configure:jbossaop:task.done">
+    <available file="${jboss.aop.lib}/jboss-aop.jar"/>
+  </call>
+
+  <call target="_configure:xdoclet:task" unless="_configure:xdoclet:task.done">
+    <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+    <available file="${xdoclet.xdoclet.lib}/xdoclet-jmx-module.jar"/>
+  </call>
+
+  <call target="_configure:xdoclet:ejbdoclet" unless="_configure:xdoclet:ejbdoclet.done">
+    <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+    <available file="${xdoclet.xdoclet.lib}/xdoclet-ejb-module.jar"/>
+  </call>
+
+  <call target="_configure:xdoclet:jmxdoclet" unless="_configure:xdoclet:jmxdoclet.done">
+    <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+    <available file="${xdoclet.xdoclet.lib}/xdoclet-jmx-module.jar"/>
+  </call>
+
+  <call target="_configure:xdoclet:hibernatedoclet" unless="_configure:xdoclet:hibernatedoclet.done">
+    <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+    <available file="${xdoclet.xdoclet.lib}/xdoclet-hibernate-module.jar"/>
+  </call>
+
+  <call target="_configure:xdoclet:webdoclet" unless="_configure:xdoclet:webdoclet.done">
+    <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+    <available file="${xdoclet.xdoclet.lib}/xdoclet-web-module.jar"/>
+    <available file="${sun.servlet.lib}/servlet-api.jar"/>
+  </call>
+
+  <call target="_configure:cactus:cactus" unless="_configure:cactus:cactus.done">
+    <available file="${jakarta.cactus.lib}/cactus.jar"/>
+  </call>
+
+</target>
+
+<target name="_configure:explode:task">
+  <path id="explode.task.classpath">
+    <pathelement location="${project.tools}/lib/explode.jar"/>
+    <path refid="apache.ant.classpath"/>
+  </path>
+  <taskdef name="explode"
+           classname="org.jboss.portal.common.ant.Explode"
+           classpathref="explode.task.classpath"/>
+  <property name="_configure:explode:task.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:jflex:task">
+  <taskdef name="jflex"
+           classname="JFlex.anttask.JFlexTask"
+           classpathref="jflex.jflex.classpath"/>
+  <property name="_configure:jflex:task.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:jbossaop:task">
+  <path id="jbossaop.task.classpath">
+    <path refid="oswego.concurrent.classpath"/>
+    <path refid="jboss.javassist.classpath"/>
+    <path refid="jboss.system.classpath"/>
+    <path refid="jboss.aop.classpath"/>
+  </path>
+  <taskdef name="annotationc"
+           classname="org.jboss.aop.ant.AnnotationC"
+           classpathref="jbossaop.task.classpath"/>
+</target>
+
+<target name="_configure:xdoclet:task">
+  <path id="xdoclet.base.task.classpath">
+    <path refid="xdoclet.xdoclet.classpath"/>
+    <path refid="apache.ant.classpath"/>
+  </path>
+  <taskdef name="jmxdoclet"
+           classname="xdoclet.modules.jmx.JMXDocletTask"
+           classpathref="xdoclet.base.task.classpath"/>
+  <taskdef name="todo"
+           classname="xdoclet.modules.doc.DocumentDocletTask"
+           classpathref="xdoclet.base.task.classpath"/>
+  <property name="_configure:xdoclet:task.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:xdoclet:ejbdoclet">
+  <path id="ejbdoclet.task.classpath">
+    <path refid="xdoclet.base.task.classpath"/>
+    <pathelement location="${jboss.home}/server/default/lib/jboss-j2ee.jar"/>
+  </path>
+  <taskdef name="ejbdoclet"
+           classname="xdoclet.modules.ejb.EjbDocletTask"
+           classpathref="ejbdoclet.task.classpath"/>
+  <property name="_configure:xdoclet:ejbdoclet.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:xdoclet:jmxdoclet">
+  <path id="jmxdoclet.task.classpath">
+    <path refid="xdoclet.base.task.classpath"/>
+  </path>
+  <taskdef name="jmxdoclet"
+           classname="xdoclet.modules.jmx.JMXDocletTask"
+           classpathref="jmxdoclet.task.classpath"/>
+  <property name="_configure:xdoclet:jmxdoclet.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:xdoclet:hibernatedoclet">
+  <path id="hibernatedoclet.task.classpath">
+    <path refid="xdoclet.xdoclet.classpath"/>
+  </path>
+  <taskdef name="hibernatedoclet"
+           classname="xdoclet.modules.hibernate.HibernateDocletTask"
+           classpathref="hibernatedoclet.task.classpath"/>
+  <property name="_configure:xdoclet:ejbdoclet.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:xdoclet:webdoclet">
+  <path id="webdoclet.task.classpath">
+    <path refid="xdoclet.base.task.classpath"/>
+    <pathelement location="${sun.servlet.lib}/servlet-api.jar"/>
+  </path>
+  <taskdef name="webdoclet"
+   	     classname="xdoclet.modules.web.WebDocletTask"
+           classpathref="webdoclet.task.classpath"/>
+  <property name="_configure:xdoclet:webdoclet.done" value="true" system="true"/>
+</target>
+
+<target name="_configure:cactus:cactus">
+  <path id="cactus.task.classpath">
+    <path refid="junit.junit.classpath"/>
+    <path refid="jakarta.cactus.classpath"/>
+    <pathelement location="${junit.junit.lib}/junit.jar"/>
+  </path>
+  <echo message="${junit.junit.lib}"/>
+  <taskdef name="cactifywar"
+           classname="org.apache.cactus.integration.ant.CactifyWarTask"
+           classpathref="cactus.task.classpath"/>
+  <taskdef name="runservertests"
+           classname="org.apache.cactus.integration.ant.RunServerTestsTask"
+           classpathref="cactus.task.classpath"/>
+  <taskdef name="webxmlmerge"
+           classname="org.apache.cactus.integration.ant.WebXmlMergeTask"
+           classpathref="cactus.task.classpath"/>
+  <taskdef name="cactus"
+           classname="org.apache.cactus.integration.ant.CactusTask"
+           classpathref="cactus.task.classpath"/>
+  <property name="_configure:cactus:cactus.done" value="true" system="true"/>
+</target>

Added: labs/jbossforums/branches/forums120P26/tools/etc/changelog.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/changelog.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/changelog.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet
+    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+    version='1.0'>
+
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+  <xsl:param name="title"/>
+  <xsl:param name="module"/>
+  <xsl:param name="cvsweb"/>
+
+  <xsl:output method="html" indent="yes" encoding="US-ASCII"
+              doctype-public="-//W3C//DTD HTML 4.01//EN"
+              doctype-system="http://www.w3.org/TR/html401/strict.dtd"/>
+
+  <!-- Copy standard document elements.  Elements that
+       should be ignored must be filtered by apply-templates
+       tags. -->
+  <xsl:template match="*">
+    <xsl:copy>
+      <xsl:copy-of select="attribute::*[. != '']"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="changelog">
+    <html>
+      <head>
+        <title><xsl:value-of select="$title"/></title>
+        <style type="text/css">
+          body, p {
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            font-size: 80%;
+            color: #000000;
+            background-color: #ffffff;
+          }
+          tr, td {
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            background: #eeeee0;
+          }
+          td {
+            padding-left: 20px;
+          }
+	  .dateAndAuthor {
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            font-weight: bold;
+            text-align: left;
+            background: #a6caf0;
+            padding-left: 3px;
+	  }
+          a {
+            color: #000000;
+          }
+          pre {
+            font-weight: bold;
+          }
+        </style>
+      </head>
+      <body>
+        <h1>
+          <a name="top"><xsl:value-of select="$title"/></a>
+        </h1>
+        <p style="text-align: right">Designed for use with <a href="http://jakarta.apache.org/ant/">Ant</a>.</p>
+        <hr/>
+        <table border="0" width="100%" cellspacing="1">
+          
+          <xsl:apply-templates select=".//entry">
+            <xsl:sort select="date" data-type="text" order="descending"/>
+            <xsl:sort select="time" data-type="text" order="descending"/>
+          </xsl:apply-templates>
+          
+        </table>
+        
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template match="entry">
+    <tr>
+      <td class="dateAndAuthor">
+        <xsl:value-of select="date"/><xsl:text> </xsl:text><xsl:value-of select="time"/><xsl:text> </xsl:text><xsl:value-of select="author"/>
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <pre>
+<xsl:apply-templates select="msg"/></pre>
+        <ul>
+          <xsl:apply-templates select="file"/>
+        </ul>
+      </td>
+    </tr>
+  </xsl:template>
+
+  <xsl:template match="date">
+    <i><xsl:value-of select="."/></i>
+  </xsl:template>
+
+  <xsl:template match="time">
+    <i><xsl:value-of select="."/></i>
+  </xsl:template>
+
+  <xsl:template match="author">
+    <i>
+      <a>
+        <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
+        <xsl:value-of select="."/></a>
+    </i>
+  </xsl:template>
+
+  <xsl:template match="file">
+    <li>
+      <a>
+        <xsl:choose>
+          <xsl:when test="string-length(prevrevision) = 0 ">
+            <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?rev=<xsl:value-of select="revision" />&amp;content-type=text/x-cvsweb-markup</xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?r1=<xsl:value-of select="revision" />&amp;r2=<xsl:value-of select="prevrevision"/></xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:value-of select="name" /> (<xsl:value-of select="revision"/>)</a>
+    </li>
+  </xsl:template>
+
+  <!-- Any elements within a msg are processed,
+       so that we can preserve HTML tags. -->
+  <xsl:template match="msg">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+</xsl:stylesheet>

Added: labs/jbossforums/branches/forums120P26/tools/etc/checkstyle-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/checkstyle-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/checkstyle-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,324 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:lxslt="http://xml.apache.org/xslt"
+    xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+    extension-element-prefixes="redirect">
+
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+
+    <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+    <xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+    <xsl:param name="output.dir" select="'.'"/>
+
+    <xsl:template match="checkstyle">
+        <!-- create the index.html -->
+        <redirect:write file="{$output.dir}/index.html">
+            <xsl:call-template name="index.html"/>
+        </redirect:write>
+
+        <!-- create the stylesheet.css -->
+        <redirect:write file="{$output.dir}/stylesheet.css">
+            <xsl:call-template name="stylesheet.css"/>
+        </redirect:write>
+
+        <!-- create the overview-summary.html at the root -->
+        <redirect:write file="{$output.dir}/overview-frame.html">
+            <xsl:apply-templates select="." mode="overview"/>
+        </redirect:write>
+
+        <!-- create the all-classes.html at the root -->
+        <redirect:write file="{$output.dir}/allclasses-frame.html">
+            <xsl:apply-templates select="." mode="all.classes"/>
+        </redirect:write>
+
+        <!-- process all files -->
+        <xsl:apply-templates select="file"/>
+    </xsl:template>
+
+    <xsl:template name="index.html">
+        <html>
+            <head>
+                <title>CheckStyle Audit</title>
+            </head>
+            <frameset cols="20%,80%">
+                <frame src="allclasses-frame.html" name="fileListFrame"/>
+                <frame src="overview-frame.html" name="fileFrame"/>
+            </frameset>
+            <noframes>
+                <h2>Frame Alert</h2>
+                <p>
+                    This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+                </p>
+            </noframes>
+        </html>
+    </xsl:template>
+
+    <xsl:template name="pageHeader">
+        <table border="0" cellpadding="0" cellspacing="0" width="100%">
+            <tr>
+                <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
+            </tr>
+            <tr>
+                <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+            </tr>
+        </table>
+        <hr size="1"/>
+    </xsl:template>
+
+    <xsl:template match="checkstyle" mode="overview">
+        <html>
+            <head>
+                <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+            </head>
+            <body>
+                <!-- page header -->
+                <xsl:call-template name="pageHeader"/>
+
+                <!-- Summary part -->
+                <xsl:apply-templates select="." mode="summary"/>
+                <hr size="1" width="100%" align="left"/>
+
+                <!-- File list part -->
+                <xsl:apply-templates select="." mode="filelist"/>
+            </body>
+        </html>
+    </xsl:template>
+
+    <xsl:template name="stylesheet.css">
+        .bannercell {
+        border: 0px;
+        padding: 0px;
+        }
+        body {
+        margin-left: 10;
+        margin-right: 10;
+        font:normal 80% arial,helvetica,sanserif;
+        background-color:#FFFFFF;
+        color:#000000;
+        }
+        .a td {
+        background: #efefef;
+        }
+        .b td {
+        background: #fff;
+        }
+        th, td {
+        text-align: left;
+        vertical-align: top;
+        }
+        th {
+        font-weight:bold;
+        background: #ccc;
+        color: black;
+        }
+        table, th, td {
+        font-size:100%;
+        border: none
+        }
+        table.log tr td, tr th {
+
+        }
+        h2 {
+        font-weight:bold;
+        font-size:140%;
+        margin-bottom: 5;
+        }
+        h3 {
+        font-size:100%;
+        font-weight:bold;
+        background: #525D76;
+        color: white;
+        text-decoration: none;
+        padding: 5px;
+        margin-right: 2px;
+        margin-left: 2px;
+        margin-bottom: 0;
+        }
+    </xsl:template>
+
+    <!--
+    Creates an all-classes.html file that contains a link to all files.
+    -->
+    <xsl:template match="checkstyle" mode="all.classes">
+        <html>
+            <head>
+                <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+            </head>
+            <body>
+                <h2>Files</h2>
+                <p>
+                    <table width="100%">
+                        <!-- For each file create its part -->
+                        <xsl:apply-templates select="file" mode="all.classes">
+                            <xsl:sort select="@name"/>
+                        </xsl:apply-templates>
+                    </table>
+                </p>
+            </body>
+        </html>
+    </xsl:template>
+
+    <xsl:template match="checkstyle" mode="filelist">
+        <h3>Files</h3>
+        <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+            <tr>
+                <th>Name</th>
+                <th>Errors</th>
+            </tr>
+            <xsl:apply-templates select="file" mode="filelist">
+                <xsl:sort select="@name"/>
+            </xsl:apply-templates>
+        </table>
+    </xsl:template>
+
+    <xsl:template match="file" mode="filelist">
+        <tr>
+            <xsl:call-template name="alternated-row"/>
+            <td nowrap="nowrap">
+                <a>
+                    <xsl:attribute name="href">
+                        <xsl:text>files/</xsl:text><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
+                    </xsl:attribute>
+                    <xsl:value-of select="@name"/>
+                </a>
+            </td>
+            <td><xsl:value-of select="count(error)"/></td>
+        </tr>
+    </xsl:template>
+
+    <xsl:template match="file" mode="all.classes">
+        <tr>
+            <td nowrap="nowrap">
+                <a target="fileFrame">
+                    <xsl:attribute name="href">
+                        <xsl:text>files/</xsl:text><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
+                    </xsl:attribute>
+                    <xsl:value-of select="@name"/>
+                </a>
+            </td>
+        </tr>
+    </xsl:template>
+
+    <!--
+    transform string like a/b/c to ../../../
+    @param path the path to transform into a descending directory path
+    -->
+    <xsl:template name="path">
+        <xsl:param name="path"/>
+        <xsl:if test="contains($path,'/')">
+            <xsl:text>../</xsl:text>
+            <xsl:call-template name="path">
+                <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'/')"/></xsl:with-param>
+            </xsl:call-template>
+        </xsl:if>
+        <xsl:if test="not(contains($path,'/')) and not($path = '')">
+            <xsl:text>../</xsl:text>
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="file">
+        <redirect:write file="{$output.dir}/files/{@name}.html">
+            <html>
+                <head>
+                    <link rel="stylesheet" type="text/css">
+                        <xsl:attribute name="href"><xsl:call-template name="path"><xsl:with-param name="path" select="@name"/></xsl:call-template><xsl:text>stylesheet.css</xsl:text></xsl:attribute>
+                    </link>
+                </head>
+                <body>
+                    <xsl:call-template name="pageHeader"/>
+                    <h3>File <xsl:value-of select="@name"/></h3>
+                    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+                        <tr>
+                            <th>Error Description</th>
+                            <th>Line</th>
+                        </tr>
+                        <xsl:for-each select="error">
+                            <tr>
+                                <xsl:call-template name="alternated-row"/>
+                                <td><xsl:value-of select="@message"/></td>
+                                <td><xsl:value-of select="@line"/></td>
+                            </tr>
+                        </xsl:for-each>
+                    </table>
+                </body>
+            </html>
+        </redirect:write>
+    </xsl:template>
+
+    <xsl:template match="checkstyle" mode="summary">
+        <h3>Summary</h3>
+        <xsl:variable name="fileCount" select="count(file)"/>
+        <xsl:variable name="errorCount" select="count(file/error)"/>
+        <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+            <tr>
+                <th>Files</th>
+                <th>Errors</th>
+            </tr>
+            <tr>
+                <xsl:call-template name="alternated-row"/>
+                <td><xsl:value-of select="$fileCount"/></td>
+                <td><xsl:value-of select="$errorCount"/></td>
+            </tr>
+        </table>
+    </xsl:template>
+
+    <xsl:template name="alternated-row">
+        <xsl:attribute name="class">
+            <xsl:if test="position() mod 2 = 1">a</xsl:if>
+            <xsl:if test="position() mod 2 = 0">b</xsl:if>
+        </xsl:attribute>
+    </xsl:template>
+</xsl:stylesheet>
+

Added: labs/jbossforums/branches/forums120P26/tools/etc/coverage-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/coverage-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/coverage-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,533 @@
+<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	xmlns:lxslt="http://xml.apache.org/xslt"
+	xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+	extension-element-prefixes="redirect">
+<xsl:output	method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+
+<!--
+ 
+ Sample stylesheet to be used with JProbe 3.0 XML output.
+ 
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+ 
+ It is best used with JProbe Coverage Ant task that gives you the benefit
+ of a reference classpath so that you have the list of classes/methods
+ that are not used at all in a given classpath.
+ 
+ @author Stephane Bailliez <a href="mailto:sbailliez at apache.org"/>
+ 
+-->
+
+<!-- default output directory is current directory -->
+<xsl:param name="output.dir" select="'.'"/>
+
+<!-- ======================================================================
+	Root element
+    ======================================================================= -->
+<xsl:template match="/snapshot">
+	<!-- create the index.html -->
+	<redirect:write file="{$output.dir}/index.html">
+		<xsl:call-template name="index.html"/>
+	</redirect:write>
+
+	<!-- create the stylesheet.css -->
+	<redirect:write file="{$output.dir}/stylesheet.css">
+		<xsl:call-template name="stylesheet.css"/>
+	</redirect:write>
+
+	<!-- create the overview-packages.html at the root -->
+	<redirect:write file="{$output.dir}/overview-summary.html">
+		<xsl:apply-templates select="." mode="overview.packages"/>
+	</redirect:write>
+
+	<!-- create the all-packages.html at the root -->
+	<redirect:write file="{$output.dir}/overview-frame.html">
+		<xsl:apply-templates select="." mode="all.packages"/>
+	</redirect:write>
+	
+	<!-- create the all-classes.html at the root -->
+	<redirect:write file="{$output.dir}/allclasses-frame.html">
+		<xsl:apply-templates select="." mode="all.classes"/>
+	</redirect:write>
+	
+	<!-- process all packages -->
+	<xsl:apply-templates select="./package" mode="write"/>
+</xsl:template>
+
+<!-- =======================================================================
+	Frameset definition. Entry point for the report.
+	3 frames: packageListFrame, classListFrame, classFrame
+    ======================================================================= -->
+<xsl:template name="index.html">
+<html>
+	<head><title>Coverage Results.</title></head>
+	<frameset cols="20%,80%">
+		<frameset rows="30%,70%">
+			<frame src="overview-frame.html" name="packageListFrame"/>
+			<frame src="allclasses-frame.html" name="classListFrame"/>
+		</frameset>
+		<frame src="overview-summary.html" name="classFrame"/>
+	</frameset>
+	<noframes>
+		<h2>Frame Alert</h2>
+		<p>
+		This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+		</p>
+	</noframes>
+</html>
+</xsl:template>
+
+<!-- =======================================================================
+	Stylesheet CSS used
+    ======================================================================= -->
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin-left: 10;
+      margin-right: 10;
+      font:normal 80% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    .a td { 
+      background: #efefef;
+    }
+    .b td { 
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      font-weight:bold;
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      font-size:100%;
+      border: none
+    }
+    table.log tr td, tr th {
+      
+    }
+    h2 {
+      font-weight:bold;
+      font-size:140%;
+      margin-bottom: 5;
+    }
+    h3 {
+      font-size:100%;
+      font-weight:bold;
+      background: #525D76;
+      color: white;
+      text-decoration: none;
+      padding: 5px;
+      margin-right: 2px;
+      margin-left: 2px;
+      margin-bottom: 0;
+    }
+</xsl:template>
+
+<!-- =======================================================================
+	List of all classes in all packages
+	This will be the first page in the classListFrame
+    ======================================================================= -->
+<xsl:template match="snapshot" mode="all.classes">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link"/>
+		</head>
+		<body>
+			<h2>Classes</h2>
+			<table width="100%">
+				<xsl:for-each select="package/class">
+					<xsl:sort select="@name"/>
+				    <xsl:variable name="package.name" select="(ancestor::package)[last()]/@name"/>
+				    <xsl:variable name="link">
+						<xsl:if test="not($package.name='')">
+							<xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+						</xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
+				    </xsl:variable>
+					<tr>
+						<td nowrap="nowrap">
+							<a target="classFrame" href="{$link}"><xsl:value-of select="@name"/></a>
+						</td>
+					</tr>
+				</xsl:for-each>
+			</table>
+		</body>
+	</html>
+</xsl:template>
+
+<!-- list of all packages -->
+<xsl:template match="snapshot" mode="all.packages">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link"/>
+		</head>
+		<body>
+			<h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
+			<h2>Packages</h2>
+			<table width="100%">
+				<xsl:for-each select="package">
+					<xsl:sort select="@name" order="ascending"/>
+					<tr>
+						<td nowrap="nowrap">
+							<a href="{translate(@name,'.','/')}/package-summary.html" target="classFrame">
+								<xsl:value-of select="@name"/>
+							</a>
+						</td>
+					</tr>
+				</xsl:for-each>
+			</table>
+		</body>
+	</html>
+</xsl:template>
+
+<!-- overview of statistics in packages -->
+<xsl:template match="snapshot" mode="overview.packages">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link"/>
+		</head>
+		<body onload="open('allclasses-frame.html','classListFrame')">
+		<xsl:call-template name="pageHeader"/>
+		<h3>Summary</h3>
+		<table class="log" cellpadding="5" cellspacing="2" width="100%">
+			<tr>
+				<!--th width="10%" nowrap="nowrap">Date</th>
+				<th width="10%" nowrap="nowrap">Elapsed time</th-->
+				<th width="10%" nowrap="nowrap">Reported Classes</th>
+				<th width="10%" nowrap="nowrap">Methods Hit</th>
+				<th width="10%" nowrap="nowrap">Lines Hit</th>
+			</tr>
+			<tr class="a">
+				<!--td nowrap="nowrap"><xsl:value-of select="execution_log/@program_start"/></td>
+				<td><xsl:value-of select="format-number(execution_log/@elapsed_time div 1000,'0.0')"/>secs</td-->
+				<td><xsl:value-of select="count(package/class)"/></td>
+				<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
+				<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
+			</tr>
+		</table>
+		<table border="0" width="100%">
+		<tr>
+		<td	style="text-align: justify;">
+		To ensure accurate test runs on Java applications, developers need to know how much of
+		the code has been tested, and where to find any untested code. Coverage helps you
+		locate untested code, and measure precisely how much code has been exercised.
+		The result is a higher quality application in a shorter period of time.
+		<p/>
+		</td>
+		</tr>
+		</table>
+
+		<h3>Packages</h3>
+		<table class="log" cellpadding="5" cellspacing="2" width="100%">
+			<xsl:apply-templates select="package[1]" mode="stats.header"/>
+			<!-- display packages and sort them via their coverage rate -->
+			<xsl:for-each select="package">
+				<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
+				<tr>
+				  <xsl:call-template name="alternate-row"/>
+					<td><a href="{translate(@name,'.','/')}/package-summary.html"><xsl:value-of select="@name"/></a></td>
+					<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
+					<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
+				</tr>
+			</xsl:for-each>
+		</table>
+		<xsl:call-template name="pageFooter"/>
+		</body>
+		</html>
+</xsl:template>
+
+<!--
+ detailed info for a package. It will output the list of classes
+, the summary page, and the info for each class
+-->
+<xsl:template match="package" mode="write">
+	<xsl:variable name="package.dir">
+		<xsl:if test="not(@name = '')"><xsl:value-of select="translate(@name,'.','/')"/></xsl:if>
+		<xsl:if test="@name = ''">.</xsl:if>
+	</xsl:variable>
+
+	<!-- create a classes-list.html in the package directory -->
+	<redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
+		<xsl:apply-templates select="." mode="classes.list"/>
+	</redirect:write>
+	
+	<!-- create a package-summary.html in the package directory -->
+	<redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
+		<xsl:apply-templates select="." mode="package.summary"/>
+	</redirect:write>
+	
+	<!-- for each class, creates a @name.html -->
+	<xsl:for-each select="class">
+		<redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
+			<xsl:apply-templates select="." mode="class.details"/>
+		</redirect:write>
+	</xsl:for-each>
+</xsl:template>
+
+<!-- list of classes in a package -->
+<xsl:template match="package" mode="classes.list">
+	<html>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="@name"/>
+			</xsl:call-template>
+		</HEAD>
+		<BODY>
+			<table width="100%">
+				<tr>
+					<td nowrap="nowrap">
+						<H2><a href="package-summary.html" target="classFrame"><xsl:value-of select="@name"/></a></H2>
+					</td>
+				</tr>
+			</table>
+	
+			<H2>Classes</H2>
+			<TABLE WIDTH="100%">
+				<xsl:for-each select="class">
+					<xsl:sort select="@name"/>
+					<tr>
+						<td nowrap="nowrap">
+							<a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+						</td>
+					</tr>
+				</xsl:for-each>
+			</TABLE>
+		</BODY>
+	</html>
+</xsl:template>
+
+<!-- summary of a package -->
+<xsl:template match="package" mode="package.summary">
+	<HTML>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="@name"/>
+			</xsl:call-template>
+		</HEAD>
+		<!-- when loading this package, it will open the classes into the frame -->
+		<BODY onload="open('package-frame.html','classListFrame')">
+			<xsl:call-template name="pageHeader"/>
+			<h3>Package <xsl:value-of select="@name"/></h3>			
+			<table class="log" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:apply-templates select="." mode="stats.header"/>
+				<xsl:apply-templates select="." mode="stats"/>
+			</table>
+					
+			<xsl:if test="count(class) &gt; 0">
+				<H3>Classes</H3>
+				<table class="log" cellpadding="5" cellspacing="2" width="100%">
+					<xsl:apply-templates select="." mode="stats.header"/>
+					<xsl:apply-templates select="class" mode="stats">
+						<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
+					</xsl:apply-templates>
+				</table>
+			</xsl:if>
+			<xsl:call-template name="pageFooter"/>
+		</BODY>
+	</HTML>
+</xsl:template>
+
+<!-- details of a class -->
+<xsl:template match="class" mode="class.details">
+	<xsl:variable name="package.name" select="(ancestor::package)[last()]/@name"/>
+	<HTML>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="$package.name"/>
+			</xsl:call-template>
+		</HEAD>
+		<BODY>
+			<xsl:call-template name="pageHeader"/>
+			<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>
+
+			<!-- class summary -->
+			<table class="log" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:apply-templates select="." mode="stats.header"/>
+				<xsl:apply-templates select="." mode="stats"/>
+			</table>
+	
+			<!-- details of methods -->
+			<H3>Methods</H3>
+			<table class="log" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:apply-templates select="method[1]" mode="stats.header"/>
+				<xsl:apply-templates select="method" mode="stats">
+					<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
+				</xsl:apply-templates>
+			</table>
+			<xsl:call-template name="pageFooter"/>
+		</BODY>
+	</HTML>
+
+</xsl:template>
+
+<!-- Page Header -->
+<xsl:template name="pageHeader">
+  <!-- jakarta logo -->
+  <table border="0" cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+    <td class="bannercell" rowspan="2">
+      <a href="http://jakarta.apache.org/">
+      <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+      </a>
+    </td>
+		<td style="text-align:right"><h2>Source Code Coverage</h2></td>
+		</tr>
+		<tr>
+		<td style="text-align:right">Designed for use with <a href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+		</tr>
+  </table>
+	<hr size="1"/>
+</xsl:template>
+
+<!-- Page Footer -->
+<xsl:template name="pageFooter">
+    <table width="100%">
+      <tr><td><hr noshade="yes" size="1"/></td></tr>
+      <tr><td>
+      <div align="center"><font color="#525D76" size="-1"><em>
+      Copyright &#169; 1999-2001, Apache Software Foundation
+      </em></font></div>
+      </td></tr>
+    </table>
+</xsl:template>
+
+
+<xsl:template name="table.header">
+	<tr>
+		<th width="80%">Name</th>
+		<th width="10%" nowrap="nowrap">Methods Hit</th>
+		<th width="10%" nowrap="nowrap">Lines Hit</th>
+	</tr>
+</xsl:template>
+
+<xsl:template match="method" mode="stats.header">
+	<tr>
+		<th width="90%">Name</th>
+		<th width="10%" nowrap="nowrap">Lines Hit</th>
+	</tr>
+</xsl:template>
+<xsl:template match="method" mode="stats">
+	<tr>
+	  <xsl:call-template name="alternate-row"/>
+		<td><xsl:value-of select="@name"/></td>
+		<td>
+		<xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/>
+		</td>
+	</tr>
+</xsl:template>
+
+<xsl:template match="package|class" mode="stats.header">
+	<tr>
+		<th width="80%">Name</th>
+		<th width="10%" nowrap="nowrap">Methods Hit</th>
+		<th width="10%" nowrap="nowrap">Lines Hit</th>
+	</tr>
+</xsl:template>
+<xsl:template match="package|class" mode="stats">
+	<tr>
+	  <xsl:call-template name="alternate-row"/>
+		<td><xsl:value-of select="@name"/></td>
+		<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
+		<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
+	</tr>
+</xsl:template>
+
+<!--
+    transform string like a.b.c to ../../../
+    @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+	<xsl:param name="path"/>
+	<xsl:if test="contains($path,'.')">
+		<xsl:text>../</xsl:text>
+		<xsl:call-template name="path">
+			<xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
+		</xsl:call-template>
+	</xsl:if>
+	<xsl:if test="not(contains($path,'.')) and not($path = '')">
+		<xsl:text>../</xsl:text>
+	</xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+	<xsl:param name="package.name"/>
+	<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+  <xsl:if test="position() mod 2 = 1">a</xsl:if>
+  <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+</xsl:stylesheet>
+
+

Added: labs/jbossforums/branches/forums120P26/tools/etc/jdepend-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/jdepend-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/jdepend-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,522 @@
+<xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:lxslt="http://xml.apache.org/xslt"
+  xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+  extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+<!--
+
+ Sample stylesheet to be used with JDepend XML output.
+ 
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+ 
+ @author <a href="mailto:jtulley at novell.com">Jeff Tulley</a>
+
+  -->
+<xsl:param name="output.dir" select="'.'"/>
+
+<xsl:template match="JDepend">
+   <!-- create the index.html -->
+   <redirect:write file="{$output.dir}/index.html">
+      <xsl:call-template name="index.html"/>
+   </redirect:write>
+
+  <!-- create the stylesheet.css -->
+  <redirect:write file="{$output.dir}/stylesheet.css">
+    <xsl:call-template name="stylesheet.css"/>
+   </redirect:write>
+
+   <!-- create the overview-packages.html at the root -->
+  <redirect:write file="{$output.dir}/overview-summary.html">
+    <xsl:apply-templates select="." mode="overview.packages"/>
+  </redirect:write>
+
+   <!-- create the overview-packages.html at the root -->
+   <redirect:write file="{$output.dir}/overview-packages.html">
+    <xsl:apply-templates select="." mode="packages.details"/>
+  </redirect:write>
+
+   <!-- create the overview-cycles.html at the root -->
+   <redirect:write file="{$output.dir}/overview-cycles.html">
+    <xsl:apply-templates select="." mode="cycles.details"/>
+  </redirect:write>
+
+   <!-- create the overview-cycles.html at the root -->
+   <redirect:write file="{$output.dir}/overview-explanations.html">
+    <xsl:apply-templates select="." mode="explanations"/>
+  </redirect:write>
+
+  <!-- create the all-packages.html at the root -->
+   <redirect:write file="{$output.dir}/all-packages.html">
+    <xsl:apply-templates select="Packages" mode="all.packages"/>
+  </redirect:write>
+  
+  <!-- create the all-cycles.html at the root -->
+  <redirect:write file="{$output.dir}/all-cycles.html">
+    <xsl:apply-templates select="Cycles" mode="all.cycles"/>
+  </redirect:write>
+</xsl:template>
+
+
+<xsl:template name="index.html">
+<html>
+   <head>
+      <title>JDepend Analysis</title>
+   </head>
+      <frameset cols="20%,80%">
+         <frameset rows="30%,70%">
+            <frame src="all-packages.html" name="packageListFrame"/>
+            <frame src="all-cycles.html" name="classListFrame"/>
+         </frameset>
+         <frame src="overview-summary.html" name="classFrame"/>
+      </frameset>
+      <noframes>
+         <h2>Frame Alert</h2>
+         <p>
+            This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+         </p>
+      </noframes>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+   <style type="text/css">
+    body {
+    font:normal 68% verdana,arial,helvetica;
+    color:#000000;
+    }
+    table tr td, tr th {
+      font-size: 68%;
+    }
+    table.details tr th{
+    font-weight: bold;
+    text-align:left;
+    background:#a6caf0;
+    }
+    table.details tr td{
+    background:#eeeee0;
+    }
+    
+    p {
+    line-height:1.5em;
+    margin-top:0.5em; margin-bottom:1.0em;
+    margin-left:2em;
+    margin-right:2em;
+    }
+    h1 {
+    margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+    }
+    h2 {
+    margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+    }
+    h3 {
+    margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+    }
+    h4 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+    }
+    h5 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+    }
+    h6 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+    }
+    .Error {
+    font-weight:bold; color:red;
+    }
+    .Failure {
+    font-weight:bold; color:purple;
+    }
+    .Properties {
+    text-align:right;
+    }
+  </style>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="overview.packages">
+   <html>
+      <head>
+         <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+      </head>
+      <body>
+         <xsl:call-template name="pageHeader"/>
+  <table width="100%"><tr align="left"><h2>Summary</h2><td>
+  </td><td align="right">
+  [summary]
+  [<a href="overview-packages.html">packages</a>]
+  [<a href="overview-cycles.html">cycles</a>]
+  [<a href="overview-explanations.html">explanations</a>]
+   </td></tr></table>
+         <table width="100%" class="details">
+            <tr>
+               <th>Package</th>
+               <th>Total Classes</th>
+               <th><a href="overview-explanations.html#EXnumber">Abstract Classes</a></th>
+               <th><a href="overview-explanations.html#EXnumber">Concrete Classes</a></th>
+               <th><a href="overview-explanations.html#EXafferent">Afferent Couplings</a></th>
+               <th><a href="overview-explanations.html#EXefferent">Efferent Couplings</a></th>
+               <th><a href="overview-explanations.html#EXabstractness">Abstractness</a></th>
+               <th><a href="overview-explanations.html#EXinstability">Instability</a></th>
+               <th><a href="overview-explanations.html#EXdistance">Distance</a></th>
+      
+            </tr>
+            <xsl:for-each select="./Packages/Package">
+               <xsl:if test="count(error) = 0">
+                  <tr>
+                     <td align="left">
+                        <a>
+                           <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="@name"/>
+                           </xsl:attribute>
+                           <xsl:value-of select="@name"/>
+                        </a>
+                     </td>
+                     <td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
+                     <td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
+                     <td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
+                     <td align="right"><xsl:value-of select="Stats/Ca"/></td>
+                     <td align="right"><xsl:value-of select="Stats/Ce"/></td>
+                     <td align="right"><xsl:value-of select="Stats/A"/></td>
+                     <td align="right"><xsl:value-of select="Stats/I"/></td>
+                     <td align="right"><xsl:value-of select="Stats/D"/></td>
+                  </tr>
+               </xsl:if>
+            </xsl:for-each>
+            <xsl:for-each select="./Packages/Package">
+               <xsl:if test="count(error) &gt; 0">
+                  <tr>
+                     <td align="left">
+                        <xsl:value-of select="@name"/>
+                     </td>
+                     <td align="left" colspan="8"><xsl:value-of select="error"/></td>
+                  </tr>
+               </xsl:if>
+            </xsl:for-each>
+         </table>
+      </body>
+   </html>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="packages.details">
+   <html>
+      <head>
+          <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+      </head>
+      <body>
+         <xsl:call-template name="pageHeader"/>
+  <table width="100%"><tr align="left"><h2>Packages</h2><td>
+  </td><td align="right">
+  [<a href="overview-summary.html">summary</a>]
+  [packages]
+  [<a href="overview-cycles.html">cycles</a>]
+  [<a href="overview-explanations.html">explanations</a>]
+   </td></tr></table>
+  
+  <xsl:for-each select="./Packages/Package">
+    <xsl:if test="count(error) = 0">
+      <h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
+      <xsl:value-of select="@name"/></a></h3>
+      
+      <table width="100%"><tr>
+        <td><a href="overview-explanations.html#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
+        <td><a href="overview-explanations.html#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
+        <td><a href="overview-explanations.html#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
+        <td><a href="overview-explanations.html#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
+        <td><a href="overview-explanations.html#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
+      </tr></table>
+      
+      <table width="100%" class="details">
+        <tr>
+          <th>Abstract Classes</th>
+          <th>Concrete Classes</th>
+          <th>Used by Packages</th>
+          <th>Uses Packages</th>
+        </tr>
+        <tr>
+          <td valign="top" width="25%">
+          <xsl:if test="count(AbstractClasses/Class)=0">
+              <i>None</i>
+            </xsl:if>
+            <xsl:for-each select="AbstractClasses/Class">
+              <xsl:value-of select="node()"/><br/>
+            </xsl:for-each>
+          </td>
+          <td valign="top" width="25%">
+            <xsl:if test="count(ConcreteClasses/Class)=0">
+              <i>None</i>
+            </xsl:if>
+            <xsl:for-each select="ConcreteClasses/Class">
+              <xsl:value-of select="node()"/><br/>
+            </xsl:for-each>
+          </td>
+          <td valign="top" width="25%">
+            <xsl:if test="count(UsedBy/Package)=0">
+              <i>None</i>
+            </xsl:if>
+            <xsl:for-each select="UsedBy/Package">
+              <a>
+                        <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="node()"/></xsl:attribute>
+                <xsl:value-of select="node()"/>
+              </a><br/>
+            </xsl:for-each>
+          </td>
+          <td valign="top" width="25%">
+            <xsl:if test="count(DependsUpon/Package)=0">
+              <i>None</i>
+            </xsl:if>
+            <xsl:for-each select="DependsUpon/Package">
+              <a>
+                        <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="node()"/></xsl:attribute>
+                <xsl:value-of select="node()"/>
+              </a><br/>
+            </xsl:for-each>
+          </td>
+        </tr>
+      </table>
+    </xsl:if>
+  </xsl:for-each>
+  <!-- this is often a long listing; provide a lower navigation table also -->
+  <table width="100%"><tr align="left"><td></td><td align="right">
+  [<a href="overview-summary.html">summary</a>]
+  [packages]
+  [<a href="overview-cycles.html">cycles</a>]
+  [<a href="overview-explanations.html">explanations</a>]
+   </td></tr></table>
+      </body>
+   </html>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="cycles.details">
+   <html>
+      <head>
+         <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+      </head>
+      <body>
+         <xsl:call-template name="pageHeader"/>
+  <table width="100%"><tr align="left"><h2>Cycles</h2><td>
+  </td><td align="right">
+  [<a href="overview-summary.html">summary</a>]
+  [<a href="overview-packages.html">packages</a>]
+  [cycles]
+  [<a href="overview-explanations.html">explanations</a>]
+   </td></tr></table>
+  <!--<table width="100%"><tr><td>
+  </td><td align="right">
+    [<a href="#NVsummary">summary</a>]
+  [<a href="#NVpackages">packages</a>]
+  [<a href="#NVcycles">cycles</a>]
+   [<a href="#NVexplanations">explanations</a>]
+  </td></tr></table> -->
+  
+  <xsl:if test="count(Cycles/Package) = 0">
+    <p>There are no cyclic dependancies.</p>
+  </xsl:if>
+  <xsl:for-each select="Cycles/Package">
+     <h3><a><xsl:attribute name="name">#CY<xsl:value-of select="@Name"/></xsl:attribute><xsl:value-of select="@Name"/></a></h3><p>
+    <xsl:for-each select="Package">
+      <xsl:value-of select="."/><br/>
+    </xsl:for-each></p>
+  </xsl:for-each>
+  <!-- this is often a long listing; provide a lower navigation table also -->
+  <table width="100%"><tr align="left"><td></td><td align="right">
+  [<a href="overview-summary.html">summary</a>]
+  [<a href="overview-packages.html">packages</a>]
+  [cycles]
+  [<a href="overview-explanations.html">explanations</a>]
+   </td></tr></table>
+  </body>
+  </html>
+</xsl:template>
+    
+<xsl:template match="JDepend" mode="explanations">
+   <html>
+      <head>
+         <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+      </head>
+      <body>
+         <xsl:call-template name="pageHeader"/>
+
+  <table width="100%"><tr align="left"><h2>Explanations</h2><td>
+  </td><td align="right">
+  [<a href="overview-summary.html">summary</a>]
+  [<a href="overview-packages.html">packages</a>]
+  [<a href="overview-cycles.html">cycles</a>]
+  [explanations]
+   </td></tr></table>
+  
+  <p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
+  
+  <h3><a name="EXnumber">Number of Classes</a></h3>
+    <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
+  <h3><a name="EXafferent">Afferent Couplings</a></h3>
+    <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
+  <h3><a name="EXefferent">Efferent Couplings</a></h3>
+    <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
+  <h3><a name="EXabstractness">Abstractness</a></h3> 
+    <p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
+    <p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
+  <h3><a name="EXinstability">Instability</a></h3>
+    <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
+    <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
+  <h3><a name="EXdistance">Distance</a></h3>
+    <p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
+    <p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
+    <p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
+  
+      </body>
+   </html>
+</xsl:template>
+  
+  
+<!--
+Creates an html file that contains a link to all package links in overview-packages.html.
+  @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="JDepend/Packages" mode="all.packages">
+  <html>
+    <head>
+      <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+    </head>
+    <body>
+  <table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
+  [<a href="overview-summary.html" target="classFrame">summary</a>]
+  [<a href="overview-packages.html" target="classFrame">packages</a>]
+  [<a href="overview-cycles.html" target="classFrame">cycles</a>]
+  [<a href="overview-explanations.html" target="classFrame">explanations</a>]
+   </td></tr></table>
+      <h2>Packages</h2>
+        <table width="100%">
+          <xsl:apply-templates select="Package[count(error)=0]" mode="all.packages.link">
+            <xsl:sort select="@name"/>
+          </xsl:apply-templates>
+          <xsl:apply-templates select="Package[count(error) &gt; 0]" mode="all.packages.nolink">
+            <xsl:sort select="@name"/>
+          </xsl:apply-templates>
+        </table>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="JDepend/Packages/Package" mode="all.packages.link">
+  <tr>
+    <td nowrap="nowrap">
+         <a href="overview-packages.html#PK{@name}" target="classFrame">
+        <xsl:value-of select="@name"/>
+      </a>
+    </td>
+  </tr>
+</xsl:template>
+
+<!--
+I do not know JDepend enough to know if every error results in a non-analyzed package,
+but that is how I am presenting it to the viewer.  This may need to change.
+  @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="JDepend/Packages/Package" mode="all.packages.nolink">
+  <tr>
+    <td nowrap="nowrap">
+       Not Analyzed: <xsl:value-of select="@name"/>
+    </td>
+  </tr>
+</xsl:template>
+
+<!--
+Creates an html file that contains a link to all package links in overview-cycles.html.
+  @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="JDepend/Cycles" mode="all.cycles">
+  <html>
+    <head>
+      <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+    </head>
+    <body>
+  <table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
+  [<a href="overview-summary.html" target="classFrame">summary</a>]
+  [<a href="overview-packages.html" target="classFrame">packages</a>]
+  [<a href="overview-cycles.html" target="classFrame">cycles</a>]
+  [<a href="overview-explanations.html" target="classFrame">explanations</a>]
+   </td></tr></table>
+      <h2>Cycles</h2>
+        <table width="100%">
+           <xsl:apply-templates select="Package" mode="all.cycles">
+            <xsl:sort select="@Name"/>
+          </xsl:apply-templates>
+        </table>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="JDepend/Cycles/Package" mode="all.cycles">
+  <tr>
+    <td nowrap="nowrap">
+         <a href="overview-cycles.html#CY{@Name}" target="classFrame"><xsl:value-of select="@Name"/></a>
+    </td>
+  </tr>
+</xsl:template>
+    
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+   <h1>JDepend Analysis</h1>
+  <table width="100%">
+  <tr>
+    <td align="left"></td>
+      <td align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</td>
+  </tr>
+  </table>
+  <hr size="1"/>
+</xsl:template>
+
+</xsl:stylesheet>

Added: labs/jbossforums/branches/forums120P26/tools/etc/jdepend.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/jdepend.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/jdepend.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,312 @@
+<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+
+<xsl:output method="html" indent="yes"  encoding="US-ASCII"/>
+
+<xsl:template match="JDepend">
+	<html>
+	<head>
+		<title>JDepend Analysis</title>
+		
+	<style type="text/css">
+	  body {
+		font:normal 68% verdana,arial,helvetica;
+		color:#000000;
+	  }
+	  table tr td, tr th {
+		  font-size: 68%;
+	  }
+	  table.details tr th{
+		font-weight: bold;
+		text-align:left;
+		background:#a6caf0;
+	  }
+	  table.details tr td{
+		background:#eeeee0;
+	  }
+	  
+	  p {
+		line-height:1.5em;
+		margin-top:0.5em; margin-bottom:1.0em;
+		margin-left:2em;
+		margin-right:2em;
+	  }
+	  h1 {
+		margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+	  }
+	  h2 {
+		margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+	  }
+	  h3 {
+		margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+	  }
+	  h4 {
+		margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+	  }
+	  h5 {
+		margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+	  }
+	  h6 {
+		margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+	  }
+	  .Error {
+		font-weight:bold; color:red;
+	  }
+	  .Failure {
+		font-weight:bold; color:purple;
+	  }
+	  .Properties {
+		text-align:right;
+	  }
+	  </style>
+		
+		
+	</head>
+	<body>
+	<!--h1>JDepend Report</h1>
+	<ul>
+	<xsl:for-each select="./Packages/Package">
+				<xsl:sort select="@name"/>
+		<li><xsl:value-of select="@name"/></li>
+	</xsl:for-each>
+	</ul-->
+	
+	<h1><a name="top">JDepend Analysis</a></h1>
+	<p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</p>
+	<hr size="2" />
+	
+	<table width="100%"><tr><td>
+	<a name="NVsummary"><h2>Summary</h2></a>
+	</td><td align="right">
+	[<a href="#NVsummary">summary</a>]
+	[<a href="#NVpackages">packages</a>]
+	[<a href="#NVcycles">cycles</a>]
+	[<a href="#NVexplanations">explanations</a>]
+	</td></tr></table>
+	
+	<table width="100%" class="details">
+		<tr>
+			<th>Package</th>
+			<th>Total Classes</th>
+			<th><a href="#EXnumber">Abstract Classes</a></th>
+			<th><a href="#EXnumber">Concrete Classes</a></th>
+			<th><a href="#EXafferent">Afferent Couplings</a></th>
+			<th><a href="#EXefferent">Efferent Couplings</a></th>
+			<th><a href="#EXabstractness">Abstractness</a></th>
+			<th><a href="#EXinstability">Instability</a></th>
+			<th><a href="#EXdistance">Distance</a></th>
+			
+		</tr>
+	<xsl:for-each select="./Packages/Package">
+		<xsl:if test="count(error) = 0">
+			<tr>
+				<td align="left">
+					<a>
+					<xsl:attribute name="href">#PK<xsl:value-of select="@name"/>
+					</xsl:attribute>
+					<xsl:value-of select="@name"/>
+					</a>
+				</td>
+				<td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
+				<td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
+				<td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
+				<td align="right"><xsl:value-of select="Stats/Ca"/></td>
+				<td align="right"><xsl:value-of select="Stats/Ce"/></td>
+				<td align="right"><xsl:value-of select="Stats/A"/></td>
+				<td align="right"><xsl:value-of select="Stats/I"/></td>
+				<td align="right"><xsl:value-of select="Stats/D"/></td>
+				
+
+			</tr>
+		</xsl:if>
+	</xsl:for-each>
+	<xsl:for-each select="./Packages/Package">
+		<xsl:if test="count(error) &gt; 0">
+			<tr>
+				<td align="left">
+					<xsl:value-of select="@name"/>
+				</td>
+				<td align="left" colspan="8"><xsl:value-of select="error"/></td>
+			</tr>
+		</xsl:if>
+	</xsl:for-each>
+	</table>
+	
+	<table width="100%"><tr><td>
+	<a name="NVpackages"><h2>Packages</h2></a>
+	</td><td align="right">
+	[<a href="#NVsummary">summary</a>]
+	[<a href="#NVpackages">packages</a>]
+	[<a href="#NVcycles">cycles</a>]
+	[<a href="#NVexplanations">explanations</a>]
+	</td></tr></table>
+	
+	<xsl:for-each select="./Packages/Package">
+		<xsl:if test="count(error) = 0">
+			<h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
+			<xsl:value-of select="@name"/></a></h3>
+			
+			<table width="100%"><tr>
+				<td><a href="#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
+				<td><a href="#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
+				<td><a href="#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
+				<td><a href="#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
+				<td><a href="#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
+			</tr></table>
+			
+			<table width="100%" class="details">
+				<tr>
+					<th>Abstract Classes</th>
+					<th>Concrete Classes</th>
+					<th>Used by Packages</th>
+					<th>Uses Packages</th>
+				</tr>
+				<tr>
+					<td valign="top" width="25%">
+					<xsl:if test="count(AbstractClasses/Class)=0">
+							<i>None</i>
+						</xsl:if>
+						<xsl:for-each select="AbstractClasses/Class">
+							<xsl:value-of select="node()"/><br/>
+						</xsl:for-each>
+					</td>
+					<td valign="top" width="25%">
+						<xsl:if test="count(ConcreteClasses/Class)=0">
+							<i>None</i>
+						</xsl:if>
+						<xsl:for-each select="ConcreteClasses/Class">
+							<xsl:value-of select="node()"/><br/>
+						</xsl:for-each>
+					</td>
+					<td valign="top" width="25%">
+						<xsl:if test="count(UsedBy/Package)=0">
+							<i>None</i>
+						</xsl:if>
+						<xsl:for-each select="UsedBy/Package">
+							<a>
+								<xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
+								<xsl:value-of select="node()"/>
+							</a><br/>
+						</xsl:for-each>
+					</td>
+					<td valign="top" width="25%">
+						<xsl:if test="count(DependsUpon/Package)=0">
+							<i>None</i>
+						</xsl:if>
+						<xsl:for-each select="DependsUpon/Package">
+							<a>
+								<xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
+								<xsl:value-of select="node()"/>
+							</a><br/>
+						</xsl:for-each>
+					</td>
+				</tr>
+			</table>
+		</xsl:if>
+	</xsl:for-each>
+	
+	<table width="100%"><tr><td>
+	<a name="NVcycles"><h2>Cycles</h2></a>
+	</td><td align="right">
+	[<a href="#NVsummary">summary</a>]
+	[<a href="#NVpackages">packages</a>]
+	[<a href="#NVcycles">cycles</a>]
+	[<a href="#NVexplanations">explanations</a>]
+	</td></tr></table>
+	
+	<xsl:if test="count(Cycles/Package) = 0">
+		<p>There are no cyclic dependancies.</p>
+	</xsl:if>
+	<xsl:for-each select="Cycles/Package">
+		<h3><xsl:value-of select="@Name"/></h3><p>
+		<xsl:for-each select="Package">
+			<xsl:value-of select="."/><br/>
+		</xsl:for-each></p>
+	</xsl:for-each>
+	
+	<table width="100%"><tr><td>
+	<a name="NVexplanations"><h2>Explanations</h2></a>
+	</td><td align="right">
+	[<a href="#NVsummary">summary</a>]
+	[<a href="#NVpackages">packages</a>]
+	[<a href="#NVcycles">cycles</a>]
+	[<a href="#NVexplanations">explanations</a>]
+	</td></tr></table>
+	
+	<p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
+	
+	<h3><a name="EXnumber">Number of Classes</a></h3>
+		<p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
+	<h3><a name="EXafferent">Afferent Couplings</a></h3>
+		<p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
+	<h3><a name="EXefferent">Efferent Couplings</a></h3>
+		<p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
+	<h3><a name="EXabstractness">Abstractness</a></h3> 
+		<p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
+		<p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
+	<h3><a name="EXinstability">Instability</a></h3>
+		<p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
+		<p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
+	<h3><a name="EXdistance">Distance</a></h3>
+		<p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
+		<p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
+		<p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
+	
+	</body>
+	</html>
+</xsl:template>
+
+</xsl:stylesheet>

Added: labs/jbossforums/branches/forums120P26/tools/etc/junit-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/junit-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/junit-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,741 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:lxslt="http://xml.apache.org/xslt"
+    xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+    extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator=","/>
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+
+<!--
+ 
+ Sample stylesheet to be used with An JUnitReport output.
+ 
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+ 
+ @author Stephane Bailliez <a href="mailto:sbailliez at apache.org"/>
+ @author Erik Hatcher <a href="mailto:ehatcher at apache.org"/>
+ 
+-->
+<xsl:param name="output.dir" select="'.'"/>
+
+
+<xsl:template match="testsuites">
+    <!-- create the index.html -->
+    <redirect:write file="{$output.dir}/index.html">
+        <xsl:call-template name="index.html"/>
+    </redirect:write>
+
+    <!-- create the stylesheet.css -->
+    <redirect:write file="{$output.dir}/stylesheet.css">
+        <xsl:call-template name="stylesheet.css"/>
+    </redirect:write>
+
+    <!-- create the overview-packages.html at the root -->
+    <redirect:write file="{$output.dir}/overview-summary.html">
+        <xsl:apply-templates select="." mode="overview.packages"/>
+    </redirect:write>
+
+    <!-- create the all-packages.html at the root -->
+    <redirect:write file="{$output.dir}/overview-frame.html">
+        <xsl:apply-templates select="." mode="all.packages"/>
+    </redirect:write>
+    
+    <!-- create the all-classes.html at the root -->
+    <redirect:write file="{$output.dir}/allclasses-frame.html">
+        <xsl:apply-templates select="." mode="all.classes"/>
+    </redirect:write>
+    
+    <!-- process all packages -->
+    <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+        <xsl:call-template name="package">
+            <xsl:with-param name="name" select="@package"/>
+        </xsl:call-template>
+    </xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="package">
+    <xsl:param name="name"/>
+    <xsl:variable name="package.dir">
+        <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
+        <xsl:if test="$name = ''">.</xsl:if>
+    </xsl:variable> 
+    <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
+    <!-- create a classes-list.html in the package directory -->
+    <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
+        <xsl:call-template name="classes.list">
+            <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+    </redirect:write>
+    
+    <!-- create a package-summary.html in the package directory -->
+    <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
+        <xsl:call-template name="package.summary">
+            <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+    </redirect:write>
+    
+    <!-- for each class, creates a @name.html -->
+    <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
+    <xsl:for-each select="/testsuites/testsuite[@package = $name]">
+        <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
+            <xsl:apply-templates select="." mode="class.details"/>
+        </redirect:write>
+    </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="index.html">
+<html>
+    <head>
+        <title>Unit Test Results.</title>
+    </head>
+    <frameset cols="20%,80%">
+        <frameset rows="30%,70%">
+            <frame src="overview-frame.html" name="packageListFrame"/>
+            <frame src="allclasses-frame.html" name="classListFrame"/>
+        </frameset>
+        <frame src="overview-summary.html" name="classFrame"/>
+        <noframes>
+            <h2>Frame Alert</h2>
+            <p>
+                This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+            </p>
+        </noframes>
+    </frameset>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+body {
+    font:normal 68% verdana,arial,helvetica;
+    color:#000000;
+}
+table tr td, table tr th {
+    font-size: 68%;
+}
+table.details tr th{
+    font-weight: bold;
+    text-align:left;
+    background:#a6caf0;
+}
+table.details tr td{
+    background:#eeeee0;
+}
+
+p {
+    line-height:1.5em;
+    margin-top:0.5em; margin-bottom:1.0em;
+}
+h1 {
+    margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+}
+h2 {
+    margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+}
+h3 {
+    margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+}
+h4 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h5 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h6 {
+    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+.Error {
+    font-weight:bold; color:red;
+}
+.Failure {
+    font-weight:bold; color:purple;
+}
+.Properties {
+  text-align:right;
+}
+</xsl:template>
+
+
+<!-- ======================================================================
+    This page is created for every testsuite class.
+    It prints a summary of the testsuite and detailed information about
+    testcase methods.
+     ====================================================================== -->
+<xsl:template match="testsuite" mode="class.details">
+    <xsl:variable name="package.name" select="@package"/>
+    <xsl:variable name="class.name"><xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></xsl:variable>
+    <html>
+        <head>
+          <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name" select="$package.name"/>
+            </xsl:call-template>
+       <script type="text/javascript" language="JavaScript">
+        var TestCases = new Array();
+        var cur;
+        <xsl:apply-templates select="properties"/>
+       </script>
+       <script type="text/javascript" language="JavaScript"><![CDATA[
+        function displayProperties (name) {
+          var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+          var doc = win.document.open();
+          doc.write("<html><head><title>Properties of " + name + "</title>");
+          doc.write("<style type=\"text/css\">");
+          doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
+          doc.write("table tr td, table tr th { font-size: 68%; }");
+          doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+          doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+          doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
+          doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
+          doc.write("</style>");
+          doc.write("</head><body>");
+          doc.write("<h3>Properties of " + name + "</h3>");
+          doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
+          doc.write("<table class='properties'>");
+          doc.write("<tr><th>Name</th><th>Value</th></tr>");
+          for (prop in TestCases[name]) {
+            doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
+          }
+          doc.write("</table>");
+          doc.write("</body></html>");
+          doc.close();
+          win.focus();
+        }
+      ]]>  
+      </script>
+        </head>
+        <body>
+            <xsl:call-template name="pageHeader"/>  
+            <h3>Class <xsl:value-of select="$class.name"/></h3>
+
+            
+            <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+                <xsl:call-template name="testsuite.test.header"/>
+                <xsl:apply-templates select="." mode="print.test"/>
+            </table>
+    
+            <h2>Tests</h2>
+            <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+        <xsl:call-template name="testcase.test.header"/>
+              <!--
+              test can even not be started at all (failure to load the class)
+              so report the error directly
+              -->
+                <xsl:if test="./error">
+                    <tr class="Error">
+                        <td colspan="4"><xsl:apply-templates select="./error"/></td>
+                    </tr>
+                </xsl:if>
+                <xsl:apply-templates select="./testcase" mode="print.test"/>
+            </table>
+            <div class="Properties">
+                <a>
+                    <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
+                    Properties &#187;
+                </a>
+            </div>
+        </body>
+    </html>
+</xsl:template>
+
+  <!--
+   Write properties into a JavaScript data structure.
+   This is based on the original idea by Erik Hatcher (ehatcher at apache.org)
+   -->
+  <xsl:template match="properties">
+    cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
+    <xsl:for-each select="property">
+    <xsl:sort select="@name"/>
+        cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
+    </xsl:for-each>
+  </xsl:template>
+
+
+<!-- ======================================================================
+    This page is created for every package.
+    It prints the name of all classes that belongs to this package.
+    @param name the package name to print classes.
+     ====================================================================== -->
+<!-- list of classes in a package -->
+<xsl:template name="classes.list">
+    <xsl:param name="name"/>
+    <html>
+        <head>
+            <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name" select="$name"/>
+            </xsl:call-template>
+        </head>
+        <body>
+            <table width="100%">
+                <tr>
+                    <td nowrap="nowrap">
+                        <h2><a href="package-summary.html" target="classFrame"><xsl:value-of select="$name"/></a></h2>
+                    </td>
+                </tr>
+            </table>
+    
+            <h2>Classes</h2>
+            <table width="100%">
+                <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
+                    <xsl:sort select="@name"/>
+                    <tr>
+                        <td nowrap="nowrap">
+                            <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+                        </td>
+                    </tr>
+                </xsl:for-each>
+            </table>
+        </body>
+    </html>
+</xsl:template>
+
+
+<!--
+    Creates an all-classes.html file that contains a link to all package-summary.html
+    on each class.
+-->
+<xsl:template match="testsuites" mode="all.classes">
+    <html>
+        <head>
+            <title>All Unit Test Classes</title>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name"/>
+            </xsl:call-template>
+        </head>
+        <body>
+            <h2>Classes</h2>
+            <table width="100%">
+                <xsl:apply-templates select="testsuite" mode="all.classes">
+                    <xsl:sort select="@name"/>
+                </xsl:apply-templates>
+            </table>
+        </body>
+    </html>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="all.classes">
+    <xsl:variable name="package.name" select="@package"/>
+    <tr>
+        <td nowrap="nowrap">
+            <a target="classFrame">
+                <xsl:attribute name="href">
+                    <xsl:if test="not($package.name='')">
+                        <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+                    </xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
+                </xsl:attribute>
+                <xsl:value-of select="@name"/>
+            </a>
+        </td>
+    </tr>
+</xsl:template>
+
+
+<!--
+    Creates an html file that contains a link to all package-summary.html files on
+    each package existing on testsuites.
+    @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="testsuites" mode="all.packages">
+    <html>
+        <head>
+            <title>All Unit Test Packages</title>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name"/>
+            </xsl:call-template>
+        </head>
+        <body>
+            <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
+            <h2>Packages</h2>
+            <table width="100%">
+                <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
+                    <xsl:sort select="@package"/>
+                </xsl:apply-templates>
+            </table>
+        </body>
+    </html>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="all.packages">
+    <tr>
+        <td nowrap="nowrap">
+            <a href="{translate(@package,'.','/')}/package-summary.html" target="classFrame">
+                <xsl:value-of select="@package"/>
+            </a>
+        </td>
+    </tr>
+</xsl:template>
+
+
+<xsl:template match="testsuites" mode="overview.packages">
+    <html>
+        <head>
+            <title>Unit Test Results: Summary</title>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name"/>
+            </xsl:call-template>
+        </head>
+        <body>
+        <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+        <xsl:call-template name="pageHeader"/>
+        <h2>Summary</h2>
+        <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
+        <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
+        <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
+        <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+        <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
+        <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+        <tr valign="top">
+            <th>Tests</th>
+            <th>Failures</th>
+            <th>Errors</th>
+            <th>Success rate</th>
+            <th>Time</th>
+        </tr>
+        <tr valign="top">
+            <xsl:attribute name="class">
+                <xsl:choose>
+                    <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+                    <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+                    <xsl:otherwise>Pass</xsl:otherwise>
+                </xsl:choose>
+            </xsl:attribute>
+            <td><xsl:value-of select="$testCount"/></td>
+            <td><xsl:value-of select="$failureCount"/></td>
+            <td><xsl:value-of select="$errorCount"/></td>
+            <td>
+                <xsl:call-template name="display-percent">
+                    <xsl:with-param name="value" select="$successRate"/>
+                </xsl:call-template>
+            </td>
+            <td>
+                <xsl:call-template name="display-time">
+                    <xsl:with-param name="value" select="$timeCount"/>
+                </xsl:call-template>
+            </td>
+
+        </tr>
+        </table>
+        <table border="0" width="95%">
+        <tr>
+        <td style="text-align: justify;">
+        Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
+        </td>
+        </tr>
+        </table>
+        
+        <h2>Packages</h2>
+        <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+            <xsl:call-template name="testsuite.test.header"/>
+            <xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+                <xsl:sort select="@package" order="ascending"/>
+                <!-- get the node set containing all testsuites that have the same package -->
+                <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
+                <tr valign="top">
+                    <!-- display a failure if there is any failure/error in the package -->
+                    <xsl:attribute name="class">
+                        <xsl:choose>
+                            <xsl:when test="sum($insamepackage/@errors) &gt; 0">Error</xsl:when>
+                            <xsl:when test="sum($insamepackage/@failures) &gt; 0">Failure</xsl:when>
+                            <xsl:otherwise>Pass</xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:attribute>
+                    <td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td>
+                    <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
+                    <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
+                    <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
+                    <td>
+                    <xsl:call-template name="display-time">
+                        <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
+                    </xsl:call-template>
+                    </td>
+                </tr>
+            </xsl:for-each>
+        </table>
+        </body>
+        </html>
+</xsl:template>
+
+
+<xsl:template name="package.summary">
+    <xsl:param name="name"/>
+    <html>
+        <head>
+            <xsl:call-template name="create.stylesheet.link">
+                <xsl:with-param name="package.name" select="$name"/>
+            </xsl:call-template>
+        </head>
+        <body>
+            <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
+            <xsl:call-template name="pageHeader"/>
+            <h3>Package <xsl:value-of select="$name"/></h3>
+            
+            <!--table border="0" cellpadding="5" cellspacing="2" width="95%">
+                <xsl:call-template name="class.metrics.header"/>
+                <xsl:apply-templates select="." mode="print.metrics"/>
+            </table-->
+            
+            <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
+            <xsl:if test="count($insamepackage) &gt; 0">
+                <h2>Classes</h2>
+                <p>
+                <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+                    <xsl:call-template name="testsuite.test.header"/>
+                    <xsl:apply-templates select="$insamepackage" mode="print.test">
+                        <xsl:sort select="@name"/>
+                    </xsl:apply-templates>
+                </table>
+                </p>
+            </xsl:if>
+        </body>
+    </html>
+</xsl:template>
+
+
+<!--
+    transform string like a.b.c to ../../../
+    @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+    <xsl:param name="path"/>
+    <xsl:if test="contains($path,'.')">
+        <xsl:text>../</xsl:text>    
+        <xsl:call-template name="path">
+            <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
+        </xsl:call-template>    
+    </xsl:if>
+    <xsl:if test="not(contains($path,'.')) and not($path = '')">
+        <xsl:text>../</xsl:text>    
+    </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+    <xsl:param name="package.name"/>
+    <link rel="stylesheet" type="text/css" title="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
+</xsl:template>
+
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+    <h1>Unit Test Results</h1>
+    <table width="100%">
+    <tr>
+        <td align="left"></td>
+        <td align="right">Designed for use with <a href="http://www.junit.org/">JUnit</a> and <a href="http://jakarta.apache.org/">Ant</a>.</td>
+    </tr>
+    </table>
+    <hr size="1"/>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+    <tr valign="top">
+        <th width="80%">Name</th>
+        <th>Tests</th>
+        <th>Errors</th>
+        <th>Failures</th>
+        <th nowrap="nowrap">Time(s)</th>
+    </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+    <tr valign="top">
+        <th>Name</th>
+        <th>Status</th>
+        <th width="80%">Type</th>
+        <th nowrap="nowrap">Time(s)</th>
+    </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+    <tr valign="top">       
+        <xsl:attribute name="class">
+            <xsl:choose>
+                <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
+                <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
+                <xsl:otherwise>Pass</xsl:otherwise>
+            </xsl:choose>
+        </xsl:attribute>
+        <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
+        <td><xsl:apply-templates select="@tests"/></td>
+        <td><xsl:apply-templates select="@errors"/></td>
+        <td><xsl:apply-templates select="@failures"/></td>
+        <td><xsl:call-template name="display-time">
+                <xsl:with-param name="value" select="@time"/>
+            </xsl:call-template>
+        </td>
+    </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+    <tr valign="top">
+        <xsl:attribute name="class">
+            <xsl:choose>
+                <xsl:when test="error">Error</xsl:when>
+                <xsl:when test="failure">Failure</xsl:when>
+                <xsl:otherwise>TableRowColor</xsl:otherwise>
+            </xsl:choose>
+        </xsl:attribute>
+        <td><xsl:value-of select="@name"/></td>
+        <xsl:choose>
+            <xsl:when test="failure">
+                <td>Failure</td>
+                <td><xsl:apply-templates select="failure"/></td>
+            </xsl:when>
+            <xsl:when test="error">
+                <td>Error</td>
+                <td><xsl:apply-templates select="error"/></td>
+            </xsl:when>
+            <xsl:otherwise>
+                <td>Success</td>
+                <td></td>
+            </xsl:otherwise>
+        </xsl:choose>
+        <td>
+            <xsl:call-template name="display-time">
+                <xsl:with-param name="value" select="@time"/>
+            </xsl:call-template>
+        </td>
+    </tr>
+</xsl:template>
+
+
+<!-- Note : the below template error and failure are the same style
+            so just call the same style store in the toolkit template -->
+<xsl:template match="failure">
+    <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+    <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the testcase template -->
+<xsl:template name="display-failures">
+    <xsl:choose>
+        <xsl:when test="not(@message)">N/A</xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="@message"/>
+        </xsl:otherwise>
+    </xsl:choose>
+    <!-- display the stacktrace -->
+    <br/><br/>
+    <code>
+        <xsl:call-template name="br-replace">
+            <xsl:with-param name="word" select="."/>
+        </xsl:call-template>
+    </code>
+    <!-- the latter is better but might be problematic for non-21" monitors... -->
+    <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+    <xsl:param name="string"/>
+    <xsl:choose>
+        <xsl:when test="contains($string,&quot;'&quot;)">
+            <xsl:value-of select="substring-before($string,&quot;'&quot;)"/>\&apos;<xsl:call-template name="JS-escape">
+                <xsl:with-param name="string" select="substring-after($string,&quot;'&quot;)"/>
+            </xsl:call-template>
+        </xsl:when> 
+        <xsl:when test="contains($string,'\')">
+            <xsl:value-of select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
+                <xsl:with-param name="string" select="substring-after($string,'\')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$string"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!--
+    template that will convert a carriage return into a br tag
+    @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+    <xsl:param name="word"/>
+    <xsl:choose>
+        <xsl:when test="contains($word,'&#xA;')">
+            <xsl:value-of select="substring-before($word,'&#xA;')"/>
+            <br/>
+            <xsl:call-template name="br-replace">
+                <xsl:with-param name="word" select="substring-after($word,'&#xA;')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$word"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template name="display-time">
+    <xsl:param name="value"/>
+    <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+    <xsl:param name="value"/>
+    <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+</xsl:stylesheet>
+

Added: labs/jbossforums/branches/forums120P26/tools/etc/junit-noframes.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/junit-noframes.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/junit-noframes.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,519 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"
+  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+ 
+<!--
+ 
+ Sample stylesheet to be used with An JUnitReport output.
+ 
+ It creates a non-framed report that can be useful to send via
+ e-mail or such.
+ 
+ @author Stephane Bailliez <a href="mailto:sbailliez at apache.org"/>
+ @author Erik Hatcher <a href="mailto:ehatcher at apache.org"/>
+ 
+-->
+<xsl:template match="testsuites">
+    <html>
+        <head>
+            <title>Unit Test Results</title>
+    <style type="text/css">
+      body {
+        font:normal 68% verdana,arial,helvetica;
+        color:#000000;
+      }
+      table tr td, table tr th {
+          font-size: 68%;
+      }
+      table.details tr th{
+        font-weight: bold;
+        text-align:left;
+        background:#a6caf0;
+      }
+      table.details tr td{
+        background:#eeeee0;
+      }
+      
+      p {
+        line-height:1.5em;
+        margin-top:0.5em; margin-bottom:1.0em;
+      }
+      h1 {
+        margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+      }
+      h2 {
+        margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+      }
+      h3 {
+        margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+      }
+      h4 {
+        margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+      }
+      h5 {
+        margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+      }
+      h6 {
+        margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+      }
+      .Error {
+        font-weight:bold; color:red;
+      }
+      .Failure {
+        font-weight:bold; color:purple;
+      }
+      .Properties {
+        text-align:right;
+      }
+      </style>
+      <script type="text/javascript" language="JavaScript">
+        var TestCases = new Array();
+        var cur;
+        <xsl:for-each select="./testsuite">      
+            <xsl:apply-templates select="properties"/>
+        </xsl:for-each>
+
+       </script>
+       <script type="text/javascript" language="JavaScript"><![CDATA[
+        function displayProperties (name) {
+          var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+          var doc = win.document.open();
+          doc.write("<html><head><title>Properties of " + name + "</title>");
+          doc.write("<style>")
+          doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
+          doc.write("table tr td, table tr th { font-size: 68%; }");
+          doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+          doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+          doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
+          doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
+          doc.write("</style>");
+          doc.write("</head><body>");
+          doc.write("<h3>Properties of " + name + "</h3>");
+          doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
+          doc.write("<table class='properties'>");
+          doc.write("<tr><th>Name</th><th>Value</th></tr>");
+          for (prop in TestCases[name]) {
+            doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
+          }
+          doc.write("</table>");
+          doc.write("</body></html>");
+          doc.close();
+          win.focus();
+        }
+      ]]>  
+      </script>
+        </head>
+        <body>
+            <a name="top"></a>
+            <xsl:call-template name="pageHeader"/>  
+            
+            <!-- Summary part -->
+            <xsl:call-template name="summary"/>
+            <hr size="1" width="95%" align="left"/>
+            
+            <!-- Package List part -->
+            <xsl:call-template name="packagelist"/>
+            <hr size="1" width="95%" align="left"/>
+            
+            <!-- For each package create its part -->
+            <xsl:call-template name="packages"/>
+            <hr size="1" width="95%" align="left"/>
+            
+            <!-- For each class create the  part -->
+            <xsl:call-template name="classes"/>
+            
+        </body>
+    </html>
+</xsl:template>
+    
+    
+    
+    <!-- ================================================================== -->
+    <!-- Write a list of all packages with an hyperlink to the anchor of    -->
+    <!-- of the package name.                                               -->
+    <!-- ================================================================== -->
+    <xsl:template name="packagelist">   
+        <h2>Packages</h2>
+        Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+        <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+            <xsl:call-template name="testsuite.test.header"/>
+            <!-- list all packages recursively -->
+            <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+                <xsl:sort select="@package"/>
+                <xsl:variable name="testsuites-in-package" select="/testsuites/testsuite[./@package = current()/@package]"/>
+                <xsl:variable name="testCount" select="sum($testsuites-in-package/@tests)"/>
+                <xsl:variable name="errorCount" select="sum($testsuites-in-package/@errors)"/>
+                <xsl:variable name="failureCount" select="sum($testsuites-in-package/@failures)"/>
+                <xsl:variable name="timeCount" select="sum($testsuites-in-package/@time)"/>
+                
+                <!-- write a summary for the package -->
+                <tr valign="top">
+                    <!-- set a nice color depending if there is an error/failure -->
+                    <xsl:attribute name="class">
+                        <xsl:choose>
+                            <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+                            <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+                        </xsl:choose>
+                    </xsl:attribute>
+                    <td><a href="#{@package}"><xsl:value-of select="@package"/></a></td>
+                    <td><xsl:value-of select="$testCount"/></td>
+                    <td><xsl:value-of select="$errorCount"/></td>
+                    <td><xsl:value-of select="$failureCount"/></td>
+                    <td>
+                    <xsl:call-template name="display-time">
+                        <xsl:with-param name="value" select="$timeCount"/>
+                    </xsl:call-template>
+                    </td>
+                </tr>
+            </xsl:for-each>
+        </table>        
+    </xsl:template>
+    
+    
+    <!-- ================================================================== -->
+    <!-- Write a package level report                                       -->
+    <!-- It creates a table with values from the document:                  -->
+    <!-- Name | Tests | Errors | Failures | Time                            -->
+    <!-- ================================================================== -->
+    <xsl:template name="packages">
+        <!-- create an anchor to this package name -->
+        <xsl:for-each select="/testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+            <xsl:sort select="@package"/>
+                <a name="{@package}"></a>
+                <h3>Package <xsl:value-of select="@package"/></h3>
+                
+                <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+                    <xsl:call-template name="testsuite.test.header"/>
+            
+                    <!-- match the testsuites of this package -->
+                    <xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
+                </table>
+                <a href="#top">Back to top</a>
+                <p/>
+                <p/>
+        </xsl:for-each>
+    </xsl:template>
+    
+    <xsl:template name="classes">
+        <xsl:for-each select="testsuite">
+            <xsl:sort select="@name"/>
+            <!-- create an anchor to this class name -->
+            <a name="{@name}"></a>
+            <h3>TestCase <xsl:value-of select="@name"/></h3>
+            
+            <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+              <xsl:call-template name="testcase.test.header"/>
+              <!--
+              test can even not be started at all (failure to load the class)
+              so report the error directly
+              -->
+                <xsl:if test="./error">
+                    <tr class="Error">
+                        <td colspan="4"><xsl:apply-templates select="./error"/></td>
+                    </tr>
+                </xsl:if>
+                <xsl:apply-templates select="./testcase" mode="print.test"/>
+            </table>
+            <div class="Properties">
+                <a>
+                    <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
+                    Properties &#187;
+                </a>
+            </div>
+            <p/>
+            
+            <a href="#top">Back to top</a>
+        </xsl:for-each>
+    </xsl:template>
+    
+    <xsl:template name="summary">
+        <h2>Summary</h2>
+        <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
+        <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
+        <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
+        <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+        <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
+        <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+        <tr valign="top">
+            <th>Tests</th>
+            <th>Failures</th>
+            <th>Errors</th>
+            <th>Success rate</th>
+            <th>Time</th>
+        </tr>
+        <tr valign="top">
+            <xsl:attribute name="class">
+                <xsl:choose>
+                    <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+                    <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+                </xsl:choose>
+            </xsl:attribute>
+            <td><xsl:value-of select="$testCount"/></td>
+            <td><xsl:value-of select="$failureCount"/></td>
+            <td><xsl:value-of select="$errorCount"/></td>
+            <td>
+                <xsl:call-template name="display-percent">
+                    <xsl:with-param name="value" select="$successRate"/>
+                </xsl:call-template>
+            </td>
+            <td>
+                <xsl:call-template name="display-time">
+                    <xsl:with-param name="value" select="$timeCount"/>
+                </xsl:call-template>
+            </td>
+
+        </tr>
+        </table>
+        <table border="0" width="95%">
+        <tr>
+        <td style="text-align: justify;">
+        Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.
+        </td>
+        </tr>
+        </table>
+    </xsl:template>
+    
+  <!--
+   Write properties into a JavaScript data structure.
+   This is based on the original idea by Erik Hatcher (ehatcher at apache.org)
+   -->
+  <xsl:template match="properties">
+    cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
+    <xsl:for-each select="property">
+    <xsl:sort select="@name"/>
+        cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
+    </xsl:for-each>
+  </xsl:template>
+    
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+    <h1>Unit Test Results</h1>
+    <table width="100%">
+    <tr>
+        <td align="left"></td>
+        <td align="right">Designed for use with <a href='http://www.junit.org'>JUnit</a> and <a href='http://jakarta.apache.org/ant'>Ant</a>.</td>
+    </tr>
+    </table>
+    <hr size="1"/>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="header">
+    <tr valign="top">
+        <th width="80%">Name</th>
+        <th>Tests</th>
+        <th>Errors</th>
+        <th>Failures</th>
+        <th nowrap="nowrap">Time(s)</th>
+    </tr>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+    <tr valign="top">
+        <th width="80%">Name</th>
+        <th>Tests</th>
+        <th>Errors</th>
+        <th>Failures</th>
+        <th nowrap="nowrap">Time(s)</th>
+    </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+    <tr valign="top">
+        <th>Name</th>
+        <th>Status</th>
+        <th width="80%">Type</th>
+        <th nowrap="nowrap">Time(s)</th>
+    </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+    <tr valign="top">
+        <!-- set a nice color depending if there is an error/failure -->
+        <xsl:attribute name="class">
+            <xsl:choose>
+                <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
+                <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
+            </xsl:choose>
+        </xsl:attribute>
+    
+        <!-- print testsuite information -->
+        <td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
+        <td><xsl:value-of select="@tests"/></td>
+        <td><xsl:value-of select="@errors"/></td>
+        <td><xsl:value-of select="@failures"/></td>
+        <td>
+            <xsl:call-template name="display-time">
+                <xsl:with-param name="value" select="@time"/>
+            </xsl:call-template>
+        </td>
+    </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+    <tr valign="top">
+        <xsl:attribute name="class">
+            <xsl:choose>
+                <xsl:when test="failure | error">Error</xsl:when>
+            </xsl:choose>
+        </xsl:attribute>
+        <td><xsl:value-of select="@name"/></td>
+        <xsl:choose>
+            <xsl:when test="failure">
+                <td>Failure</td>
+                <td><xsl:apply-templates select="failure"/></td>
+            </xsl:when>
+            <xsl:when test="error">
+                <td>Error</td>
+                <td><xsl:apply-templates select="error"/></td>
+            </xsl:when>
+            <xsl:otherwise>
+                <td>Success</td>
+                <td></td>
+            </xsl:otherwise>
+        </xsl:choose>
+        <td>
+            <xsl:call-template name="display-time">
+                <xsl:with-param name="value" select="@time"/>
+            </xsl:call-template>
+        </td>
+    </tr>
+</xsl:template>
+
+
+<xsl:template match="failure">
+    <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+    <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the tescase template -->
+<xsl:template name="display-failures">
+    <xsl:choose>
+        <xsl:when test="not(@message)">N/A</xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="@message"/>
+        </xsl:otherwise>
+    </xsl:choose>
+    <!-- display the stacktrace -->
+    <code>
+        <br/><br/>
+        <xsl:call-template name="br-replace">
+            <xsl:with-param name="word" select="."/>
+        </xsl:call-template>
+    </code>
+    <!-- the later is better but might be problematic for non-21" monitors... -->
+    <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+    <xsl:param name="string"/>
+    <xsl:choose>
+        <xsl:when test="contains($string,&quot;'&quot;)">
+            <xsl:value-of select="substring-before($string,&quot;'&quot;)"/>\&apos;<xsl:call-template name="JS-escape">
+                <xsl:with-param name="string" select="substring-after($string,&quot;'&quot;)"/>
+            </xsl:call-template>
+        </xsl:when> 
+        <xsl:when test="contains($string,'\')">
+            <xsl:value-of select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
+                <xsl:with-param name="string" select="substring-after($string,'\')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$string"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!--
+    template that will convert a carriage return into a br tag
+    @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+    <xsl:param name="word"/>
+    <xsl:choose>
+        <xsl:when test="contains($word,'&#xA;')">
+            <xsl:value-of select="substring-before($word,'&#xA;')"/>
+            <br/>
+            <xsl:call-template name="br-replace">
+                <xsl:with-param name="word" select="substring-after($word,'&#xA;')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$word"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template name="display-time">
+    <xsl:param name="value"/>
+    <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+    <xsl:param name="value"/>
+    <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+
+</xsl:stylesheet>
+

Added: labs/jbossforums/branches/forums120P26/tools/etc/log.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/log.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/log.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,247 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+    Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+ 
+<!--
+
+  The purpose have this XSL is to provide a nice way to look at the output
+  from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
+  
+  @author <a href="mailto:sbailliez at apache.org">Stephane Bailliez</a>
+  
+-->
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:template match="/">
+<html>
+  <head>
+    <style type="text/css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin: 0;
+      font:normal 100% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    table.status {
+      font:bold 80% arial,helvetica,sanserif;
+      background-color:#525D76;
+      color:#ffffff;
+    }
+    table.log tr td, tr th {
+      font-size: 80%;
+    }
+    .error {
+      color:red;
+    }
+    .warn {
+      color:brown;
+    }
+    .info {
+      color:gray;
+    }
+    .debug{
+      color:gray;
+    }
+    .failed {
+      font-size:80%;
+      background-color: red;
+      color:#FFFFFF;
+      font-weight: bold
+    }
+    .complete {
+      font-size:80%;
+      background-color: #525D76;
+      color:#FFFFFF;
+      font-weight: bold
+    }
+    .a td { 
+      background: #efefef;
+    }
+    .b td { 
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      border: none
+    }
+    h3 {
+      font:bold 80% arial,helvetica,sanserif;
+      background: #525D76;
+      color: white;
+      text-decoration: none;
+      padding: 5px;
+      margin-right: 2px;
+      margin-left: 2px;
+      margin-bottom: 0;
+    }
+    </style>
+  </head>
+  <body>
+    <!-- jakarta logo -->
+    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+    <tr>
+      <td valign="top" class="bannercell">
+        <a href="http://jakarta.apache.org/">
+        <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+        </a>
+      </td>
+      <td style="text-align:right;vertical-align:bottom">
+        <a href="htp://jakarta.apache.org/ant">Jakarta Ant</a>
+      </td>
+    </tr>
+    </table>
+      
+    <table border="0" width="100%">
+    <tr><td><hr noshade="yes" size="1"/></td></tr>
+    </table>
+
+    <xsl:apply-templates select="build"/>
+
+    <!-- FOOTER -->
+    <table width="100%">
+      <tr><td><hr noshade="yes" size="1"/></td></tr>
+      <tr><td>
+      <div align="center"><font color="#525D76" size="-1"><em>
+      Copyright &#169; 2000-2002, Apache Software Foundation
+      </em></font></div>
+      </td></tr>
+    </table>
+  </body>
+</html>
+</xsl:template>
+
+<xsl:template match="build">
+  <!-- build status -->
+  <table width="100%">
+    <xsl:attribute name="class">
+      <xsl:if test="@error">failed</xsl:if>
+      <xsl:if test="not(@error)">complete</xsl:if>
+    </xsl:attribute>
+    <tr>
+      <xsl:if test="@error">
+        <td nowrap="yes">Build Failed</td> 
+      </xsl:if>
+      <xsl:if test="not(@error)">
+        <td nowrap="yes">Build Complete</td>
+      </xsl:if>
+        <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>
+    </tr>
+    <tr>
+      <td colspan="2">
+        <xsl:if test="@error">
+          <tt><xsl:value-of select="@error"/></tt><br/>
+          <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>
+        </xsl:if>
+      </td>
+    </tr>
+  </table>
+  <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
+    <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(message[contains(text(),'ant.file')], '->')"/></td></tr>
+    <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(message[contains(text(),'ant.version')], '->')"/></td></tr>
+    <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(message[contains(text(),'java.vm.version')], '->')"/></td></tr>
+    <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(message[contains(text(),'os.name')], '->')"/></td></tr>
+  </table>
+  <!-- build information -->
+  <h3>Build events</h3>
+  <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
+  <tr>
+    <th nowrap="yes" align="left" width="1%">target</th>
+    <th nowrap="yes" align="left" width="1%">task</th>
+    <th nowrap="yes" align="left">message</th>
+  </tr>
+  <xsl:apply-templates select=".//message[@priority != 'debug']"/>
+  </table>
+  <p>
+  <!-- stacktrace -->
+  <xsl:if test="stacktrace">
+  <a name="stacktrace"/>
+  <h3>Error details</h3>
+  <table width="100%">
+    <tr><td>
+      <pre><xsl:value-of select="stacktrace"/></pre>
+    </td></tr>
+  </table>
+  </xsl:if>
+  </p>
+</xsl:template>
+
+<!-- report every message but those with debug priority -->
+<xsl:template match="message[@priority!='debug']">
+  <tr valign="top">
+    <!-- alternated row style -->
+    <xsl:attribute name="class">
+      <xsl:if test="position() mod 2 = 1">a</xsl:if>
+      <xsl:if test="position() mod 2 = 0">b</xsl:if>
+    </xsl:attribute>
+    <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>
+    <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>
+    <td class="{@priority}" nowrap="yes">
+            <xsl:value-of select="text()"/>
+    </td>
+  </tr>
+</xsl:template>
+
+</xsl:stylesheet>

Added: labs/jbossforums/branches/forums120P26/tools/etc/maudit-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/maudit-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/maudit-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,547 @@
+<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	xmlns:lxslt="http://xml.apache.org/xslt"
+	xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+	extension-element-prefixes="redirect">
+<xsl:output	method="html" indent="yes" encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+<!--
+
+    Stylesheet to transform an XML file generated by the Ant MAudit task into
+    a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
+    
+    It use the Xalan redirect extension to write to multiple output files.
+
+    @author Stephane Bailliez <a href="mailto:sbailliez at apache.org"/>
+-->
+
+<xsl:param name="output.dir" select="'.'"/>
+
+
+<xsl:template match="classes">
+	<!-- create the index.html -->
+	<redirect:write file="{$output.dir}/index.html">
+		<xsl:call-template name="index.html"/>
+	</redirect:write>
+
+	<!-- create the stylesheet.css -->
+	<redirect:write file="{$output.dir}/stylesheet.css">
+		<xsl:call-template name="stylesheet.css"/>
+	</redirect:write>
+
+	<!-- create the overview-packages.html at the root -->
+	<redirect:write file="{$output.dir}/overview-summary.html">
+		<xsl:apply-templates select="." mode="overview.packages"/>
+	</redirect:write>
+
+	<!-- create the all-packages.html at the root -->
+	<redirect:write file="{$output.dir}/overview-frame.html">
+		<xsl:apply-templates select="." mode="all.packages"/>
+	</redirect:write>
+	
+	<!-- create the all-classes.html at the root -->
+	<redirect:write file="{$output.dir}/allclasses-frame.html">
+		<xsl:apply-templates select="." mode="all.classes"/>
+	</redirect:write>
+	
+	<!-- process all packages -->
+	<xsl:for-each select="./class[not(./@package = preceding-sibling::class/@package)]">
+		<xsl:call-template name="package">
+			<xsl:with-param name="name" select="@package"/>
+		</xsl:call-template>
+	</xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="package">
+	<xsl:param name="name"/>
+	<xsl:variable name="package.dir">
+		<xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
+		<xsl:if test="$name = ''">.</xsl:if>
+	</xsl:variable>	
+	<!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
+	<!-- create a classes-list.html in the package directory -->
+	<redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
+		<xsl:call-template name="classes.list">
+			<xsl:with-param name="name" select="$name"/>
+		</xsl:call-template>
+	</redirect:write>
+	
+	<!-- create a package-summary.html in the package directory -->
+	<redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
+		<xsl:call-template name="package.summary">
+			<xsl:with-param name="name" select="$name"/>
+		</xsl:call-template>
+	</redirect:write>
+	
+	<!-- for each class, creates a @name.html -->
+	<!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
+	<xsl:for-each select="/classes/class[@package = $name]">
+		<redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
+			<xsl:apply-templates select="." mode="class.details"/>
+		</redirect:write>
+	</xsl:for-each>
+</xsl:template>
+
+<xsl:template name="index.html">
+<HTML>
+	<HEAD><TITLE>Audit Results.</TITLE></HEAD>
+	<FRAMESET cols="20%,80%">
+		<FRAMESET rows="30%,70%">
+			<FRAME src="overview-frame.html" name="packageListFrame"/>
+			<FRAME src="allclasses-frame.html" name="classListFrame"/>
+		</FRAMESET>
+		<FRAME src="overview-summary.html" name="classFrame"/>
+	</FRAMESET>
+	<noframes>
+		<H2>Frame Alert</H2>
+		<P>
+		This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+		</P>
+	</noframes>
+</HTML>
+</xsl:template>
+
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin-left: 10;
+      margin-right: 10;
+      font:normal 80% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    .a td { 
+      background: #efefef;
+    }
+    .b td { 
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      font-weight:bold;
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      font-size:100%;
+      border: none
+    }
+    table.log tr td, tr th {
+      
+    }
+    h2 {
+      font-weight:bold;
+      font-size:140%;
+      margin-bottom: 5;
+    }
+    h3 {
+      font-size:100%;
+      font-weight:bold;
+      background: #525D76;
+      color: white;
+      text-decoration: none;
+      padding: 5px;
+      margin-right: 2px;
+      margin-left: 2px;
+      margin-bottom: 0;
+    }
+</xsl:template>
+
+
+<!-- print the violations of the class -->
+<xsl:template match="class" mode="class.details">
+	<xsl:variable name="package.name" select="@package"/>
+	<HTML>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="$package.name"/>
+			</xsl:call-template>
+		</HEAD>
+		<BODY>
+			<xsl:call-template name="pageHeader"/>
+			<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>
+
+			<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:call-template name="class.audit.header"/>
+				<xsl:apply-templates select="." mode="print.audit"/>
+			</table>
+	
+			<H3>Violations</H3>
+			<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:call-template name="violation.audit.header"/>
+				<xsl:apply-templates select="./violation" mode="print.audit">
+					<xsl:sort data-type="number" select="@line"/>
+				</xsl:apply-templates>
+			</table>
+			<xsl:call-template name="pageFooter"/>
+		</BODY>
+	</HTML>
+</xsl:template>
+
+
+<!-- list of classes in a package -->
+<xsl:template name="classes.list">
+	<xsl:param name="name"/>
+	<HTML>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="$name"/>
+			</xsl:call-template>
+		</HEAD>
+		<BODY>
+			<table width="100%">
+				<tr>
+					<td nowrap="nowrap">
+						<H2><a href="package-summary.html" target="classFrame"><xsl:value-of select="$name"/></a></H2>
+					</td>
+				</tr>
+			</table>
+	
+			<h2>Classes</h2>
+			<TABLE WIDTH="100%">
+				<xsl:apply-templates select="/classes/class[./@package = $name]" mode="classes.list">
+					<xsl:sort select="@name"/>
+				</xsl:apply-templates>
+			</TABLE>
+		</BODY>
+	</HTML>
+</xsl:template>
+<!-- the class to list -->
+<xsl:template match="class" mode="classes.list">
+	<tr>
+		<td nowrap="nowrap">
+			<!-- @bug naming to fix for inner classes -->
+			<a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+		</td>
+	</tr>
+</xsl:template>
+
+
+<!--
+	Creates an all-classes.html file that contains a link to all package-summary.html
+	on each class.
+-->
+<xsl:template match="classes" mode="all.classes">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name"/>
+			</xsl:call-template>
+		</head>
+		<body>
+			<h2>Classes</h2>
+			<table width="100%">
+				<xsl:apply-templates select=".//class" mode="all.classes">
+					<xsl:sort select="@name"/>
+				</xsl:apply-templates>
+			</table>
+		</body>
+	</html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.classes">
+    <!-- (ancestor::package)[last()] is buggy in MSXML3 ? -->
+    <xsl:variable name="package.name" select="@package"/>
+	<tr>
+		<td nowrap="nowrap">
+			<a target="classFrame">
+				<xsl:attribute name="href">
+					<xsl:if test="not($package.name='')">
+						<xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+					</xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
+				</xsl:attribute>
+				<xsl:value-of select="@name"/>
+			</a>
+		</td>
+	</tr>
+</xsl:template>
+
+
+<!--
+	Creates an html file that contains a link to all package-summary.html files on
+	each package existing on testsuites.
+	@bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="classes" mode="all.packages">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name"/>
+			</xsl:call-template>
+		</head>
+		<body>
+			<h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
+			<h2>Packages</h2>
+				<table width="100%">
+					<xsl:apply-templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages">
+						<xsl:sort select="@package" order="ascending"/>
+					</xsl:apply-templates>
+				</table>
+		</body>
+	</html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.packages">
+	<tr>
+		<td nowrap="nowrap">
+			<a href="{translate(@package,'.','/')}/package-summary.html" target="classFrame">
+				<xsl:value-of select="@package"/>
+			</a>
+		</td>
+	</tr>
+</xsl:template>
+
+
+<xsl:template match="classes" mode="overview.packages">
+	<html>
+		<head>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name"/>
+			</xsl:call-template>
+		</head>
+		<body onload="open('allclasses-frame.html','classListFrame')">
+		<xsl:call-template name="pageHeader"/>
+		<h3>Summary</h3>
+		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+		<tr>
+			<th>Audited classes</th>
+			<th>Reported classes</th>
+			<th>Violations</th>
+		</tr>
+		<tr class="a">
+			<td><xsl:value-of select="@audited"/></td>
+			<td><xsl:value-of select="@reported"/></td>
+			<td><xsl:value-of select="@violations"/></td>
+		</tr>
+		</table>
+		<table border="0" width="100%">
+		<tr>
+		<td	style="text-align: justify;">
+		Note: Rules checked have originated from style guidelines suggested by the language designers,
+		experience from the Java development community and insite experience. Violations are generally
+		reported with a reference to the <a href="http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html">Java Language Specifications</a> (JLS x.x.x)
+		and Metamata Audit rules (x.x).
+		Please consult these documents for additional information about violations.
+		<p/>
+		Rules checked also enforce adherence to <a href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun Java coding guidelines</a> in use at Jakarta.
+		<p/>
+		One should note that these violations do not necessary underline errors but should be used
+		as an indication for <i>possible</i> errors. As always, use your best judgment and review
+		them carefully, it might save you hours of debugging.
+		</td>
+		</tr>
+		</table>
+
+		<h3>Packages</h3>
+		<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+			<xsl:call-template name="class.audit.header"/>
+			<xsl:for-each select="class[not(./@package = preceding-sibling::class/@package)]">
+				<xsl:sort select="@package" order="ascending"/>
+				<tr>
+          <xsl:call-template name="alternate-row"/>
+					<td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td>
+					<td><xsl:value-of select="sum(/classes/class[./@package = current()/@package]/@violations)"/></td>
+				</tr>
+			</xsl:for-each>
+		</table>
+		<xsl:call-template name="pageFooter"/>
+		</body>
+		</html>
+</xsl:template>
+
+
+<xsl:template name="package.summary">
+	<xsl:param name="name"/>
+	<HTML>
+		<HEAD>
+			<xsl:call-template name="create.stylesheet.link">
+				<xsl:with-param name="package.name" select="$name"/>
+			</xsl:call-template>
+		</HEAD>
+		<BODY>
+			<xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
+			<xsl:call-template name="pageHeader"/>
+			<h3>Package <xsl:value-of select="$name"/></h3>
+			
+			<!--table border="0" cellpadding="5" cellspacing="2" width="100%">
+				<xsl:call-template name="class.metrics.header"/>
+				<xsl:apply-templates select="." mode="print.metrics"/>
+			</table-->
+			
+			<xsl:if test="count(/classes/class[./@package = $name]) &gt; 0">
+				<H3>Classes</H3>
+				<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+					<xsl:call-template name="class.audit.header"/>
+					<xsl:apply-templates select="/classes/class[./@package = $name]" mode="print.audit">
+						<xsl:sort select="@name"/>
+					</xsl:apply-templates>
+				</table>
+			</xsl:if>
+			<xsl:call-template name="pageFooter"/>
+		</BODY>
+	</HTML>
+</xsl:template>
+
+
+<!--
+    transform string like a.b.c to ../../../
+    @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+	<xsl:param name="path"/>
+	<xsl:if test="contains($path,'.')">
+		<xsl:text>../</xsl:text>	
+		<xsl:call-template name="path">
+			<xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
+		</xsl:call-template>	
+	</xsl:if>
+	<xsl:if test="not(contains($path,'.')) and not($path = '')">
+		<xsl:text>../</xsl:text>	
+	</xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+	<xsl:param name="package.name"/>
+	<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+
+  <!-- jakarta logo -->
+  <table border="0" cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+    <td class="bannercell" rowspan="2">
+      <a href="http://jakarta.apache.org/">
+      <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+      </a>
+    </td>
+		<td style="text-align:right"><h2>Source Code Audit</h2></td>
+		</tr>
+		<tr>
+		<td style="text-align:right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+		</tr>
+  </table>
+	<hr size="1"/>
+</xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageFooter">
+    <table width="100%">
+      <tr><td><hr noshade="yes" size="1"/></td></tr>
+      <tr><td>
+      <div align="center"><font color="#525D76" size="-1"><em>
+      Copyright &#169; 1999-2001, Apache Software Foundation
+      </em></font></div>
+      </td></tr>
+    </table>
+</xsl:template>
+
+
+<!-- class header -->
+<xsl:template name="class.audit.header">
+	<tr>
+		<th width="80%">Name</th>
+		<th>Violations</th>
+	</tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="violation.audit.header">
+	<tr>
+		<th>Line</th>
+		<th>Message</th>
+	</tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="class" mode="print.audit">
+	<tr>
+    <xsl:call-template name="alternate-row"/>
+		<td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
+		<td><xsl:apply-templates select="@violations"/></td>
+	</tr>
+</xsl:template>
+
+<xsl:template match="violation" mode="print.audit">
+	<tr>
+    <xsl:call-template name="alternate-row"/>
+		<td><xsl:value-of select="@line"/></td>
+		<td><xsl:apply-templates select="@message"/></td>
+	</tr>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+  <xsl:if test="position() mod 2 = 1">a</xsl:if>
+  <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+</xsl:stylesheet>
+	

Added: labs/jbossforums/branches/forums120P26/tools/etc/mmetrics-frames.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/mmetrics-frames.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/mmetrics-frames.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,1070 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:lxslt="http://xml.apache.org/xslt"
+  xmlns:xalan="http://xml.apache.org/xalan"
+  xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+  exclude-result-prefixes="xalan"
+  extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+    any, must include the following acknowlegement:
+       "This product includes software developed by the
+        Apache Software Foundation (http://www.apache.org/)."
+    Alternately, this acknowlegement may appear in the software itself,
+    if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache Software
+    Foundation" must not be used to endorse or promote products derived
+    from this software without prior written permission. For written
+    permission, please contact apache at apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+    nor may "Apache" appear in their names without prior written
+    permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation.  For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+<!--
+  @author Stephane Bailliez <a href="mailto:sbailliez at apache.org"/>
+  --> 
+<xsl:param name="output.dir" select="'.'"/>
+
+<!-- default max value for the metrics -->
+<xsl:param name="vg.max" select="10"/>
+<xsl:param name="loc.max" select="1000"/>
+<xsl:param name="dit.max" select="10"/>
+<xsl:param name="noa.max" select="250"/>
+<xsl:param name="nrm.max" select="50"/>
+<xsl:param name="nlm.max" select="250"/>
+<xsl:param name="wmc.max" select="250"/>
+<xsl:param name="rfc.max" select="50"/>
+<xsl:param name="dac.max" select="10"/>
+<xsl:param name="fanout.max" select="10"/>
+<xsl:param name="cbo.max" select="15"/>
+<xsl:param name="lcom.max" select="10"/>
+<xsl:param name="nocl.max" select="10"/>
+
+
+<!-- create a tree fragment to speed up processing -->
+<xsl:variable name="doctree.var">
+  <xsl:element name="classes">
+    <xsl:for-each select=".//class">
+      <xsl:element name="class">
+        <xsl:attribute name="package">
+          <xsl:value-of select="(ancestor::package)[last()]/@name"/>
+        </xsl:attribute>
+        <xsl:copy-of select="@*"/>
+        <xsl:attribute name="name">
+          <xsl:apply-templates select="." mode="class.name"/>
+        </xsl:attribute>
+        <xsl:copy-of select="method"/>
+      </xsl:element>
+    </xsl:for-each>
+  </xsl:element>
+</xsl:variable>
+
+<xsl:variable name="doctree" select="xalan:nodeset($doctree.var)"/>
+
+<xsl:template match="metrics">
+
+  <!-- create the index.html -->
+  <redirect:write file="{$output.dir}/index.html">
+    <xsl:call-template name="index.html"/>
+  </redirect:write>
+
+  <!-- create the stylesheet.css -->
+  <redirect:write file="{$output.dir}/stylesheet.css">
+    <xsl:call-template name="stylesheet.css"/>
+  </redirect:write>
+
+  <redirect:write file="{$output.dir}/metrics-reference.html">
+    <xsl:call-template name="metrics-reference.html"/>
+  </redirect:write>
+  
+  <!-- create the overview-packages.html at the root -->
+  <redirect:write file="{$output.dir}/overview-summary.html">
+    <xsl:apply-templates select="." mode="overview.packages"/>
+  </redirect:write>
+
+  <!-- create the all-packages.html at the root -->
+  <redirect:write file="{$output.dir}/overview-frame.html">
+    <xsl:apply-templates select="." mode="all.packages"/>
+  </redirect:write>
+  
+  <!-- create the all-classes.html at the root -->
+  <redirect:write file="{$output.dir}/allclasses-frame.html">
+    <xsl:apply-templates select="." mode="all.classes"/>
+  </redirect:write>
+  
+  <!-- process all packages -->
+  <xsl:apply-templates select=".//package"/>
+</xsl:template>
+
+
+<xsl:template match="package">
+  <xsl:variable name="package.name" select="@name"/>
+  <xsl:variable name="package.dir">
+    <xsl:if test="not($package.name = 'unnamed package')"><xsl:value-of select="translate($package.name,'.','/')"/></xsl:if>
+    <xsl:if test="$package.name = 'unnamed package'">.</xsl:if>
+  </xsl:variable> 
+  <!-- create a classes-list.html in the package directory -->
+  <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
+    <xsl:apply-templates select="." mode="classes.list"/>
+  </redirect:write>
+  
+  <!-- create a package-summary.html in the package directory -->
+  <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
+    <xsl:apply-templates select="." mode="package.summary"/>
+  </redirect:write>
+  
+  <!-- for each class, creates a @name.html -->
+  <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
+  <xsl:for-each select="$doctree/classes/class[@package = current()/@name]">
+      <!--Processing <xsl:value-of select="$class.name"/><xsl:text>&#10;</xsl:text> -->
+    <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
+      <xsl:apply-templates select="." mode="class.details"/>
+    </redirect:write>
+  </xsl:for-each>
+</xsl:template>
+
+<!-- little trick to compute the classname for inner and non inner classes -->
+<!-- this is all in one line to avoid CRLF in the name -->
+<xsl:template match="class" mode="class.name">
+    <xsl:if test="parent::class"><xsl:apply-templates select="parent::class" mode="class.name"/>.<xsl:value-of select="@name"/></xsl:if><xsl:if test="not(parent::class)"><xsl:value-of select="@name"/></xsl:if>
+</xsl:template>
+
+
+<xsl:template name="index.html">
+<HTML>
+  <HEAD><TITLE>Metrics Results.</TITLE></HEAD>
+  <FRAMESET cols="20%,80%">
+    <FRAMESET rows="30%,70%">
+      <FRAME src="overview-frame.html" name="packageListFrame"/>
+      <FRAME src="allclasses-frame.html" name="classListFrame"/>
+    </FRAMESET>
+    <FRAME src="overview-summary.html" name="classFrame"/>
+  </FRAMESET>
+  <noframes>
+    <H2>Frame Alert</H2>
+    <P>
+    This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+    </P>
+  </noframes>
+</HTML>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="metrics-reference.html">
+<html>
+<head>
+<link title="Style" type="text/css" rel="stylesheet" href="stylesheet.css"/>
+</head>
+<body style="text-align:justify;">
+<h2>Metrics Reference</h2>
+<a href="#V(G)">V(G)</a> |
+<a href="#LOC">LOC</a> |
+<a href="#DIT">DIT</a> |
+<a href="#NOA">NOA</a> |
+<a href="#NRM">NRM</a> |
+<a href="#NLM">NLM</a> |
+<a href="#WMC">WMC</a> |
+<a href="#RFC">RFC</a> |
+<a href="#DAC">DAC</a> |
+<a href="#FANOUT">FANOUT</a> |
+<a href="#CBO">CBO</a> |
+<a href="#LCOM">LCOM</a> |
+<a href="#NOC">NOC</a>
+
+<a name="V(G)"/>
+<h3>Cyclomatic Complexity - V(G)</h3>
+This metric was introduced in the 1970s to measure the amount of control
+flow complexity or branching complexity in a module such as a
+subroutine. It gives the number of paths that may be taken through the
+code, and was initially developed to give some measure of the cost of
+producing a test case for the module by executing each path.
+<p/>
+Methods with a high cyclomatic complexity tend to be more difficult to
+understand and maintain. In general the more complex the methods of an
+application, the more difficult it will be to test it, and this will adversely
+affect its reliability.
+<p/>
+V(G) is a measure of the control flow complexity of a method or
+constructor.  It counts the number of branches in the body of the method,
+defined as:
+<ul>
+<li>while statements;</li>
+<li>if statements;</li>
+<li>for statements.</li>
+</ul>
+
+The metric can also be configured to count each case of a switch
+statement as well.
+
+<a name="LOC"/>
+<h3>Lines of Code - LOC</h3>
+
+This is perhaps the simplest of all the metrics to define and compute.
+Counting lines has a long history as a software metric dating from before
+the rise of structured programming, and it is still in widespread use today.
+The size of a method affects the ease with which it can be understood, its
+reusability and its maintainability. There are a variety of ways that the size
+can be calculated. These include counting all the lines of code, the number
+of statements, the blank lines of code, the lines of commentary, and the
+lines consisting only of syntax such as block delimiters.
+<p/>
+This metric can also be used for sizing other constructs as well, for
+example, the overall size of a Java class or package can be measured by
+counting the number of source lines it consists of.
+<p/>
+LOC can be used to determine the size of a compilation unit (source file),
+class or interface, method, constructor, or field.  It can be configured to
+ignore:
+<ul>
+<li>blank lines;</li>
+<li>lines consisting only of comments;</li>
+<li>lines consisting only of opening and closing braces.</li>
+</ul>
+
+<a name="DIT"/>
+<h3>Depth of Inheritance Hierarchy - DIT</h3>
+
+This metric calculates how far down the inheritance hierarchy a class is
+declared. In Java all classes have java.lang.Object as their ultimate
+superclass, which is defined to have a depth of 1. So a class that
+immediately extends java.lang.Object has a metric value of 2; any of its
+subclasses will have a value of 3, and so on.
+<p/>
+A class that is deep within the tree inherits more methods and state
+variables, thereby increasing its complexity and making it difficult to
+predict its behavior. It can be harder to understand a system with many
+inheritance layers.
+<p/>
+DIT is defined for classes and interfaces:
+<ul>
+<li>all interface types have a depth of 1;</li>
+<li>the class java.lang.Object has a depth of 1;</li>
+<li>all other classes have a depth of 1 + the depth of their super class.</li>
+</ul>
+
+<a name="NOA"/>
+<h3>Number of Attributes - NOA</h3>
+
+The number of distinct state variables in a class serves as one measure of
+its complexity. The more state a class represents the more difficult it is to
+maintain invariants for it. It also hinders comprehensibility and reuse.
+<p/>
+In Java, state can be exposed to subclasses through protected fields, which
+entails that the subclass also be aware of and maintain any invariants. This
+interference with the class's data encapsulation can be a source of defects
+and hidden dependencies between the state variables.
+<p/>
+NOA is defined for classes and interfaces.  It counts the number of fields
+declared in the class or interface.
+
+<a name="NRM"/>
+<h3>Number of Remote Methods - NRM</h3>
+
+NRM is defined for classes.  A remote method call is defined as an
+invocation of a method that is not declared in any of:
+<ul>
+<li>the class itself;</li>
+<li>a class or interface that the class extends or implements;</li>
+<li>a class or method that extends the class.</li>
+</ul>
+
+The value is the count of all the remote method calls in all of the methods
+and constructors of the class.
+
+<a name="NLM"/>
+<h3>Number of Local Methods - NLM</h3>
+
+NLM is defined for classes and interfaces.  A local method is defined as a
+method that is declared in the class or interface. NLM can be configured to
+include the local methods of all of the class's superclasses.  Methods with
+public, protected, package and private visibility can be independently
+counted by setting configuration parameters.
+
+<a name="WMC"/>
+<h3>Weighted Methods per Class - WMC</h3>
+
+If the number of methods in a class can be determined during the design
+and modeling phase of a project, it can be used as a predictor of how
+much time and effort is needed to develop, debug and maintain it. This
+metric can be further refined by incorporating a weighting for the
+complexity of each method. The usual weighting is given by the cyclomatic
+complexity of the method.
+<p/>
+The subclasses of a class inherit all of its public and protected methods,
+and possibly its package methods as well, so the number of methods a
+class has directly impacts the complexity of its subclasses. Classes with
+large numbers of methods are often specific to a particular application,
+reducing the ability to reuse them.
+<p/>
+The definition of WMC is based upon NLM, and it provides the same
+configuration parameters for counting inherited methods and of varying
+visibility. The main difference is that NLM always counts each method as 1,
+whereas WMC will weight each method. There are two weighting schemes:
+<ul>
+<li>V(G) the cyclomatic complexity of the method is used as its weight.
+   Methods from class files are given a V(G) of 1.</li>
+<li>the arity, or the number of parameters of the method are used to
+   determine the weight.</li>
+</ul>
+
+<a name="RFC"/>
+<h3>Response For Class - RFC</h3>
+
+The response set of a class is the set of all methods that can be invoked as
+a result of a message sent to an object of the class. This includes methods
+in the class's inheritance hierarchy and methods that can be invoked on
+other objects. The Response For Class metric is defined to be size of the
+response set for the class. A class which provides a larger response set is
+considered to be more complex than one with a smaller response set.
+<p/>
+One reason for this is that if a method call on a class can result in a large
+number of different method calls on the target and other classes, then it
+can be harder to test the behavior of the class and debug problems. It will
+typically require a deeper understanding of the potential interactions that
+objects of the class can have with the rest of the system.
+<p/>
+RFC is defined as the sum of NLM and NRM for the class.  The local methods
+include all of the public, protected, package and private methods, but not
+methods declared only in a superclass.
+
+<a name="DAC"/>
+<h3>Data Abstraction Coupling - DAC</h3>
+
+DAC is defined for classes and interfaces.  It counts the number of reference
+types that are used in the field declarations of the class or interface.  The
+component types of arrays are also counted.  Any field with a type that is
+either a supertype or a subtype of the class is not counted.
+
+<a name="FANOUT"/>
+<h3>Fan Out - FANOUT</h3>
+
+FANOUT is defined for classes and interfaces, constructors and methods. It
+counts the number of reference types that are used in:
+<ul>
+<li>field declarations;</li>
+<li>formal parameters and return types;</li>
+<li>throws declarations;</li>
+<li>local variables.</li>
+</ul>
+
+The component types of arrays are also counted. Any type that is either a
+supertype or a subtype of the class is not counted.
+
+<a name="CBO"/>
+<h3>Coupling Between Objects - CBO</h3>
+
+When one object or class uses another object or class they are said to be
+coupled. One major source of coupling is that between a superclass and a
+subclass. A coupling is also introduced when a method or field in another
+class is accessed, or when an object of another class is passed into or out
+of a method invocation. Coupling Between Objects is a measure of the
+non-inheritance coupling between two objects.
+<p/>
+A high value of coupling reduces the modularity of the class and makes
+reuse more difficult. The more independent a class is the more likely it is
+that it will be possible to reuse it in another part of the system. When a
+class is coupled to another class it becomes sensitive to changes in that
+class, thereby making maintenance for difficult. In addition, a class that is
+overly dependent on other classes can be difficult to understand and test in
+isolation.
+<p/>
+CBO is defined for classes and interfaces, constructors and methods. It
+counts the number of reference types that are used in:
+<ul>
+<li>field declarations</li>
+<li>formal parameters and return types</li>
+<li>throws declarations</li>
+<li>local variables</li>
+</ul>
+
+It also counts:
+<ul>
+<li>types from which field and method selections are made</li>
+</ul>
+
+The component types of arrays are also counted. Any type that is either a
+supertype or a subtype of the class is not counted.
+
+<a name="LCOM"/>
+<h3>Lack of Cohesion Of Methods - LCOM</h3>
+
+The cohesion of a class is the degree to which its methods are related to
+each other. It is determined by examining the pattern of state variable
+accesses within the set of methods. If all the methods access the same state
+variables then they have high cohesion; if they access disjoint sets of
+variables then the cohesion is low. An extreme example of low cohesion
+would be if none of the methods accessed any of the state variables.
+
+If a class exhibits low method cohesion it indicates that the design of the
+class has probably been partitioned incorrectly, and could benefit by being
+split into more classes with individually higher cohesion. On the other
+hand, a high value of cohesion (a low lack of cohesion) implies that the
+class is well designed. A cohesive class will tend to provide a high degree
+of encapsulation, whereas a lack of cohesion decreases encapsulation and
+increases complexity.
+<p/>
+Another form of cohesion that is useful for Java programs is cohesion
+between nested and enclosing classes. A nested class that has very low
+cohesion with its enclosing class would probably better designed as a peer
+class rather than a nested class.
+<p/>
+LCOM is defined for classes. Operationally, LCOM takes each pair of
+methods in the class and determines the set of fields they each access. If
+they have disjoint sets of field accesses increase the count P by one. If they
+share at least one field access then increase Q by one. After considering
+each pair of methods,
+LCOM = (P > Q) ? (P - Q) : 0
+<p/>
+Indirect access to fields via local methods can be considered by setting a
+metric configuration parameter.
+
+<a name="NOC"/>
+<h3>Number Of Classes - NOC</h3>
+
+The overall size of the system can be estimated by calculating the number
+of classes it contains. A large system with more classes is more complex
+than a smaller one because the number of potential interactions between
+objects is higher. This reduces the comprehensibility of the system which
+in turn makes it harder to test, debug and maintain.
+<p/>
+If the number of classes in the system can be projected during the initial
+design phase of the project it can serve as a base for estimating the total
+effort and cost of developing, debugging and maintaining the system.
+<p/>
+The NOC metric can also usefully be applied at the package and class level
+as well as the total system.
+<p/>
+NOCL is defined for class and interfaces. It counts the number of classes or
+interfaces that are declared. This is usually 1, but nested class declarations
+will increase this number.
+</body>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin-left: 10;
+      margin-right: 10;
+      font:normal 80% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    .a td { 
+      background: #efefef;
+    }
+    .b td { 
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      font-weight:bold;
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      font-size:100%;
+      border: none
+    }
+    table.log tr td, tr th {
+      
+    }
+    h2 {
+      font-weight:bold;
+      font-size:140%;
+      margin-bottom: 5;
+    }
+    h3 {
+      font-size:100%;
+      font-weight:bold;
+      background: #525D76;
+      color: white;
+      text-decoration: none;
+      padding: 5px;
+      margin-right: 2px;
+      margin-left: 2px;
+      margin-bottom: 0;
+    }
+    .Error {
+      font-weight:bold; color:red;
+    }
+
+</xsl:template>
+
+<!-- print the metrics of the class -->
+<xsl:template match="class" mode="class.details">
+  <!--xsl:variable name="package.name" select="(ancestor::package)[last()]/@name"/-->
+  <xsl:variable name="package.name" select="@package"/>
+  <HTML>
+    <HEAD>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="$package.name"/>
+      </xsl:call-template>
+    </HEAD>
+    <BODY>
+      <xsl:call-template name="pageHeader"/>
+      
+      <H3>Class <xsl:if test="not($package.name = 'unnamed package')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>
+      <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+        <xsl:call-template name="all.metrics.header"/>
+        <xsl:apply-templates select="." mode="print.metrics"/>
+      </table>
+  
+      <H3>Methods</H3>
+      <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+        <xsl:call-template name="method.metrics.header"/>
+        <xsl:apply-templates select="method" mode="print.metrics"/>
+      </table>
+      
+      <xsl:call-template name="pageFooter"/>
+    </BODY>
+  </HTML>
+</xsl:template>
+
+
+<!-- list of classes in a package -->
+<xsl:template match="package" mode="classes.list">
+  <HTML>
+    <HEAD>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="@name"/>
+      </xsl:call-template>
+    </HEAD>
+    <BODY>
+      <table width="100%">
+        <tr>
+          <td nowrap="nowrap">
+            <H2><a href="package-summary.html" target="classFrame"><xsl:value-of select="@name"/></a></H2>
+          </td>
+        </tr>
+      </table>
+  
+      <H2>Classes</H2>
+      <TABLE WIDTH="100%">
+        <!-- xalan-nodeset:nodeset for Xalan 1.2.2 -->
+            <xsl:for-each select="$doctree/classes/class[@package = current()/@name]">
+                <xsl:sort select="@name"/>
+          <tr>
+            <td nowrap="nowrap">
+              <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+            </td>
+          </tr>               
+            </xsl:for-each>
+      </TABLE>
+    </BODY>
+  </HTML>
+</xsl:template>
+
+
+<!--
+  Creates an all-classes.html file that contains a link to all package-summary.html
+  on each class.
+-->
+<xsl:template match="metrics" mode="all.classes">
+  <html>
+    <head>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="''"/>
+      </xsl:call-template>
+    </head>
+    <body>
+      <h2>Classes</h2>
+      <table width="100%">
+          <xsl:for-each select="$doctree/classes/class">
+              <xsl:sort select="@name"/>
+              <xsl:apply-templates select="." mode="all.classes"/>
+          </xsl:for-each>
+      </table>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.classes">
+    <xsl:variable name="package.name" select="@package"/>
+    <xsl:variable name="class.name" select="@name"/>
+  <tr>
+    <td nowrap="nowrap">
+      <a target="classFrame">
+        <xsl:attribute name="href">
+          <xsl:if test="not($package.name='unnamed package')">
+            <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+          </xsl:if>
+          <xsl:value-of select="$class.name"/><xsl:text>.html</xsl:text>
+        </xsl:attribute>
+        <xsl:value-of select="$class.name"/>
+      </a>
+    </td>
+  </tr>
+</xsl:template>
+
+<!--
+  Creates an html file that contains a link to all package-summary.html files on
+  each package existing on testsuites.
+  @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+-->
+<xsl:template match="metrics" mode="all.packages">
+  <html>
+    <head>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="./package/@name"/>
+      </xsl:call-template>
+    </head>
+    <body>
+      <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
+      <h2>Packages</h2>
+        <table width="100%">
+          <xsl:apply-templates select=".//package[not(./@name = 'unnamed package')]" mode="all.packages">
+            <xsl:sort select="@name"/>
+          </xsl:apply-templates>
+        </table>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="package" mode="all.packages">
+  <tr>
+    <td nowrap="nowrap">
+      <a href="{translate(@name,'.','/')}/package-summary.html" target="classFrame">
+        <xsl:value-of select="@name"/>
+      </a>
+    </td>
+  </tr>
+</xsl:template>
+
+
+<xsl:template match="metrics" mode="overview.packages">
+  <html>
+    <head>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="''"/>
+      </xsl:call-template>
+    </head>
+    <body onload="open('allclasses-frame.html','classListFrame')">
+    <xsl:call-template name="pageHeader"/>
+    <h3>Summary</h3>
+    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+    <tr>
+      <th><a href="metrics-reference.html#V(G)">V(G)</a></th>
+      <th><a href="metrics-reference.html#LOC">LOC</a></th>
+      <th><a href="metrics-reference.html#DIT">DIT</a></th>
+      <th><a href="metrics-reference.html#NOA">NOA</a></th>
+      <th><a href="metrics-reference.html#NRM">NRM</a></th>
+      <th><a href="metrics-reference.html#NLM">NLM</a></th>
+      <th><a href="metrics-reference.html#WMC">WMC</a></th>
+      <th><a href="metrics-reference.html#RFC">RFC</a></th>
+      <th><a href="metrics-reference.html#DAC">DAC</a></th>
+      <th><a href="metrics-reference.html#FANOUT">FANOUT</a></th>
+      <th><a href="metrics-reference.html#CBO">CBO</a></th>
+      <th><a href="metrics-reference.html#LCOM">LCOM</a></th>
+      <th><a href="metrics-reference.html#NOCL">NOCL</a></th>
+    </tr>
+    <xsl:apply-templates select="." mode="print.metrics"/>
+    </table>    
+    <table border="0" width="100%">
+    <tr>
+    <td style="text-align: justify;">
+    Note: Metrics evaluate the quality of software by analyzing the program source and quantifying
+    various kind of complexity. Complexity is a common source of problems and defects in software.
+    High complexity makes it more difficult to develop, understand, maintain, extend, test and debug
+    a program.
+    <p/>
+    The primary use of metrics is to focus your attention on those parts of code that potentially are
+    complexity hot spots. Once the complex areas your program have been uncovered, you can take remedial
+    actions.
+    For additional information about metrics and their meaning, please consult
+    Metamata Metrics manual.
+    </td>
+    </tr>
+    </table>
+
+    <h3>Packages</h3>
+    <table border="0" cellpadding="5" cellspacing="2" width="100%">
+      <xsl:call-template name="all.metrics.header"/>
+      <xsl:for-each select=".//package[not(@name = 'unnamed package')]">
+        <xsl:sort select="@name" order="ascending"/>
+        <xsl:apply-templates select="." mode="print.metrics"/>
+      </xsl:for-each>
+    </table>
+    <!-- @bug there could some classes at this level (classes in unnamed package) -->
+    <xsl:call-template name="pageFooter"/>
+    </body>
+    </html>
+</xsl:template>
+
+<xsl:template match="package" mode="package.summary">
+  <HTML>
+    <HEAD>
+      <xsl:call-template name="create.stylesheet.link">
+        <xsl:with-param name="package.name" select="@name"/>
+      </xsl:call-template>
+    </HEAD>
+    <body onload="open('package-frame.html','classListFrame')">
+      <xsl:call-template name="pageHeader"/>
+      <!-- create an anchor to this package name -->
+      <h3>Package <xsl:value-of select="@name"/></h3>
+      
+      <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+        <xsl:call-template name="all.metrics.header"/>
+        <xsl:apply-templates select="." mode="print.metrics"/>
+      </table>
+      
+      <table border="0" width="100%">
+      <tr>
+      <td style="text-align: justify;">
+      Note: Metrics evaluate the quality of software by analyzing the program source and quantifying
+      various kind of complexity. Complexity is a common source of problems and defects in software.
+      High complexity makes it more difficult to develop, understand, maintain, extend, test and debug
+      a program.
+      <p/>
+      The primary use of metrics is to focus your attention on those parts of code that potentially are
+      complexity hot spots. Once the complex areas your program have been uncovered, you can take remedial
+      actions.
+      For additional information about metrics and their meaning, please consult
+      Metamata Metrics manual.
+      </td>
+      </tr>
+      </table>
+      
+      <xsl:variable name="classes-in-package" select="$doctree/classes/class[@package = current()/@name]"/>
+      <xsl:if test="count($classes-in-package) &gt; 0">
+        <H3>Classes</H3>
+        <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+          <xsl:call-template name="all.metrics.header"/>
+          <xsl:for-each select="$classes-in-package">
+                <xsl:sort select="@name"/>
+                <xsl:apply-templates select="." mode="print.metrics"/>
+          </xsl:for-each>
+        </table>
+      </xsl:if>
+      
+      <xsl:call-template name="pageFooter"/>
+    </body>
+  </HTML>
+</xsl:template>
+
+
+<!--
+    transform string like a.b.c to ../../../
+    @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+  <xsl:param name="path"/>
+  <xsl:if test="contains($path,'.')">
+    <xsl:text>../</xsl:text>  
+    <xsl:call-template name="path">
+      <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
+    </xsl:call-template>  
+  </xsl:if>
+  <xsl:if test="not(contains($path,'.')) and not($path = '')">
+    <xsl:text>../</xsl:text>  
+  </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+  <xsl:param name="package.name"/>
+  <LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+
+<!-- Page Header -->
+<xsl:template name="pageHeader">
+
+  <!-- jakarta logo -->
+  <table border="0" cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+    <td class="bannercell" rowspan="2">
+      <a href="http://jakarta.apache.org/">
+      <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+      </a>
+    </td>
+    <td style="text-align:right"><h2>Source Code Metrics</h2></td>
+    </tr>
+    <tr>
+    <td style="text-align:right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Metrics</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+    </tr>
+  </table>
+  <hr size="1"/>
+</xsl:template>
+
+<!-- Page Footer -->
+<xsl:template name="pageFooter">
+    <table width="100%">
+      <tr><td><hr noshade="yes" size="1"/></td></tr>
+      <tr><td>
+      <div align="center"><font color="#525D76" size="-1"><em>
+      Copyright &#169; 1999-2001, Apache Software Foundation
+      </em></font></div>
+      </td></tr>
+    </table>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="all.metrics.header">
+  <tr>
+    <th width="80%">Name</th>
+    <th nowrap="nowrap">V(G)</th>
+    <th>LOC</th>
+    <th>DIT</th>
+    <th>NOA</th>
+    <th>NRM</th>
+    <th>NLM</th>
+    <th>WMC</th>
+    <th>RFC</th>
+    <th>DAC</th>
+    <th>FANOUT</th>
+    <th>CBO</th>
+    <th>LCOM</th>
+    <th>NOCL</th>
+  </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="method.metrics.header">
+  <tr>
+    <th width="80%">Name</th>
+    <th nowrap="nowrap">V(G)</th>
+    <th>LOC</th>
+    <th>FANOUT</th>
+    <th>CBO</th>
+  </tr>
+</xsl:template>
+
+<!-- method information -->
+<xsl:template match="method" mode="print.metrics">
+  <tr>
+    <xsl:call-template name="alternate-row"/>
+    <td><xsl:apply-templates select="@name"/></td>
+    <td><xsl:apply-templates select="@vg"/></td>
+    <td><xsl:apply-templates select="@loc"/></td>
+    <td><xsl:apply-templates select="@fanout"/></td>
+    <td><xsl:apply-templates select="@cbo"/></td>
+  </tr>
+</xsl:template>
+
+<!-- class information -->
+<xsl:template match="class" mode="print.metrics">
+  <tr>
+    <xsl:call-template name="alternate-row"/>
+    <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
+    <td><xsl:apply-templates select="@vg"/></td>
+    <td><xsl:apply-templates select="@loc"/></td>
+    <td><xsl:apply-templates select="@dit"/></td>
+    <td><xsl:apply-templates select="@noa"/></td>
+    <td><xsl:apply-templates select="@nrm"/></td>
+    <td><xsl:apply-templates select="@nlm"/></td>
+    <td><xsl:apply-templates select="@wmc"/></td>
+    <td><xsl:apply-templates select="@rfc"/></td>
+    <td><xsl:apply-templates select="@dac"/></td>
+    <td><xsl:apply-templates select="@fanout"/></td>
+    <td><xsl:apply-templates select="@cbo"/></td>
+    <td><xsl:apply-templates select="@lcom"/></td>
+    <td><xsl:apply-templates select="@nocl"/></td>
+  </tr>
+</xsl:template>
+
+<xsl:template match="file|package" mode="print.metrics">
+  <tr>
+    <xsl:call-template name="alternate-row"/>
+    <td>
+    <a href="{translate(@name,'.','/')}/package-summary.html" target="classFrame">
+    <xsl:value-of select="@name"/>
+    </a>
+    </td>
+    <td><xsl:apply-templates select="@vg"/></td>
+    <td><xsl:apply-templates select="@loc"/></td>
+    <td><xsl:apply-templates select="@dit"/></td>
+    <td><xsl:apply-templates select="@noa"/></td>
+    <td><xsl:apply-templates select="@nrm"/></td>
+    <td><xsl:apply-templates select="@nlm"/></td>
+    <td><xsl:apply-templates select="@wmc"/></td>
+    <td><xsl:apply-templates select="@rfc"/></td>
+    <td><xsl:apply-templates select="@dac"/></td>
+    <td><xsl:apply-templates select="@fanout"/></td>
+    <td><xsl:apply-templates select="@cbo"/></td>
+    <td><xsl:apply-templates select="@lcom"/></td>
+    <td><xsl:apply-templates select="@nocl"/></td>
+  </tr>
+</xsl:template>
+
+<xsl:template match="metrics" mode="print.metrics">
+  <tr>
+    <xsl:call-template name="alternate-row"/>
+      <!-- the global metrics is the top package metrics -->
+    <td><xsl:apply-templates select="./package/@vg"/></td>
+    <td><xsl:apply-templates select="./package/@loc"/></td>
+    <td><xsl:apply-templates select="./package/@dit"/></td>
+    <td><xsl:apply-templates select="./package/@noa"/></td>
+    <td><xsl:apply-templates select="./package/@nrm"/></td>
+    <td><xsl:apply-templates select="./package/@nlm"/></td>
+    <td><xsl:apply-templates select="./package/@wmc"/></td>
+    <td><xsl:apply-templates select="./package/@rfc"/></td>
+    <td><xsl:apply-templates select="./package/@dac"/></td>
+    <td><xsl:apply-templates select="./package/@fanout"/></td>
+    <td><xsl:apply-templates select="./package/@cbo"/></td>
+    <td><xsl:apply-templates select="./package/@lcom"/></td>
+    <td><xsl:apply-templates select="./package/@nocl"/></td>
+  </tr>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+  <xsl:if test="position() mod 2 = 1">a</xsl:if>
+  <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+
+<!-- how to display the metrics with their max value -->
+<!-- @todo the max values must be external to the xsl -->
+
+  <xsl:template match="@vg">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$vg.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@loc">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$loc.max"/>
+    </xsl:call-template>
+  </xsl:template>
+  
+  <xsl:template match="@dit">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$dit.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@noa">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$noa.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@nrm">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$nrm.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@nlm">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$nlm.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@wmc">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$wmc.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@rfc">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$rfc.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@dac">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$dac.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@fanout">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$fanout.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@cbo">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$cbo.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@lcom">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$lcom.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="@nocl">
+    <xsl:call-template name="display-value">
+      <xsl:with-param name="value" select="current()"/>
+      <xsl:with-param name="max" select="$nocl.max"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="display-value">
+    <xsl:param name="value"/>
+    <xsl:param name="max"/>
+    <xsl:if test="$value > $max">
+      <xsl:attribute name="class">Error</xsl:attribute>
+    </xsl:if>
+    <xsl:value-of select="$value"/>
+  </xsl:template>
+
+</xsl:stylesheet>
+  

Added: labs/jbossforums/branches/forums120P26/tools/etc/tagdiff.xsl
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/etc/tagdiff.xsl	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/etc/tagdiff.xsl	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,162 @@
+<!-- a stylesheet to display changelogs ala netbeans -->
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:param name="title"/>
+  <xsl:param name="module"/>
+  <xsl:param name="cvsweb"/>
+
+  <xsl:output method="html" indent="yes"/>
+
+  <!-- Copy standard document elements.  Elements that
+       should be ignored must be filtered by apply-templates
+       tags. -->
+  <xsl:template match="*">
+    <xsl:copy>
+      <xsl:copy-of select="attribute::*[. != '']"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="tagdiff">
+    <HTML>
+      <HEAD>
+        <TITLE><xsl:value-of select="$title"/></TITLE>
+      </HEAD>
+      <BODY link="#000000" alink="#000000" vlink="#000000" text="#000000">
+        <style type="text/css">
+          body, p {
+          font-family: verdana,arial,helvetica;
+          font-size: 80%;
+          color:#000000;
+          }
+	  .dateAndAuthor {
+          font-family: verdana,arial,helvetica;
+          font-size: 80%;
+          font-weight: bold;
+          text-align:left;
+          background:#a6caf0;
+	  }
+          tr, td{
+          font-family: verdana,arial,helvetica;
+          font-size: 80%;
+          background:#eeeee0;
+          }	  
+	  </style>        
+          <h1>
+            <a name="top"><xsl:value-of select="$title"/></a>
+          </h1>
+          Tagdiff between <xsl:value-of select="@startTag"/> <xsl:value-of select="@startDate"/> and
+			<xsl:value-of select="@endTag"/> <xsl:value-of select="@endDate"/>
+          <p align="right">Designed for use with <a href="http://jakarta.apache.org">Ant</a>.</p>
+          <hr size="2"/>
+	<a name="TOP"/>
+	<table width="100%">
+		<tr>
+			<td align="right">
+				<a href="#New">New Files</a> |
+				<a href="#Modified">Modified Files</a> |
+				<a href="#Removed">Removed Files</a>
+			</td>
+		</tr>
+	</table>
+        <TABLE BORDER="0" WIDTH="100%" CELLPADDING="3" CELLSPACING="1">
+		<xsl:call-template name="show-entries">
+			<xsl:with-param name="title">New Files</xsl:with-param>
+			<xsl:with-param name="anchor">New</xsl:with-param>
+			<xsl:with-param name="entries" select=".//entry[file/revision][not(file/prevrevision)]"/>
+		</xsl:call-template>
+
+		<xsl:call-template name="show-entries">
+			<xsl:with-param name="title">Modified Files</xsl:with-param>
+			<xsl:with-param name="anchor">Modified</xsl:with-param>
+			<xsl:with-param name="entries" select=".//entry[file/revision][file/prevrevision]"/>
+		</xsl:call-template>
+
+		<xsl:call-template name="show-entries">
+			<xsl:with-param name="title">Removed Files</xsl:with-param>
+			<xsl:with-param name="anchor">Removed</xsl:with-param>
+			<xsl:with-param name="entries" select=".//entry[not(file/revision)][not(file/prevrevision)]"/>
+		</xsl:call-template>
+        </TABLE>
+        
+      </BODY>
+    </HTML>
+  </xsl:template>
+
+  <xsl:template name="show-entries">
+	<xsl:param name="title"/>
+	<xsl:param name="anchor"/>
+	<xsl:param name="entries"/>
+	<TR>
+		<TD colspan="2" class="dateAndAuthor">
+			<a>
+				<xsl:attribute name="name"><xsl:value-of select="$anchor"/></xsl:attribute>
+				<xsl:value-of select="$title"/> - <xsl:value-of select="count($entries)"/> entries
+			</a>
+			<a href="#TOP">(back to top)</a>
+		</TD>
+	</TR>
+	<TR>
+		<TD width="20">
+			<xsl:text>    </xsl:text>
+		</TD>
+		<TD>
+		        <ul>
+				<xsl:apply-templates select="$entries"/>
+			</ul>
+		</TD>
+	</TR>
+  </xsl:template>  
+
+  <xsl:template match="entry">
+	<xsl:apply-templates select="file"/>
+  </xsl:template>
+
+  <xsl:template match="date">
+    <i><xsl:value-of select="."/></i>
+  </xsl:template>
+
+  <xsl:template match="time">
+    <i><xsl:value-of select="."/></i>
+  </xsl:template>
+
+  <xsl:template match="author">
+    <i>
+      <a>
+        <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
+        <xsl:value-of select="."/>
+      </a>
+    </i>
+  </xsl:template>
+
+  <xsl:template match="file">
+    <li>
+      <a target="_new">
+        <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" /></xsl:attribute>
+        <xsl:value-of select="name" />
+      </a>
+      <xsl:if test="string-length(prevrevision) > 0 or string-length(revision) > 0">
+      <xsl:text> </xsl:text>
+      <a target="_new">
+        <xsl:choose>
+          <xsl:when test="string-length(prevrevision) = 0 ">
+            <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?rev=<xsl:value-of select="revision" />&amp;content-type=text/x-cvsweb-markup</xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$module" />/<xsl:value-of select="name" />?r1=<xsl:value-of select="revision" />&amp;r2=<xsl:value-of select="prevrevision"/>&amp;diff_format=h</xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose> (<xsl:value-of select="revision"/>)
+      </a>
+      </xsl:if>
+    </li>
+  </xsl:template>
+
+  <!-- Any elements within a msg are processed,
+       so that we can preserve HTML tags. -->
+  <xsl:template match="msg">
+    <b><xsl:apply-templates/></b>
+  </xsl:template>
+  
+</xsl:stylesheet>

Added: labs/jbossforums/branches/forums120P26/tools/examples/build.bat
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/examples/build.bat	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/examples/build.bat	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,54 @@
+ at echo off
+rem
+rem  Invokes a script of the same name in the 'tools' module.
+rem  
+rem  The 'tools' module is expected to be a peer directory of the directory
+rem  in which this script lives.
+rem
+rem  @author Jason Dillon <jason at planet57.com>
+rem
+
+rem $Id: build.bat,v 1.1.1.1 2005/01/14 23:16:58 vietj Exp $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%:    %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF

Added: labs/jbossforums/branches/forums120P26/tools/examples/build.sh
===================================================================
--- labs/jbossforums/branches/forums120P26/tools/examples/build.sh	                        (rev 0)
+++ labs/jbossforums/branches/forums120P26/tools/examples/build.sh	2009-05-15 12:36:33 UTC (rev 26559)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+##  Invokes a script of the same name in the 'tools' module.
+##  
+##  The 'tools' module is expected to be a peer directory of the directory
+##  in which this script lives.
+##
+##  @author Jason Dillon <jason at planet57.com>
+##
+
+# $Id: build.sh,v 1.1.1.1 2005/01/14 23:16:58 vietj Exp $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+    if [ "x$TOOLS_ROOT" = "x" ]; then
+	TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+    fi
+
+    MODULE_ROOT=`cd $DIRNAME; pwd`
+    export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+    # Where is the target script?
+    target="$TOOLS_ROOT/bin/$PROGNAME"
+    if [ ! -f "$target" ]; then
+	echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+        echo "${PROGNAME}:"
+        echo "${PROGNAME}:    $target"
+        echo "${PROGNAME}:"
+	echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+	echo "${PROGNAME}: and make sure it is up to date."
+        exit 2
+    fi
+
+    # Get busy yo!
+    if [ "x$DEBUG" != "x" ]; then
+	echo "${PROGNAME}: Executing: /bin/sh $target $@"
+    fi
+    if [ "x$TRACE" = "x" ]; then
+	exec /bin/sh $target "$@"
+    else
+	exec /bin/sh -x $target "$@"
+    fi
+}
+
+# Lets get ready to rumble!
+main "$@"

Added: labs/jbossforums/branches/forums120P26/tools/lib/ant.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/ant.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/bsf.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/bsf.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/buildmagic-tasks.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/buildmagic-tasks.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/crimson.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/crimson.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/explode.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/explode.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/junit.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/junit.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/optional.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/optional.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/saxon.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/saxon.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/xalan.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/xalan.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/xercesImpl.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/xercesImpl.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossforums/branches/forums120P26/tools/lib/xml-apis.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossforums/branches/forums120P26/tools/lib/xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-svn-commits mailing list