Seam SVN: r8140 - in trunk: build and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-08 11:59:42 -0400 (Thu, 08 May 2008)
New Revision: 8140
Added:
trunk/doc/Seam_Reference_Guide/
Modified:
trunk/build.xml
trunk/build/docs.pom.xml
Log:
Initial merge of updated docs
Modified: trunk/build/docs.pom.xml
===================================================================
--- trunk/build/docs.pom.xml 2008-05-08 11:45:44 UTC (rev 8139)
+++ trunk/build/docs.pom.xml 2008-05-08 15:59:42 UTC (rev 8140)
@@ -1,16 +1,158 @@
-<?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.seam</groupId>
- <artifactId>jboss-seam-reference-documentation</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>parent</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- </parent>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>pdf</packaging>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-</project>
\ No newline at end of file
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.seam.reference-guide</groupId>
+ <artifactId>seam-reference-guide</artifactId>
+ <version>@seam.version@</version>
+ <packaging>jdocbook</packaging>
+ <name>Seam Reference Guide</name>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-docbook-xslt</artifactId>
+ <version>1.1.0.BETA2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.wst.css</groupId>
+ <artifactId>core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.eclipse.wst.sse</groupId>
+ <artifactId>core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-jdocbook-style</artifactId>
+ <version>1.1.0.BETA2</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0.Beta1</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDirectory>${pom.basedir}</sourceDirectory>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <masterTranslation>en-US</masterTranslation>
+ <translations>
+
+ </translations>
+ <imageResource>
+ <directory>${pom.basedir}/en-US</directory>
+ <includes>
+ <include>images/*.png</include>
+ </includes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>
+ classpath:/xslt/org/jboss/seam/pdf.xsl
+ </stylesheetResource>
+ <finalName>seam_reference.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>
+ classpath:/xslt/org/jboss/seam/xhtml.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>
+ classpath:/xslt/org/jboss/seam/xhtml-single.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>
+ classpath:/xslt/org/jboss/seam/eclipse.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.1</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <activation>
+ <property>
+ <name>build.translations</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>translate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-05-08 11:45:44 UTC (rev 8139)
+++ trunk/build.xml 2008-05-08 15:59:42 UTC (rev 8140)
@@ -49,7 +49,7 @@
<!-- Documentation -->
<property name="doc.dir" value="doc" />
<property name="doc.api.dir" value="${doc.dir}/api" />
- <property name="doc.ref.dir" value="${doc.dir}/reference" />
+ <property name="doc.ref.dir" value="${doc.dir}/Seam_Reference_Guide" />
<property name="javadoc.link" value="http://java.sun.com/j2se/5.0/docs/api" />
<!-- Distribution targets -->
@@ -623,17 +623,21 @@
</target>
- <target name="refdoc" description="Generate and copy reference documentation">
-
- <copy todir="${doc.ref.dir}/build">
- <fileset dir="${doc.ref.dir}" />
- </copy>
- <replace dir="${doc.ref.dir}/build" token="@version@" value="${complete.version}" />
- <ant dir="${doc.ref.dir}/build" inheritall="false" target="all.doc" />
+ <target name="refdoc" description="Generate and copy reference documentation" depends="initpoms">
+ <condition property="maven.build.translations" value="-Dbuild.translations" else="">
+ <isset property="build.translations"/>
+ </condition>
+ <echo file="${doc.ref.dir}/en-US/Version_Info.xml">
+ <releaseinfo>${complete.version}</releaseinfo>
+ </echo>
+ <copy file="${docs.pom}" tofile="${doc.ref.dir}/pom.xml" overwrite="true"/>
+ <maven target="compile" basedir="${doc.ref.dir}">
+ <jvmarg line="-Xms128m -Xmx512m" />
+ <arg line="${maven.build.translations}" />
+ </maven>
<copy todir="${dist.ref.dir}">
- <fileset dir="${doc.ref.dir}/build/build" />
+ <fileset dir="${doc.ref.dir}/target/docbook/publish" />
</copy>
- <delete dir="${doc.ref.dir}/build" />
</target>
Copied: trunk/doc/Seam_Reference_Guide (from rev 8139, branches/Seam_2_0/doc/Seam_Reference_Guide)
16 years, 6 months
Seam SVN: r8139 - maven-plugins/trunk/seam-docbook-xslt and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-08 07:45:44 -0400 (Thu, 08 May 2008)
New Revision: 8139
Modified:
branches/Seam_2_0/build/docs.pom.xml
maven-plugins/trunk/seam-docbook-xslt/pom.xml
Log:
Upgrade to maven-jdocbook-plugin 2.1.1
Modified: branches/Seam_2_0/build/docs.pom.xml
===================================================================
--- branches/Seam_2_0/build/docs.pom.xml 2008-05-08 06:11:45 UTC (rev 8138)
+++ branches/Seam_2_0/build/docs.pom.xml 2008-05-08 11:45:44 UTC (rev 8139)
@@ -65,7 +65,7 @@
<sourceDocumentName>master.xml</sourceDocumentName>
<masterTranslation>en-US</masterTranslation>
<translations>
- <translation>zh-CN</translation>
+
</translations>
<imageResource>
<directory>${pom.basedir}/en-US</directory>
@@ -124,7 +124,7 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+ <version>2.1.1</version>
</plugin>
</plugins>
</pluginManagement>
Modified: maven-plugins/trunk/seam-docbook-xslt/pom.xml
===================================================================
--- maven-plugins/trunk/seam-docbook-xslt/pom.xml 2008-05-08 06:11:45 UTC (rev 8138)
+++ maven-plugins/trunk/seam-docbook-xslt/pom.xml 2008-05-08 11:45:44 UTC (rev 8139)
@@ -67,7 +67,7 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+ <version>2.1.1</version>
</plugin>
</plugins>
</pluginManagement>
16 years, 6 months
Seam SVN: r8138 - in trunk/examples/seamspace: src/org/jboss/seam/example/seamspace and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-05-08 02:11:45 -0400 (Thu, 08 May 2008)
New Revision: 8138
Modified:
trunk/examples/seamspace/resources/import.sql
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
trunk/examples/seamspace/view/imagepermissiondetail.page.xml
trunk/examples/seamspace/view/imagepermissiondetail.xhtml
Log:
completed permission management views, fixed invalid sample passwords
Modified: trunk/examples/seamspace/resources/import.sql
===================================================================
--- trunk/examples/seamspace/resources/import.sql 2008-05-08 02:17:52 UTC (rev 8137)
+++ trunk/examples/seamspace/resources/import.sql 2008-05-08 06:11:45 UTC (rev 8138)
@@ -7,9 +7,9 @@
insert into MemberRole (roleid, name) values (2, 'admin');
insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (1, 'demo', '/9Se/pfHeUH8FJ4asBD6jQ==', 1, 1);
-insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (2, 'duke', '97291c29cc69a65890424d0f97db28f2', 1, 2);
-insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (3, 'shadowman', 'd76acda33fcfede62a8a6979df88e690', 1, 3);
-insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (4, 'mona', '0a7adfe58071398e15b5177f4ace8493', 1, 4);
+insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (2, 'duke', 'lykcKcxppliQQk0Pl9so8g==', 1, 2);
+insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (3, 'shadowman', '12rNoz/P7eYqiml534jmkA==', 1, 3);
+insert into MemberAccount (accountid, username, passwordhash, enabled, member_id) values (4, 'mona', 'Cnrf5YBxOY4VtRd/Ss6Ekw==', 1, 4);
insert into AccountMembership (accountid, memberof) values (1, 2);
insert into AccountMembership (accountid, memberof) values (2, 1);
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
===================================================================
--- trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-08 02:17:52 UTC (rev 8137)
+++ trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-08 06:11:45 UTC (rev 8138)
@@ -14,6 +14,8 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;
+import org.jboss.seam.security.Role;
+import org.jboss.seam.security.SimplePrincipal;
import org.jboss.seam.security.management.IdentityManager;
import org.jboss.seam.security.permission.Permission;
import org.jboss.seam.security.permission.PermissionManager;
@@ -110,8 +112,34 @@
public void applyPermissions()
{
- // TODO apply permission changes here
+ List<Permission> permissions = new ArrayList<Permission>();
+
+ for (String role : selectedRoles)
+ {
+ Principal r = new Role(role);
+ for (String action : selectedActions)
+ {
+ permissions.add(new Permission(target, action, r));
+ }
+ }
+ for (Member friend : selectedFriends)
+ {
+ MemberAccount acct = (MemberAccount) entityManager.createQuery(
+ "select a from MemberAccount a where a.member = :member")
+ .setParameter("member", friend)
+ .getSingleResult();
+
+ Principal p = new SimplePrincipal(acct.getUsername());
+
+ for (String action : selectedActions)
+ {
+ permissions.add(new Permission(target, action, p));
+ }
+ }
+
+ permissionManager.grantPermissions(permissions);
+
Conversation.instance().end();
}
Modified: trunk/examples/seamspace/view/imagepermissiondetail.page.xml
===================================================================
--- trunk/examples/seamspace/view/imagepermissiondetail.page.xml 2008-05-08 02:17:52 UTC (rev 8137)
+++ trunk/examples/seamspace/view/imagepermissiondetail.page.xml 2008-05-08 06:11:45 UTC (rev 8138)
@@ -2,6 +2,8 @@
"-//JBoss/Seam Pages Configuration DTD 1.2//EN"
"http://jboss.com/products/seam/pages-1.2.dtd">
-<page action="#{permissionSearch.refresh}">
-
+<page>
+ <navigation from-action="#{imagePermission.applyPermissions}">
+ <redirect view-id="/imagepermissions.xhtml"/>
+ </navigation>
</page>
\ No newline at end of file
Modified: trunk/examples/seamspace/view/imagepermissiondetail.xhtml
===================================================================
--- trunk/examples/seamspace/view/imagepermissiondetail.xhtml 2008-05-08 02:17:52 UTC (rev 8137)
+++ trunk/examples/seamspace/view/imagepermissiondetail.xhtml 2008-05-08 06:11:45 UTC (rev 8138)
@@ -27,7 +27,8 @@
<h3>Recipients</h3>
<p>
- Select the roles and/or friends that you wish to grant permissions for the following image:
+ Select the roles and/or friends that you wish to grant permissions for the following image
+ (Ctrl-click to select multiple):
</p>
<br class="clear"/>
16 years, 6 months
Seam SVN: r8137 - trunk.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-05-07 22:17:52 -0400 (Wed, 07 May 2008)
New Revision: 8137
Modified:
trunk/build.xml
Log:
JBSEAM-2946
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-05-07 23:09:01 UTC (rev 8136)
+++ trunk/build.xml 2008-05-08 02:17:52 UTC (rev 8137)
@@ -174,6 +174,12 @@
<antlrtask target="seam-text.g" outputdirectory="${src.core.dir}/org/jboss/seam/text">
<classpath refid="compile.core.path" />
</antlrtask>
+ <move todir="${src.core.dir}/org/jboss/seam/text">
+ <fileset dir="${src.core.dir}/org/jboss/seam/text">
+ <include name="*.txt"/>
+ </fileset>
+ <mapper type="glob" from="*" to="*-bak"/>
+ </move>
</target>
<target name="compilecore" depends="initcore,select-compiler,antlr">
16 years, 6 months
Seam SVN: r8136 - branches/Seam_2_0.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-05-07 19:09:01 -0400 (Wed, 07 May 2008)
New Revision: 8136
Modified:
branches/Seam_2_0/build.xml
Log:
JBSEAM-2946
Modified: branches/Seam_2_0/build.xml
===================================================================
--- branches/Seam_2_0/build.xml 2008-05-07 18:37:50 UTC (rev 8135)
+++ branches/Seam_2_0/build.xml 2008-05-07 23:09:01 UTC (rev 8136)
@@ -170,6 +170,13 @@
<antlrtask target="seam-text.g" outputdirectory="${src.core.dir}/org/jboss/seam/text">
<classpath refid="compile.core.path" />
</antlrtask>
+
+ <move todir="${src.core.dir}/org/jboss/seam/text">
+ <fileset dir="${src.core.dir}/org/jboss/seam/text">
+ <include name="*.txt"/>
+ </fileset>
+ <mapper type="glob" from="*" to="*-bak"/>
+ </move>
</target>
<target name="compilecore" depends="initcore,select-compiler,antlr">
16 years, 6 months
Seam SVN: r8135 - branches/Seam_2_0/examples.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-05-07 14:37:50 -0400 (Wed, 07 May 2008)
New Revision: 8135
Modified:
branches/Seam_2_0/examples/readme.txt
Log:
added warning about cleaning an example prior to building for tomcat.
Modified: branches/Seam_2_0/examples/readme.txt
===================================================================
--- branches/Seam_2_0/examples/readme.txt 2008-05-07 17:15:40 UTC (rev 8134)
+++ branches/Seam_2_0/examples/readme.txt 2008-05-07 18:37:50 UTC (rev 8135)
@@ -144,6 +144,9 @@
5. (Optional) Build Seam by running "ant" the Seam root directory
+ WARNING: If you build an example for JBoss AS, remember to run ant clean
+ in the "examples/${example.name}" directory before building for Tomcat.
+
6. Build and deploy the example by running "ant tomcat.deploy"
in the Seam "examples/${example.name}" directory
16 years, 6 months
Seam SVN: r8134 - trunk/examples/dvdstore/src/com/jboss/dvd/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-05-07 13:15:40 -0400 (Wed, 07 May 2008)
New Revision: 8134
Modified:
trunk/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
trunk/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
Log:
JBSEAM-2950
Modified: trunk/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
===================================================================
--- trunk/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-07 17:07:48 UTC (rev 8133)
+++ trunk/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-07 17:15:40 UTC (rev 8134)
@@ -9,7 +9,7 @@
public interface Checkout
{
public void createOrder();
- public void submitOrder();
+ public Order submitOrder();
public void destroy();
}
Modified: trunk/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
===================================================================
--- trunk/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-07 17:07:48 UTC (rev 8133)
+++ trunk/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-07 17:15:40 UTC (rev 8134)
@@ -75,7 +75,7 @@
@End
@CreateProcess(definition="OrderManagement", processKey="#{completedOrder.orderId}")
@Restrict("#{identity.loggedIn}")
- public void submitOrder() {
+ public Order submitOrder() {
try {
completedOrder = purchase(customer, currentOrder);
@@ -88,7 +88,10 @@
Contexts.getEventContext().set("prod", product);
FacesMessages.instance().addFromResourceBundle("checkoutInsufficientQuantity");
}
+ return null;
}
+
+ return completedOrder;
}
private Order purchase(Customer customer, Order order)
16 years, 6 months
Seam SVN: r8133 - branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-05-07 13:07:48 -0400 (Wed, 07 May 2008)
New Revision: 8133
Modified:
branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/FullTextSearchAction.java
Log:
JBSEAM-2950
Modified: branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
===================================================================
--- branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-07 15:08:05 UTC (rev 8132)
+++ branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-07 17:07:48 UTC (rev 8133)
@@ -9,7 +9,7 @@
public interface Checkout
{
public void createOrder();
- public void submitOrder();
+ public Order submitOrder();
public void destroy();
}
Modified: branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
===================================================================
--- branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-07 15:08:05 UTC (rev 8132)
+++ branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-07 17:07:48 UTC (rev 8133)
@@ -75,7 +75,7 @@
@End
@CreateProcess(definition="OrderManagement", processKey="#{completedOrder.orderId}")
@Restrict("#{identity.loggedIn}")
- public void submitOrder() {
+ public Order submitOrder() {
try {
completedOrder = purchase(customer, currentOrder);
@@ -88,7 +88,10 @@
Contexts.getEventContext().set("prod", product);
FacesMessages.instance().addFromResourceBundle("checkoutInsufficientQuantity");
}
+ return null;
}
+
+ return completedOrder;
}
private Order purchase(Customer customer, Order order)
Modified: branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/FullTextSearchAction.java
===================================================================
--- branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/FullTextSearchAction.java 2008-05-07 15:08:05 UTC (rev 8132)
+++ branches/Seam_2_0/examples/dvdstore/src/com/jboss/dvd/seam/FullTextSearchAction.java 2008-05-07 17:07:48 UTC (rev 8133)
@@ -106,7 +106,6 @@
@Begin(join = true)
public void selectFromRequest() {
- System.out.println("*** ID=" + id);
if (id != null) {
dvd = em.find(Product.class, id);
} else if (selectedProduct != null) {
@@ -199,7 +198,6 @@
}
public void setSelectedId(Long id) {
- System.out.println("- set id " + id);
this.id = id;
}
16 years, 6 months
Seam SVN: r8132 - in trunk/examples/seamspace: view and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-05-07 11:08:05 -0400 (Wed, 07 May 2008)
New Revision: 8132
Added:
trunk/examples/seamspace/view/imagepermissiondetail.page.xml
trunk/examples/seamspace/view/imagepermissiondetail.xhtml
Removed:
trunk/examples/seamspace/view/permissiondetail.xhtml
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java
trunk/examples/seamspace/view/friendcomment.xhtml
trunk/examples/seamspace/view/friendrequest.xhtml
trunk/examples/seamspace/view/imagepermissions.page.xml
trunk/examples/seamspace/view/imagepermissions.xhtml
Log:
permission details view for member images
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java
===================================================================
--- trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/FriendAction.java 2008-05-07 15:08:05 UTC (rev 8132)
@@ -23,7 +23,7 @@
import org.jboss.seam.security.Identity;
@Scope(CONVERSATION)
-@Name("friend")
+@Name("friendAction")
public class FriendAction implements Serializable
{
private static final long serialVersionUID = 4565339001481077911L;
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
===================================================================
--- trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-07 15:08:05 UTC (rev 8132)
@@ -3,6 +3,8 @@
import static org.jboss.seam.ScopeType.CONVERSATION;
import java.io.Serializable;
+import java.security.Principal;
+import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
@@ -13,6 +15,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;
import org.jboss.seam.security.management.IdentityManager;
+import org.jboss.seam.security.permission.Permission;
import org.jboss.seam.security.permission.PermissionManager;
import org.jboss.seam.security.permission.action.PermissionSearch;
@@ -26,9 +29,7 @@
private List<Member> selectedFriends;
private List<String> selectedActions;
- private List<String> availableRoles;
private List<Member> availableFriends;
- private List<String> availableActions;
@In IdentityManager identityManager;
@In PermissionManager permissionManager;
@@ -39,19 +40,42 @@
private MemberImage target;
+ private Principal recipient;
+
@SuppressWarnings("unchecked")
@Begin(nested = true)
public void createPermission()
{
target = (MemberImage) permissionSearch.getTarget();
- availableRoles = identityManager.listRoles();
+ selectedFriends = new ArrayList<Member>();
+
availableFriends = entityManager.createQuery(
"select f.friend from MemberFriend f where f.member = :member and f.authorized = true")
.setParameter("member", target.getMember())
- .getResultList();
+ .getResultList();
+ }
+
+ @Begin(nested = true)
+ public void editPermission()
+ {
+ target = (MemberImage) permissionSearch.getTarget();
+ recipient = permissionSearch.getSelectedPermission().getRecipient();
+
+ List<Permission> permissions = permissionManager.listPermissions(target);
- availableActions = permissionManager.listAvailableActions(target);
+ selectedActions = new ArrayList<String>();
+
+ for (Permission permission : permissions)
+ {
+ if (permission.getRecipient().equals(recipient))
+ {
+ if (!selectedActions.contains(permission.getAction()))
+ {
+ selectedActions.add(permission.getAction());
+ }
+ }
+ }
}
public List<String> getSelectedRoles()
@@ -86,23 +110,23 @@
public void applyPermissions()
{
+ // TODO apply permission changes here
-
Conversation.instance().end();
}
- public List<String> getAvailableRoles()
+ public List<Member> getAvailableFriends()
{
- return availableRoles;
+ return availableFriends;
}
- public List<Member> getAvailableFriends()
+ public MemberImage getTarget()
{
- return availableFriends;
+ return target;
}
- public List<String> getAvailableActions()
+ public Principal getRecipient()
{
- return availableActions;
+ return recipient;
}
}
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java
===================================================================
--- trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java 2008-05-07 15:08:05 UTC (rev 8132)
@@ -9,6 +9,12 @@
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
+import org.jboss.seam.annotations.security.permission.Permission;
+import org.jboss.seam.annotations.security.permission.Permissions;
+
+@Permissions({
+ @Permission(action = "view")
+})
@Entity
public class MemberImage implements Serializable
{
Modified: trunk/examples/seamspace/view/friendcomment.xhtml
===================================================================
--- trunk/examples/seamspace/view/friendcomment.xhtml 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/view/friendcomment.xhtml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -45,7 +45,7 @@
<h:inputTextarea id="comment" value="#{friendComment.comment}"/><br/>
<div class="buttons">
- <h:commandButton action="#{friend.saveComment}" value="Add comment" styleClass="action"/>
+ <h:commandButton action="#{friendAction.saveComment}" value="Add comment" styleClass="action"/>
<h:commandButton value="Preview" styleClass="action"/>
</div>
Modified: trunk/examples/seamspace/view/friendrequest.xhtml
===================================================================
--- trunk/examples/seamspace/view/friendrequest.xhtml 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/view/friendrequest.xhtml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -39,7 +39,7 @@
<h:inputTextarea id="introduction" value="#{friendRequest.introduction}"/><br/>
<div class="buttons">
- <h:commandButton action="#{friend.saveRequest}" value="Send request" styleClass="action"/>
+ <h:commandButton action="#{friendAction.saveRequest}" value="Send request" styleClass="action"/>
</div>
<br class="clear"/>
Added: trunk/examples/seamspace/view/imagepermissiondetail.page.xml
===================================================================
--- trunk/examples/seamspace/view/imagepermissiondetail.page.xml (rev 0)
+++ trunk/examples/seamspace/view/imagepermissiondetail.page.xml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -0,0 +1,7 @@
+<!DOCTYPE page PUBLIC
+ "-//JBoss/Seam Pages Configuration DTD 1.2//EN"
+ "http://jboss.com/products/seam/pages-1.2.dtd">
+
+<page action="#{permissionSearch.refresh}">
+
+</page>
\ No newline at end of file
Added: trunk/examples/seamspace/view/imagepermissiondetail.xhtml
===================================================================
--- trunk/examples/seamspace/view/imagepermissiondetail.xhtml (rev 0)
+++ trunk/examples/seamspace/view/imagepermissiondetail.xhtml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -0,0 +1,88 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <ui:composition template="template.xhtml">
+
+ <ui:define name="head">
+ <link href="style/security.css" rel="stylesheet" type="text/css"/>
+ </ui:define>
+
+ <ui:define name="content">
+
+ <div id="contentMain">
+
+ <h2>Permission Details</h2>
+
+ <hr/>
+
+ <h:messages globalOnly="true"/>
+
+ <h:form>
+ <s:fragment rendered="#{imagePermission.recipient eq null}">
+ <h3>Recipients</h3>
+
+ <p>
+ Select the roles and/or friends that you wish to grant permissions for the following image:
+ </p>
+
+ <br class="clear"/>
+
+ <div class="thumbnail">
+ <h:graphicImage value="/content/images?id=#{permissionSearch.target.imageId}&width=90"/>
+ </div>
+
+ <br class="clear"/>
+
+ <div class="formRow">
+ <h:outputLabel for="roles" value="Roles" styleClass="formLabel"/>
+ <div class="selectMany">
+ <h:selectManyListbox id="roles" value="#{imagePermission.selectedRoles}" styleClass="roles" size="4">
+ <s:selectItems value="#{identityManager.listRoles()}" var="role" label="#{role}"/>
+ </h:selectManyListbox>
+ </div>
+ <div class="validationError"><h:message for="actions"/></div>
+ </div>
+
+ <div class="formRow">
+ <h:outputLabel for="friends" value="Friends" styleClass="formLabel"/>
+ <div class="selectMany">
+ <h:selectManyListbox id="friends" value="#{imagePermission.selectedFriends}" styleClass="roles" size="6">
+ <s:selectItems value="#{imagePermission.availableFriends}" var="friend" label="#{friend.memberName}"/>
+ <s:convertEntity />
+ </h:selectManyListbox>
+ </div>
+ <div class="validationError"><h:message for="friends"/></div>
+ </div>
+
+ </s:fragment>
+
+ <div class="formRow">
+ <h:outputLabel for="actions" value="Actions allowed" styleClass="formLabel"/>
+ <div class="selectMany">
+ <h:selectManyCheckbox id="actions" value="#{imagePermission.selectedActions}" layout="pageDirection" styleClass="roles">
+ <s:selectItems value="#{permissionManager.listAvailableActions(imagePermission.target)}" var="action" label="#{action}"/>
+ </h:selectManyCheckbox>
+ </div>
+ <div class="validationError"><h:message for="actions"/></div>
+ </div>
+
+ <div class="formButtons">
+ <h:commandButton value="Save" action="#{imagePermission.applyPermissions}" styleClass="formButton"/>
+ <s:button view="/imagepermissions.xhtml" value="Cancel" propagation="end" styleClass="formButton"/>
+ </div>
+
+ <br class="clear"/>
+
+ </h:form>
+
+ </div>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Modified: trunk/examples/seamspace/view/imagepermissions.page.xml
===================================================================
--- trunk/examples/seamspace/view/imagepermissions.page.xml 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/view/imagepermissions.page.xml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -3,5 +3,7 @@
"http://jboss.com/products/seam/pages-1.2.dtd">
<page action="#{permissionSearch.refresh}">
-
+ <navigation from-action="#{imagePermission.createPermission}">
+ <redirect view-id="/imagepermissiondetail.xhtml"/>
+ </navigation>
</page>
\ No newline at end of file
Modified: trunk/examples/seamspace/view/imagepermissions.xhtml
===================================================================
--- trunk/examples/seamspace/view/imagepermissions.xhtml 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/view/imagepermissions.xhtml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -6,13 +6,13 @@
xmlns:s="http://jboss.com/products/seam/taglib">
<ui:composition template="template.xhtml">
-
+
<ui:define name="head">
<link href="style/security.css" rel="stylesheet" type="text/css"/>
- </ui:define>
-
+ </ui:define>
+
<ui:define name="content">
-
+
<script type="text/javascript">
function confirmRevoke()
{
@@ -22,26 +22,28 @@
<div id="contentMain">
- <h2>Image Permissions</h2>
-
+ <h2>Image Permissions</h2>
+
<div style="float: left">
<h3>Managing permissions for image:</h3>
</div>
-
- <div class="thumbnail" style="float:right">
+
+ <br class="clear"/>
+
+ <div class="thumbnail">
<h:graphicImage value="/content/images?id=#{permissionSearch.target.imageId}&width=90"/>
- </div>
-
+ </div>
+
<br class="clear"/>
-
- <s:button action="#{imagePermission.createPermission}"
- styleClass="newpermission"
+
+ <s:button action="#{imagePermission.createPermission}"
+ styleClass="newpermission"
rendered="#{s:hasPermission(permissionSearch.target, 'seam.grant-permission')}"/>
-
- <h:dataTable
+
+ <h:dataTable
id="threads"
- value="#{permissions}"
- var="permission"
+ value="#{permissions}"
+ var="permission"
styleClass="security"
cellspacing="0"
headerClass="header"
@@ -63,15 +65,15 @@
<f:facet name="header">
Action
</f:facet>
- <s:link value="Revoke All" action="#{permissionSearch.revokeSelected}"
+ <s:link value="Revoke All" action="#{permissionSearch.revokeSelected}"
rendered="#{s:hasPermission(permissionSearch.target, 'seam.revoke-permission')}"
onclick="return confirmRevoke()"/>
</h:column>
- </h:dataTable>
+ </h:dataTable>
</div>
-
+
</ui:define>
-
+
</ui:composition>
</html>
Deleted: trunk/examples/seamspace/view/permissiondetail.xhtml
===================================================================
--- trunk/examples/seamspace/view/permissiondetail.xhtml 2008-05-07 15:07:06 UTC (rev 8131)
+++ trunk/examples/seamspace/view/permissiondetail.xhtml 2008-05-07 15:08:05 UTC (rev 8132)
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:s="http://jboss.com/products/seam/taglib">
-
- <ui:composition template="template.xhtml">
-
- <ui:define name="head">
- <link href="style/security.css" rel="stylesheet" type="text/css"/>
- </ui:define>
-
- <ui:define name="content">
-
- <div id="contentMain">
-
- <h2>Permission Details</h2>
-
- <h:messages globalOnly="true"/>
-
- <h3>Granting permissions for: #{permissionSearch.target}</h3>
-
- <h:form>
-
- <div class="formRow">
- <h:outputLabel for="recipient" value="Recipient" styleClass="formLabel"/>
- <h:inputText id="recipient" value="#{permissionAction.recipient}"/>
- <div class="validationError"><h:message for="recipient"/></div>
- </div>
-
- <div class="formRow">
- <h:outputLabel for="action" value="Action" styleClass="formLabel"/>
- <h:inputText id="action" value="#{permissionAction.action}"/>
- <div class="validationError"><h:message for="action"/></div>
- </div>
-
- <div class="formRow">
- <h:outputLabel for="actions" value="Allowable actions" styleClass="formLabel"/>
- <div class="selectMany">
- <h:selectManyCheckbox id="actions" value="#{permissionAction.actions}" layout="pageDirection" styleClass="roles">
- <s:selectItems value="#{permissionManager.listAvailableActions(permissionAction.target)}" var="action" label="#{action}"/>
- </h:selectManyCheckbox>
- </div>
- <div class="validationError"><h:message for="actions"/></div>
- </div>
-
- <div class="formButtons">
- <h:commandButton value="Save" action="#{permissionAction.save}" styleClass="formButton"/>
- <s:button view="/permissionmanager.xhtml" value="Cancel" propagation="end" styleClass="formButton"/>
- </div>
-
- <br class="clear"/>
-
- </h:form>
-
- </div>
-
- </ui:define>
-
- </ui:composition>
-</html>
16 years, 6 months
Seam SVN: r8131 - trunk/src/main/org/jboss/seam/security/permission.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-05-07 11:07:06 -0400 (Wed, 07 May 2008)
New Revision: 8131
Modified:
trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
Log:
support for bulk add/revoke permissions
Modified: trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-05-07 14:56:13 UTC (rev 8130)
+++ trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-05-07 15:07:06 UTC (rev 8131)
@@ -25,7 +25,6 @@
import org.jboss.seam.annotations.security.permission.PermissionRole;
import org.jboss.seam.annotations.security.permission.PermissionTarget;
import org.jboss.seam.annotations.security.permission.PermissionUser;
-import org.jboss.seam.annotations.security.permission.Permissions;
import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Expressions.ValueExpression;
import org.jboss.seam.log.LogProvider;
@@ -276,6 +275,13 @@
}
}
+ public boolean grantPermissions(List<Permission> permissions)
+ {
+ // TODO implement
+
+ return false;
+ }
+
private String getDiscriminatorValue(boolean isRole)
{
PermissionDiscriminator discriminator = discriminatorProperty.getAnnotation();
@@ -298,8 +304,14 @@
{
return false;
}
- }
+ }
+ public boolean revokePermissions(List<Permission> permissions)
+ {
+ // TODO implement
+ return false;
+ }
+
/**
* If the user or role properties in the entity class refer to other entities, then this method
* uses the JpaIdentityStore (if available) to lookup that user or role entity. Otherwise it
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-05-07 14:56:13 UTC (rev 8130)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-05-07 15:07:06 UTC (rev 8131)
@@ -103,12 +103,30 @@
return permissionStore.grantPermission(permission);
}
+ public boolean grantPermissions(List<Permission> permissions)
+ {
+ for (Permission permission : permissions)
+ {
+ Identity.instance().checkPermission(permission.getTarget(), PERMISSION_GRANT);
+ }
+ return permissionStore.grantPermissions(permissions);
+ }
+
public boolean revokePermission(Permission permission)
{
Identity.instance().checkPermission(permission.getTarget(), PERMISSION_REVOKE);
return permissionStore.revokePermission(permission);
}
+ public boolean revokePermissions(List<Permission> permissions)
+ {
+ for (Permission permission : permissions)
+ {
+ Identity.instance().checkPermission(permission.getTarget(), PERMISSION_REVOKE);
+ }
+ return permissionStore.revokePermissions(permissions);
+ }
+
public List<String> listAvailableActions(Object target)
{
return permissionStore.listAvailableActions(target);
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-05-07 14:56:13 UTC (rev 8130)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-05-07 15:07:06 UTC (rev 8131)
@@ -12,6 +12,8 @@
List<Permission> listPermissions(Object target);
List<Permission> listPermissions(Object target, String action);
boolean grantPermission(Permission permission);
+ boolean grantPermissions(List<Permission> permissions);
boolean revokePermission(Permission permission);
+ boolean revokePermissions(List<Permission> permissions);
List<String> listAvailableActions(Object target);
}
16 years, 6 months