JBoss Portal SVN: r11359 - in docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules: extras and 1 other directory.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-07-09 02:14:53 -0400 (Wed, 09 Jul 2008)
New Revision: 11359
Added:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/extras/email_mbean.xmlt
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml
Log:
- code highlighting
- adding email_mbean.xmlt configuration to allow
correct highlighting for the "3.4. Configuring the Email Service"
example
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml 2008-07-09 05:25:45 UTC (rev 11358)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml 2008-07-09 06:14:53 UTC (rev 11359)
@@ -53,7 +53,7 @@
<orderedlist>
<listitem>
<para>Open the <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis> file. If this file does not exist, copy and save the following example:
-<programlisting role="XML"><![CDATA[
+<programlisting><![CDATA[
<?xml version="1.0"?>
<jboss-web>
<security-domain>java:jaas/portal</security-domain>
@@ -73,9 +73,9 @@
<computeroutput><context-root></computeroutput> element with the desired context path:
</para>
<para>
-<screen>
+<programlisting>
<![CDATA[<context-root>/testing</context-root>]]>
-</screen>
+</programlisting>
</para>
<para>
Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
@@ -98,10 +98,10 @@
Open the <filename>build/local.properties</filename> file and edit the <computeroutput>portal.web.context-root</computeroutput> option with the desired context path:
</para>
<para>
-<screen>
+<programlisting>
# Context root for the portal main servlet
portal.web.context-root=/testing
-</screen>
+</programlisting>
</para>
<para>
Using this example, the main JBoss Portal page would be reached by navigating to <emphasis>http://localhost:8080/testing</emphasis>.
@@ -128,11 +128,11 @@
context-root other than <emphasis>/</emphasis>, under the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/</filename> directory, for the above changes to take affect. The following is an example <filename>jboss-web.xml</filename> file, which changes the Apache Tomcat context path to <computeroutput>/tomcat-root</computeroutput>:
</para>
<para>
-<screen><![CDATA[
+<programlisting><![CDATA[
<?xml version="1.0"?>
<jboss-web>
<context-root>/tomcat-root</context-root>
-</jboss-web>]]></screen>
+</jboss-web>]]></programlisting>
</para>
</sect2>
</sect1>
@@ -150,10 +150,10 @@
To modify these files to force the DB dialect, un-comment the following line from each <filename>hibernate.cfg.xml</filename> file in each JBoss Portal module you intend to use, so that it looks like the following:
</para>
<para>
-<screen><![CDATA[
+<programlisting><![CDATA[
<!-- Force the dialect instead of using autodetection -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></screen>
+]]></programlisting>
</para>
<para>
Note: this example is for a PostgreSQL database. If you use another database, you need to modify <computeroutput>org.hibernate.dialect.PostgreSQLDialect</computeroutput> to reflect the correct database. For a list of supported dialects, refer to the <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">dialects list on the Hibernate website</ulink>.
@@ -176,10 +176,10 @@
Un-comment the following line, so that it looks like the following:
</para>
<para>
-<screen><![CDATA[
+<programlisting><![CDATA[
<!-- Force the dialect instead of using autodetection -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
-]]></screen>
+]]></programlisting>
</para>
</listitem>
</orderedlist>
@@ -190,15 +190,15 @@
</sect2>
</sect1>
<sect1 id="emailConfiguration">
- <title>Setting up the Email Service</title>
+ <title>Configuring the Email Service</title>
<para>
If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.
</para>
<para>
The email service is configured using the <filename>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml</filename> file. The following is an example of the section which is used to configure the email service:
</para>
- <para>
-<screen><![CDATA[
+<programlisting role="XML"><xi:include href="extras/email_mbean.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>
+<!-- <programlisting><![CDATA[
<mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
@@ -216,8 +216,8 @@
<attribute name="SMTPTimeout">10000</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>]]>
-</screen>
- </para>
+</programlisting> -->
+
<para>
A different SMTP server (other than localhost) can be configured, along with a SMTP username and an SMTP password. The following is an example configuration that uses the Gmail SMTP server:
</para>
Added: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/extras/email_mbean.xmlt
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/extras/email_mbean.xmlt (rev 0)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/extras/email_mbean.xmlt 2008-07-09 06:14:53 UTC (rev 11359)
@@ -0,0 +1,17 @@
+<mbean
+code="org.jboss.portal.core.impl.mail.MailModuleImpl"
+name="portal:service=Module,type=Mail"
+xmbean-dd=""
+xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+<xmbean/>
+<depends>jboss:service=Mail</depends>
+<depends>portal:service=Module,type=IdentityServiceController</depends>
+<attribute name="QueueCapacity">-1</attribute>
+<attribute name="Gateway">localhost</attribute>
+<attribute name="SmtpUser"></attribute>
+<attribute name="SmtpPassword"></attribute>
+<attribute name="JavaMailDebugEnabled">false</attribute>
+<attribute name="SMTPConnectionTimeout">100000</attribute>
+<attribute name="SMTPTimeout">10000</attribute>
+<attribute name="JNDIName">java:portal/MailModule</attribute>
+</mbean>
16 years
JBoss Portal SVN: r11358 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-07-09 01:25:45 -0400 (Wed, 09 Jul 2008)
New Revision: 11358
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
Log:
changing heading to "Configuring the Email Server".
This is also being changed in the 2.7 branch
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-07-09 05:21:20 UTC (rev 11357)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-07-09 05:25:45 UTC (rev 11358)
@@ -194,7 +194,7 @@
</sect2>
</sect1>
<sect1 id="emailConfiguration">
- <title>Setting up the Email Service</title>
+ <title>Configuring the Email Service</title>
<para>
If you have a standard setup and a mail server installed, the email service should work without any extra configuration. Most Linux distributions have a mail server installed by default. The email service, for example, can be used to verify a user's email address when a user subscribes, or for CMS workflow notifications.
</para>
16 years
JBoss Portal SVN: r11357 - docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-07-09 01:21:20 -0400 (Wed, 09 Jul 2008)
New Revision: 11357
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/supported.xml
Log:
- code highlighting
- removing content out of admonitions (there are too many)
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml 2008-07-09 04:42:05 UTC (rev 11356)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/configuration.xml 2008-07-09 05:21:20 UTC (rev 11357)
@@ -53,7 +53,7 @@
<orderedlist>
<listitem>
<para>Open the <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis> file. If this file does not exist, copy and save the following example:
- <programlisting><![CDATA[
+<programlisting role="XML"><![CDATA[
<?xml version="1.0"?>
<jboss-web>
<security-domain>java:jaas/portal</security-domain>
@@ -120,8 +120,7 @@
</listitem>
</orderedlist>
</para>
- <para>
- <note>
+<sect2>
<title>Changing the context-root</title>
<para>
By default, Apache Tomcat holds on to the root context, <emphasis>/</emphasis>. You may need to remove the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war/</filename> directory,
@@ -135,8 +134,7 @@
<context-root>/tomcat-root</context-root>
</jboss-web>]]></screen>
</para>
- </note>
-</para>
+</sect2>
</sect1>
<sect1 id="configuration-hibdialect">
<title>Forcing the Database Dialect</title>
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-09 04:42:05 UTC (rev 11356)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-09 05:21:20 UTC (rev 11357)
@@ -472,7 +472,7 @@
<para>
After the Datasource descriptor has been copied into the <filename>deploy</filename> directory, make sure the <computeroutput>user-name</computeroutput>, <computeroutput>password</computeroutput>, <computeroutput>connection-url</computeroutput>, and <computeroutput>driver-class</computeroutput>, are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for a PostgreSQL database:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/supported.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/supported.xml 2008-07-09 04:42:05 UTC (rev 11356)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/supported.xml 2008-07-09 05:21:20 UTC (rev 11357)
@@ -54,9 +54,7 @@
<listitem><trademark class="registered">Microsoft</trademark><trademark class="registered"> SQL Server</trademark></listitem>
<listitem>MaxDB</listitem>
</itemizedlist>
- <note>
- <para>JBoss Portal employs Hibernate as an interface to a Relational Database Management System (RDBMS). Most Relational Database Management Systems supported by Hibernate will work with JBoss Portal.</para>
- </note>
+ <para>JBoss Portal employs Hibernate as an interface to a Relational Database Management System (RDBMS). Most Relational Database Management Systems supported by Hibernate will work with JBoss Portal.</para>
</sect1>
<sect1>
<title>Source Building</title>
16 years
JBoss Portal SVN: r11356 - docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-07-09 00:42:05 -0400 (Wed, 09 Jul 2008)
New Revision: 11356
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
Log:
- removing trippled-up images for "Deploying JBoss Portal"
sections. Now, the image is only used for the first instance.
- moving "SQL Errors" into formalpara, instead of inside a note.
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-08 19:14:35 UTC (rev 11355)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-09 04:42:05 UTC (rev 11356)
@@ -30,16 +30,24 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>.
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>:
</para>
</listitem>
</orderedlist>
</para>
- <note>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/common/frontpage.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <formalpara>
<title>SQL Errors</title>
<para>
Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:
</para>
+ </formalpara>
<para>
<programlisting><![CDATA[
WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
@@ -50,7 +58,6 @@
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
]]></programlisting>
</para>
- </note>
</sect1>
<sect1 id="install_binary">
<title>Installing the Binary Download</title>
@@ -180,8 +187,8 @@
<para>
After the Datasource descriptor has been copied into the <filename>deploy</filename> directory, make sure the <computeroutput>user-name</computeroutput>, <computeroutput>password</computeroutput>, <computeroutput>connection-url</computeroutput>, and <computeroutput>driver-class</computeroutput>, are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for a PostgreSQL database:
</para>
-<programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
+<programlisting role="XML">
+<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>PortalDS</jndi-name>
@@ -190,8 +197,7 @@
<user-name>portal</user-name>
<password>portalpassword</password>
</local-tx-datasource>
-</datasources>
-]]></programlisting>
+</datasources>]]></programlisting>
<para>
For further details about Datasource descriptors, please refer to the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">JBoss JDBC Datasource Wiki page</ulink>.
</para>
@@ -216,23 +222,17 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>:
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>.
</para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/common/frontpage.png"/>
- </imageobject>
- </mediaobject>
- </para>
</listitem>
</orderedlist>
</para>
- <note>
+ <formalpara>
<title>SQL Errors</title>
<para>
Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:
</para>
+ </formalpara>
<para>
<programlisting><![CDATA[
WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
@@ -243,7 +243,6 @@
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
]]></programlisting>
</para>
- </note>
</sect2>
</sect1>
<sect1 id="install_source">
@@ -509,23 +508,17 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>:
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <ulink url="http://localhost:8080/portal"></ulink> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>.
</para>
- <para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/common/frontpage.png"/>
- </imageobject>
- </mediaobject>
- </para>
</listitem>
</orderedlist>
</para>
- <note>
+ <formalpara>
<title>SQL Errors</title>
<para>
Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:
</para>
+ </formalpara>
<para>
<programlisting><![CDATA[
WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
@@ -536,7 +529,6 @@
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
]]></programlisting>
</para>
- </note>
</sect1>
<!--<sect1 id="install_installer">
16 years
JBoss Portal SVN: r11355 - examples and 15 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-08 15:14:35 -0400 (Tue, 08 Jul 2008)
New Revision: 11355
Added:
examples/
examples/trunk/
examples/trunk/SimplestHelloWorld/
examples/trunk/SimplestHelloWorld/.classpath
examples/trunk/SimplestHelloWorld/.project
examples/trunk/SimplestHelloWorld/.settings/
examples/trunk/SimplestHelloWorld/.settings/org.eclipse.jdt.core.prefs
examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.component
examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.project.facet.core.xml
examples/trunk/SimplestHelloWorld/.settings/org.maven.ide.eclipse.prefs
examples/trunk/SimplestHelloWorld/pom.xml
examples/trunk/SimplestHelloWorld/src/
examples/trunk/SimplestHelloWorld/src/main/
examples/trunk/SimplestHelloWorld/src/main/java/
examples/trunk/SimplestHelloWorld/src/main/java/org/
examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/
examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/
examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/
examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/samples/
examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
examples/trunk/SimplestHelloWorld/src/main/resources/
examples/trunk/SimplestHelloWorld/src/main/webapp/
examples/trunk/SimplestHelloWorld/src/main/webapp/META-INF/
examples/trunk/SimplestHelloWorld/src/main/webapp/META-INF/MANIFEST.MF
examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/
examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/lib/
examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/portlet.xml
examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/web.xml
examples/trunk/SimplestHelloWorld/src/test/
examples/trunk/SimplestHelloWorld/src/test/java/
examples/trunk/SimplestHelloWorld/src/test/resources/
Log:
Importing example
Added: examples/trunk/SimplestHelloWorld/.classpath
===================================================================
--- examples/trunk/SimplestHelloWorld/.classpath (rev 0)
+++ examples/trunk/SimplestHelloWorld/.classpath 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: examples/trunk/SimplestHelloWorld/.project
===================================================================
--- examples/trunk/SimplestHelloWorld/.project (rev 0)
+++ examples/trunk/SimplestHelloWorld/.project 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>HelloWorld</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: examples/trunk/SimplestHelloWorld/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- examples/trunk/SimplestHelloWorld/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ examples/trunk/SimplestHelloWorld/.settings/org.eclipse.jdt.core.prefs 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,7 @@
+#Tue Jul 08 18:28:17 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.component
===================================================================
--- examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.component (rev 0)
+++ examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.component 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="HelloWorld">
+<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+<wb-resource deploy-path="/" source-path="/src/test/java"/>
+<wb-resource deploy-path="/" source-path="/src/test/resources"/>
+<property name="context-root" value="HelloWorld"/>
+<property name="java-output-path" value="build/classes"/>
+</wb-module>
+</project-modules>
Added: examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ examples/trunk/SimplestHelloWorld/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="jst.java" version="1.4"/>
+ <installed facet="jst.web" version="2.3"/>
+</faceted-project>
Added: examples/trunk/SimplestHelloWorld/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- examples/trunk/SimplestHelloWorld/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ examples/trunk/SimplestHelloWorld/.settings/org.maven.ide.eclipse.prefs 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,8 @@
+#Tue Jul 08 18:28:14 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: examples/trunk/SimplestHelloWorld/pom.xml
===================================================================
--- examples/trunk/SimplestHelloWorld/pom.xml (rev 0)
+++ examples/trunk/SimplestHelloWorld/pom.xml 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.portal.example</groupId>
+ <artifactId>HelloWorld</artifactId>
+ <packaging>war</packaging>
+ <name />
+ <version>0.0.1</version>
+ <description />
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
===================================================================
--- examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java (rev 0)
+++ examples/trunk/SimplestHelloWorld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java 2008-07-08 19:14:35 UTC (rev 11355)
@@ -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.portal.portlet.samples;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SimplestHelloWorldPortlet extends GenericPortlet
+{
+ public void doView(RenderRequest request, RenderResponse response) throws PortletException
+ {
+ try
+ {
+ PrintWriter writer = response.getWriter();
+ writer.write("Hello World !");
+ writer.close();
+ }
+ catch (IOException e)
+ {
+ throw new PortletException(e);
+ }
+ }
+}
+
Added: examples/trunk/SimplestHelloWorld/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- examples/trunk/SimplestHelloWorld/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ examples/trunk/SimplestHelloWorld/src/main/webapp/META-INF/MANIFEST.MF 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/portlet.xml (rev 0)
+++ examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/portlet.xml 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>HelloWorldPortlet</portlet-name>
+ <portlet-class>
+ org.jboss.portal.portlet.samples.SimplestHelloWorldPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Simplest Hello World Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Added: examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ examples/trunk/SimplestHelloWorld/src/main/webapp/WEB-INF/web.xml 2008-07-08 19:14:35 UTC (rev 11355)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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>
16 years
JBoss Portal SVN: r11354 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client: model and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-08 13:48:19 -0400 (Tue, 08 Jul 2008)
New Revision: 11354
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
Log:
start to implement drag and drop
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -34,4 +34,6 @@
Draggable findDraggableByHandle(Panel panel, Element element);
+ Object findDroppable(Element element);
+
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -27,6 +27,7 @@
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.EventPreview;
+import com.google.gwt.user.client.Window;
import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
/**
@@ -87,8 +88,8 @@
if (draggable != null)
{
Element containerElement = draggable.getContainer();
- int left = DOM.getAbsoluteLeft(draggable.getContainer());
- int top = DOM.getAbsoluteTop(draggable.getContainer());
+ int left = DOM.getAbsoluteLeft(draggable.getContainer()) - Window.getScrollLeft();
+ int top = DOM.getAbsoluteTop(draggable.getContainer()) - Window.getScrollTop();
int x = DOM.eventGetClientX(event);
int y = DOM.eventGetClientY(event);
int deltaX = x - left;
@@ -136,7 +137,16 @@
int newY = y - drag.deltaY;
DOM.setIntStyleAttribute(drag.draggable.getContainer(), "left", newX);
DOM.setIntStyleAttribute(drag.draggable.getContainer(), "top", newY);
- log.debug("Dragging at position (" + newX + "," + newY + ") with draggable " + drag.draggable);
+ log.debug("Dragging at position (" + newX + "," + newY + ") with draggable " + drag.draggable +
+ " on element " + element);
+
+ //
+ Object droppable = context.findDroppable(element);
+ if (droppable != null)
+ {
+ Window.alert("Found droppable " + droppable);
+ }
+
}
//
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -114,6 +114,18 @@
this.layout = layout;
}
+ protected Object doFindDroppable(Element element)
+ {
+ if (element == layout.getElement())
+ {
+ return this;
+ }
+
+ //
+ return null;
+ }
+
+
protected Draggable doFindDraggable(Element element)
{
return null;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -129,6 +129,23 @@
}
}
+ public final Object findDroppable(Element element)
+ {
+ Object droppable = doFindDroppable(element);
+
+ //
+ for (Iterator i = getChildren().iterator();i.hasNext() && droppable == null;)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ droppable = child.findDroppable(element);
+ }
+
+ //
+ return droppable;
+ }
+
public final Draggable findDraggabble(Element element)
{
Draggable draggable = doFindDraggable(element);
@@ -221,6 +238,8 @@
protected abstract Draggable doFindDraggable(Element element);
+ protected abstract Object doFindDroppable(Element element);
+
public abstract Widget getWidget();
public final static class Context
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -95,5 +95,9 @@
{
return findDraggabble(element);
}
+ public Object findDroppable(Element element)
+ {
+ return AjaxPage.this.findDroppable(element);
+ }
};
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-08 16:44:15 UTC (rev 11353)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-08 17:48:19 UTC (rev 11354)
@@ -96,6 +96,11 @@
}
}
+ protected Object doFindDroppable(Element element)
+ {
+ return null;
+ }
+
protected void doCreateWidget()
{
//
16 years
JBoss Portal SVN: r11353 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client: dnd and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-08 12:44:15 -0400 (Tue, 08 Jul 2008)
New Revision: 11353
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Drag.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
Log:
start to implement drag and drop
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.presentation.ajax.client.dnd;
+
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface DnDContext
+{
+
+ Draggable findDraggableByHandle(Panel panel, Element element);
+
+}
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -0,0 +1,169 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.presentation.ajax.client.dnd;
+
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.EventPreview;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DnDPanel extends SimplePanel implements EventPreview
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(DnDPanel.class);
+
+ /** . */
+ private Drag drag;
+
+ /** . */
+ private DnDContext context;
+
+ public DnDPanel(DnDContext context)
+ {
+ DOM.sinkEvents(getElement(), Event.MOUSEEVENTS);
+ DOM.addEventPreview(this);
+
+ this.context = context;
+ }
+
+ public boolean onEventPreview(Event event)
+ {
+ if (DOM.eventGetType(event) == Event.ONMOUSEDOWN)
+ {
+ Object draggable = context.findDraggableByHandle(this, DOM.eventGetTarget(event));
+
+ //
+ if (draggable != null)
+ {
+ DOM.eventPreventDefault(event);
+ }
+ }
+
+ //
+ return true;
+ }
+
+ public void onBrowserEvent(Event event)
+ {
+ if (context != null)
+ {
+ Element element = DOM.eventGetTarget(event);
+
+ //
+ switch (DOM.eventGetType(event))
+ {
+ case Event.ONMOUSEDOWN:
+ {
+ Draggable draggable = context.findDraggableByHandle(this, element);
+
+ //
+ if (draggable != null)
+ {
+ Element containerElement = draggable.getContainer();
+ int left = DOM.getAbsoluteLeft(draggable.getContainer());
+ int top = DOM.getAbsoluteTop(draggable.getContainer());
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ int deltaX = x - left;
+ int deltaY = y - top;
+
+ //
+ log.debug("Starting drag element=(" + left + "," + top + "), mouse=(" + x +
+ "," + y + "), delta=(" + deltaX + "," + deltaY + ") with draggable " + draggable);
+
+ //
+ DOM.setStyleAttribute(containerElement, "position", "fixed");
+ DOM.setIntStyleAttribute(containerElement, "left", left);
+ DOM.setIntStyleAttribute(containerElement, "top", top);
+
+ //
+ drag = new Drag(
+ deltaX,
+ deltaY,
+ element,
+ draggable
+ );
+
+ //
+ // DOM.setCapture(element);
+ }
+
+ //
+ break;
+ }
+ case Event.ONMOUSEUP:
+ {
+ if (drag != null)
+ {
+ stopDrag();
+ }
+ break;
+ }
+ case Event.ONMOUSEMOVE:
+ {
+ if (drag != null)
+ {
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ int newX = x - drag.deltaX;
+ int newY = y - drag.deltaY;
+ DOM.setIntStyleAttribute(drag.draggable.getContainer(), "left", newX);
+ DOM.setIntStyleAttribute(drag.draggable.getContainer(), "top", newY);
+ log.debug("Dragging at position (" + newX + "," + newY + ") with draggable " + drag.draggable);
+ }
+
+ //
+ break;
+ }
+ case Event.ONMOUSEOVER:
+ case Event.ONMOUSEOUT:
+ {
+ if (drag != null && element == getElement())
+ {
+ stopDrag();
+ }
+ break;
+ }
+ }
+
+
+ }
+ }
+
+ private void stopDrag()
+ {
+ log.debug("Stopping drag with draggable " + drag.draggable);
+ // DOM.releaseCapture(drag.element);
+ Element containerElement = drag.draggable.getContainer();
+ DOM.setStyleAttribute(containerElement, "position", null);
+ drag = null;
+ }
+
+}
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Drag.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Drag.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Drag.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.presentation.ajax.client.dnd;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+class Drag
+{
+
+ /** . */
+ final int deltaX;
+
+ /** . */
+ final int deltaY;
+
+ /** . */
+ final Element element;
+
+ /** . */
+ final Draggable draggable;
+
+ Drag(int deltaX, int deltaY, Element element, Draggable draggable)
+ {
+ this.deltaX = deltaX;
+ this.deltaY = deltaY;
+ this.element = element;
+ this.draggable = draggable;
+ }
+}
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.presentation.ajax.client.dnd;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Draggable
+{
+
+ /**
+ * Returns the element container that will be used for moving.
+ *
+ * @return the element container
+ */
+ Element getContainer();
+
+}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-08 15:06:11 UTC (rev 11352)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -26,11 +26,13 @@
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.Element;
import java.util.Iterator;
import java.util.Map;
import org.jboss.portal.presentation.ajax.client.Constants;
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -112,6 +114,11 @@
this.layout = layout;
}
+ protected Draggable doFindDraggable(Element element)
+ {
+ return null;
+ }
+
protected void doAddChild(AjaxObject child)
{
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-08 15:06:11 UTC (rev 11352)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.ajax.client.model;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.Element;
import java.util.Map;
import java.util.HashMap;
@@ -39,6 +40,7 @@
import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
import org.jboss.portal.presentation.ajax.client.AgentContext;
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -127,6 +129,23 @@
}
}
+ public final Draggable findDraggabble(Element element)
+ {
+ Draggable draggable = doFindDraggable(element);
+
+ //
+ for (Iterator i = getChildren().iterator();i.hasNext() && draggable == null;)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ draggable = child.findDraggabble(element);
+ }
+
+ //
+ return draggable;
+ }
+
public final void refresh(boolean force)
{
context.log.debug("Requesting for" + (force ? " forced " : " ") + "refresh of object " + id);
@@ -200,9 +219,11 @@
protected abstract void doRemoveChild(AjaxObject child);
+ protected abstract Draggable doFindDraggable(Element element);
+
public abstract Widget getWidget();
- public static class Context
+ public final static class Context
{
/** . */
@@ -238,6 +259,11 @@
return root;
}
+ Logger getLog()
+ {
+ return log;
+ }
+
public void update(ModelUpdate[] updates)
{
for (int i = 0; i < updates.length;i++)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-08 15:06:11 UTC (rev 11352)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -25,9 +25,15 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.Element;
import java.util.Map;
+import org.jboss.portal.presentation.ajax.client.dnd.DnDPanel;
+import org.jboss.portal.presentation.ajax.client.dnd.DnDContext;
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -38,6 +44,9 @@
/** . */
private VerticalPanel widget;
+ /** . */
+ private DnDPanel dndPanel;
+
public AjaxPage(String id, Map properties)
{
super(id, properties);
@@ -45,7 +54,7 @@
protected void doRefresh(boolean force)
{
- doRefresh(widget);
+ doRefresh(dndPanel);
}
public Widget getWidget()
@@ -58,10 +67,12 @@
Label title = new Label("Page " + getId());
MetaWidget meta = new MetaWidget(this);
VerticalPanel widget = new VerticalPanel();
+ DnDPanel dndPanel = new DnDPanel(dndContext);
//
meta.add(title);
widget.add(meta);
+ widget.add(dndPanel);
//
title.setStyleName("pf-Title");
@@ -69,10 +80,20 @@
//
this.widget = widget;
+ this.dndPanel = dndPanel;
}
protected void doDestroyWidget()
{
widget = null;
}
+
+ /** . */
+ private final DnDContext dndContext = new DnDContext()
+ {
+ public Draggable findDraggableByHandle(Panel panel, Element element)
+ {
+ return findDraggabble(element);
+ }
+ };
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-08 15:06:11 UTC (rev 11352)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-08 16:44:15 UTC (rev 11353)
@@ -36,6 +36,7 @@
import com.google.gwt.core.client.GWT;
import org.jboss.portal.presentation.ajax.client.PresentationClientRemoteAsync;
import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
import org.jboss.portal.presentation.ajax.client.util.Tools;
@@ -66,11 +67,35 @@
/** . */
private HTML markup;
+ /** . */
+ private Draggable draggable;
+
public AjaxWindow(String id, Map properties)
{
super(id, properties);
+
+ //
+ draggable = new Draggable()
+ {
+ public Element getContainer()
+ {
+ return widget.getElement();
+ }
+ };
}
+ protected Draggable doFindDraggable(Element element)
+ {
+ if (title.getElement() == element)
+ {
+ return draggable;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
protected void doCreateWidget()
{
//
@@ -84,11 +109,12 @@
getContext().getAgentContext().process(new DestroyObjectAction(getId()));
}
});
- MetaWidget meta = new MetaWidget(this);
+// MetaWidget meta = new MetaWidget(this);
//
- meta.add(title);
- widget.add(meta);
+// meta.add(title);
+// widget.add(meta);
+ widget.add(title);
widget.add(close);
widget.add(markup);
16 years
JBoss Portal SVN: r11352 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-08 11:06:11 -0400 (Tue, 08 Jul 2008)
New Revision: 11352
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
Log:
- More generification.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-07-08 15:05:51 UTC (rev 11351)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-07-08 15:06:11 UTC (rev 11352)
@@ -23,9 +23,8 @@
package org.jboss.portal.wsrp;
-import static org.jboss.portal.common.p3p.P3PConstants.*;
-
import org.jboss.portal.common.NotYetImplemented;
+import static org.jboss.portal.common.p3p.P3PConstants.*;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.wsrp.core.Contact;
import org.jboss.portal.wsrp.core.EmployerInfo;
@@ -91,42 +90,42 @@
}
EmployerInfo employerInfo = new EmployerInfo((String)userInfos.get(INFO_USER_EMPLOYER),
- (String)userInfos.get(INFO_USER_DEPARTMENT),
- (String)userInfos.get(INFO_USER_JOB_TITLE), null);
+ (String)userInfos.get(INFO_USER_DEPARTMENT),
+ (String)userInfos.get(INFO_USER_JOB_TITLE), null);
return new UserProfile(name, bdate, (String)userInfos.get(INFO_USER_GENDER), employerInfo,
- createContactFrom(userInfos, false), createContactFrom(userInfos, true), null);
+ createContactFrom(userInfos, false), createContactFrom(userInfos, true), null);
}
private static PersonName createNameFrom(Map userInfos)
{
return new PersonName(
- (String)userInfos.get(INFO_USER_NAME_PREFIX),
- (String)userInfos.get(INFO_USER_NAME_GIVEN),
- (String)userInfos.get(INFO_USER_NAME_FAMILY),
- (String)userInfos.get(INFO_USER_NAME_MIDDLE),
- (String)userInfos.get(INFO_USER_NAME_SUFFIX),
- (String)userInfos.get(INFO_USER_NAME_NICKNAME), null);
+ (String)userInfos.get(INFO_USER_NAME_PREFIX),
+ (String)userInfos.get(INFO_USER_NAME_GIVEN),
+ (String)userInfos.get(INFO_USER_NAME_FAMILY),
+ (String)userInfos.get(INFO_USER_NAME_MIDDLE),
+ (String)userInfos.get(INFO_USER_NAME_SUFFIX),
+ (String)userInfos.get(INFO_USER_NAME_NICKNAME), null);
}
private static Contact createContactFrom(Map infos, boolean isBusiness)
{
Online online = new Online((String)infos.get(getOnlineUserInfoKey(OnlineInfo.EMAIL, isBusiness)),
- (String)infos.get(getOnlineUserInfoKey(OnlineInfo.URI, isBusiness)), null);
+ (String)infos.get(getOnlineUserInfoKey(OnlineInfo.URI, isBusiness)), null);
Postal postal = new Postal(
- (String)infos.get(getPostalUserInfoKey(PostalInfo.NAME, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.STREET, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.CITY, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.STATEPROV, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.POSTALCODE, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.COUNTRY, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.ORGANIZATION, isBusiness)), null);
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.NAME, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.STREET, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.CITY, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.STATEPROV, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.POSTALCODE, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.COUNTRY, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.ORGANIZATION, isBusiness)), null);
Telecom telecom = new Telecom(createTelephoneNumFrom(infos, TelecomType.TELEPHONE, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.FAX, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.MOBILE, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.PAGER, isBusiness), null);
+ createTelephoneNumFrom(infos, TelecomType.FAX, isBusiness),
+ createTelephoneNumFrom(infos, TelecomType.MOBILE, isBusiness),
+ createTelephoneNumFrom(infos, TelecomType.PAGER, isBusiness), null);
return new Contact(postal, telecom, online, null);
}
@@ -134,11 +133,11 @@
private static TelephoneNum createTelephoneNumFrom(Map infos, TelecomType type, boolean isBusiness)
{
return new TelephoneNum(
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.INTCODE, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.LOCCODE, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.NUMBER, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.EXT, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.COMMENT, isBusiness)), null);
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.INTCODE, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.LOCCODE, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.NUMBER, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.EXT, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.COMMENT, isBusiness)), null);
}
/**
@@ -150,11 +149,10 @@
*/
static class WSRPMappedUserContext implements UserContext
{
- private Map infos;
+ private Map<String, String> infos;
private String[] desiredLocales;
private Locale locale;
private String id;
- private Map<String, Object> attributes;
public WSRPMappedUserContext(org.jboss.portal.wsrp.core.UserContext userContext, String[] desiredLocales, String preferredLocale)
{
@@ -165,7 +163,7 @@
UserProfile profile = userContext.getProfile();
if (profile != null)
{
- infos = new HashMap();
+ infos = new HashMap<String, String>();
Calendar bdate = profile.getBdate();
if (bdate != null)
{
@@ -207,7 +205,7 @@
}
else
{
- infos = Collections.EMPTY_MAP;
+ infos = Collections.emptyMap();
}
}
@@ -277,7 +275,7 @@
int length = desiredLocales.length;
if (length > 0)
{
- List locales = new ArrayList(length);
+ List<Locale> locales = new ArrayList<Locale>(length);
for (int i = 0; i < length; i++)
{
Locale locale = WSRPUtils.getLocale(desiredLocales[i]);
@@ -290,7 +288,7 @@
return Collections.EMPTY_LIST;
}
}
-
+
public Object getAttribute(String arg0)
{
throw new NotYetImplemented();
16 years
JBoss Portal SVN: r11351 - in branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal: wsrp and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-08 11:05:51 -0400 (Tue, 08 Jul 2008)
New Revision: 11351
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/interop/LiferayServiceDescriptionBehavior.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
Log:
- Make sure we handle null lang case properly.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/interop/LiferayServiceDescriptionBehavior.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/interop/LiferayServiceDescriptionBehavior.java 2008-07-08 15:05:22 UTC (rev 11350)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/interop/LiferayServiceDescriptionBehavior.java 2008-07-08 15:05:51 UTC (rev 11351)
@@ -65,6 +65,12 @@
locString.setLang(lang);
locString.setValue("Software Catalog");
- serviceDescription.setOfferedPortlets(new PortletDescription[]{pd});
+ // add another value that checks that we handle null lang properly
+ PortletDescription pd2 = createPortletDescription("99", null);
+ pd.getMarkupTypes()[0].getLocales()[0] = "en_US";
+ locString = pd.getShortTitle();
+ locString.setLang(null);
+
+ serviceDescription.setOfferedPortlets(new PortletDescription[]{pd, pd2});
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-07-08 15:05:22 UTC (rev 11350)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2008-07-08 15:05:51 UTC (rev 11351)
@@ -434,31 +434,38 @@
public static Locale getLocale(String lang) throws IllegalArgumentException
{
- String possiblyRelaxed = lang;
- if (!WSRPUtils.strict)
+ if (lang != null)
{
- // treat en_US as valid by en_US => en-US
- // todo: maybe this should be handled by an interceptor...
- possiblyRelaxed = lang.replace('_', '-');
- }
+ String possiblyRelaxed = lang;
+ if (!WSRPUtils.strict)
+ {
+ // treat en_US as valid by en_US => en-US
+ // todo: maybe this should be handled by an interceptor...
+ possiblyRelaxed = lang.replace('_', '-');
+ }
- try
- {
- return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(possiblyRelaxed);
- }
- catch (ConversionException e)
- {
- if (WSRPUtils.strict)
+ try
{
- throw new IllegalArgumentException(e);
+ return LocaleFormat.RFC3066_LANGUAGE_TAG.getLocale(possiblyRelaxed);
}
- else
+ catch (ConversionException e)
{
- log.debug("Was given an invalid language: '" + possiblyRelaxed
- + "'. Since we're using relaxed validation, we will assume " + Locale.ENGLISH + " to avoid crashing!", e);
- return Locale.ENGLISH;
+ if (WSRPUtils.strict)
+ {
+ throw new IllegalArgumentException(e);
+ }
+ else
+ {
+ log.debug("Was given an invalid language: '" + possiblyRelaxed
+ + "'. Since we're using relaxed validation, we will assume " + Locale.ENGLISH + " to avoid crashing!", e);
+ return Locale.ENGLISH;
+ }
}
}
+ else
+ {
+ return Locale.getDefault();
+ }
}
public static String toString(Locale locale) throws IllegalArgumentException
16 years
JBoss Portal SVN: r11350 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-08 11:05:22 -0400 (Tue, 08 Jul 2008)
New Revision: 11350
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
Log:
- More generification.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-07-08 15:04:56 UTC (rev 11349)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2008-07-08 15:05:22 UTC (rev 11350)
@@ -89,42 +89,42 @@
}
EmployerInfo employerInfo = new EmployerInfo((String)userInfos.get(INFO_USER_EMPLOYER),
- (String)userInfos.get(INFO_USER_DEPARTMENT),
- (String)userInfos.get(INFO_USER_JOB_TITLE), null);
+ (String)userInfos.get(INFO_USER_DEPARTMENT),
+ (String)userInfos.get(INFO_USER_JOB_TITLE), null);
return new UserProfile(name, bdate, (String)userInfos.get(INFO_USER_GENDER), employerInfo,
- createContactFrom(userInfos, false), createContactFrom(userInfos, true), null);
+ createContactFrom(userInfos, false), createContactFrom(userInfos, true), null);
}
private static PersonName createNameFrom(Map userInfos)
{
return new PersonName(
- (String)userInfos.get(INFO_USER_NAME_PREFIX),
- (String)userInfos.get(INFO_USER_NAME_GIVEN),
- (String)userInfos.get(INFO_USER_NAME_FAMILY),
- (String)userInfos.get(INFO_USER_NAME_MIDDLE),
- (String)userInfos.get(INFO_USER_NAME_SUFFIX),
- (String)userInfos.get(INFO_USER_NAME_NICKNAME), null);
+ (String)userInfos.get(INFO_USER_NAME_PREFIX),
+ (String)userInfos.get(INFO_USER_NAME_GIVEN),
+ (String)userInfos.get(INFO_USER_NAME_FAMILY),
+ (String)userInfos.get(INFO_USER_NAME_MIDDLE),
+ (String)userInfos.get(INFO_USER_NAME_SUFFIX),
+ (String)userInfos.get(INFO_USER_NAME_NICKNAME), null);
}
private static Contact createContactFrom(Map infos, boolean isBusiness)
{
Online online = new Online((String)infos.get(getOnlineUserInfoKey(OnlineInfo.EMAIL, isBusiness)),
- (String)infos.get(getOnlineUserInfoKey(OnlineInfo.URI, isBusiness)), null);
+ (String)infos.get(getOnlineUserInfoKey(OnlineInfo.URI, isBusiness)), null);
Postal postal = new Postal(
- (String)infos.get(getPostalUserInfoKey(PostalInfo.NAME, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.STREET, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.CITY, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.STATEPROV, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.POSTALCODE, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.COUNTRY, isBusiness)),
- (String)infos.get(getPostalUserInfoKey(PostalInfo.ORGANIZATION, isBusiness)), null);
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.NAME, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.STREET, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.CITY, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.STATEPROV, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.POSTALCODE, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.COUNTRY, isBusiness)),
+ (String)infos.get(getPostalUserInfoKey(PostalInfo.ORGANIZATION, isBusiness)), null);
Telecom telecom = new Telecom(createTelephoneNumFrom(infos, TelecomType.TELEPHONE, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.FAX, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.MOBILE, isBusiness),
- createTelephoneNumFrom(infos, TelecomType.PAGER, isBusiness), null);
+ createTelephoneNumFrom(infos, TelecomType.FAX, isBusiness),
+ createTelephoneNumFrom(infos, TelecomType.MOBILE, isBusiness),
+ createTelephoneNumFrom(infos, TelecomType.PAGER, isBusiness), null);
return new Contact(postal, telecom, online, null);
}
@@ -132,11 +132,11 @@
private static TelephoneNum createTelephoneNumFrom(Map infos, TelecomType type, boolean isBusiness)
{
return new TelephoneNum(
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.INTCODE, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.LOCCODE, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.NUMBER, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.EXT, isBusiness)),
- (String)infos.get(getTelecomInfoKey(type, TelecomInfo.COMMENT, isBusiness)), null);
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.INTCODE, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.LOCCODE, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.NUMBER, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.EXT, isBusiness)),
+ (String)infos.get(getTelecomInfoKey(type, TelecomInfo.COMMENT, isBusiness)), null);
}
/**
@@ -148,7 +148,7 @@
*/
static class WSRPMappedUserContext implements UserContext
{
- private Map infos;
+ private Map<String, String> infos;
private String[] desiredLocales;
private Locale locale;
private String id;
@@ -162,7 +162,7 @@
UserProfile profile = userContext.getProfile();
if (profile != null)
{
- infos = new HashMap();
+ infos = new HashMap<String, String>();
Calendar bdate = profile.getBdate();
if (bdate != null)
{
@@ -204,7 +204,7 @@
}
else
{
- infos = Collections.EMPTY_MAP;
+ infos = Collections.emptyMap();
}
}
@@ -274,7 +274,7 @@
int length = desiredLocales.length;
if (length > 0)
{
- List locales = new ArrayList(length);
+ List<Locale> locales = new ArrayList<Locale>(length);
for (int i = 0; i < length; i++)
{
Locale locale = WSRPUtils.getLocale(desiredLocales[i]);
16 years