Seam SVN: r7518 - trunk/src/main/org/jboss/seam/security.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-03-07 02:01:58 -0500 (Fri, 07 Mar 2008)
New Revision: 7518
Modified:
trunk/src/main/org/jboss/seam/security/Identity.java
Log:
fix unit test
Modified: trunk/src/main/org/jboss/seam/security/Identity.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/Identity.java 2008-03-07 05:58:33 UTC (rev 7517)
+++ trunk/src/main/org/jboss/seam/security/Identity.java 2008-03-07 07:01:58 UTC (rev 7518)
@@ -102,7 +102,11 @@
public void create()
{
subject = new Subject();
- permissionMapper = (PermissionMapper) Component.getInstance(PermissionMapper.class);
+
+ if (Contexts.isApplicationContextActive())
+ {
+ permissionMapper = (PermissionMapper) Component.getInstance(PermissionMapper.class);
+ }
}
public static boolean isSecurityEnabled()
@@ -533,6 +537,8 @@
return true;
}
+ if (permissionMapper == null) return false;
+
if (arg != null)
{
return permissionMapper.resolvePermission(arg[0], action);
@@ -550,6 +556,8 @@
return true;
}
+ if (permissionMapper == null) return false;
+
return permissionMapper.resolvePermission(target, action);
}
18 years, 1 month
Seam SVN: r7517 - trunk/src/ioc/org/jboss/seam/ioc.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-03-07 00:58:33 -0500 (Fri, 07 Mar 2008)
New Revision: 7517
Modified:
trunk/src/ioc/org/jboss/seam/ioc/IoCComponent.java
Log:
JBSEAM-2708, added startupDepends attribute to components.xml
Modified: trunk/src/ioc/org/jboss/seam/ioc/IoCComponent.java
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/IoCComponent.java 2008-03-07 04:52:03 UTC (rev 7516)
+++ trunk/src/ioc/org/jboss/seam/ioc/IoCComponent.java 2008-03-07 05:58:33 UTC (rev 7517)
@@ -53,7 +53,7 @@
*/
public IoCComponent(Class clazz, String name, ScopeType scope)
{
- super(clazz, name, scope, false, null);
+ super(clazz, name, scope, false, new String[0], null);
}
protected abstract String getIoCName();
18 years, 1 month
Seam SVN: r7516 - in trunk/src/main/org/jboss/seam: init and 1 other directory.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-03-06 23:52:03 -0500 (Thu, 06 Mar 2008)
New Revision: 7516
Modified:
trunk/src/main/org/jboss/seam/Component.java
trunk/src/main/org/jboss/seam/components-2.1.xsd
trunk/src/main/org/jboss/seam/init/ComponentDescriptor.java
trunk/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-2708, added startupDepends attribute to components.xml
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2008-03-06 10:11:52 UTC (rev 7515)
+++ trunk/src/main/org/jboss/seam/Component.java 2008-03-07 04:52:03 UTC (rev 7516)
@@ -205,27 +205,28 @@
// only used for tests
public Component(Class<?> clazz, String componentName)
{
- this(clazz, componentName, Seam.getComponentScope(clazz), false, null);
+ this(clazz, componentName, Seam.getComponentScope(clazz), false, new String[0], null);
}
// only used for tests
public Component(Class<?> clazz, Context applicationContext)
{
- this( clazz, getComponentName(clazz), Seam.getComponentScope(clazz), false, null, applicationContext );
+ this( clazz, getComponentName(clazz), Seam.getComponentScope(clazz), false, new String[0], null, applicationContext );
}
- public Component(Class<?> clazz, String componentName, ScopeType componentScope, boolean startup, String jndiName)
+ public Component(Class<?> clazz, String componentName, ScopeType componentScope, boolean startup, String[] dependencies, String jndiName)
{
- this(clazz, componentName, componentScope, startup, jndiName, Contexts.getApplicationContext());
+ this(clazz, componentName, componentScope, startup, dependencies, jndiName, Contexts.getApplicationContext());
}
- private Component(Class<?> beanClass, String componentName, ScopeType componentScope, boolean startup, String componentJndiName, Context applicationContext)
+ private Component(Class<?> beanClass, String componentName, ScopeType componentScope, boolean startup, String[] dependencies, String componentJndiName, Context applicationContext)
{
super(beanClass);
name = componentName;
scope = componentScope;
this.startup = startup;
+ this.dependencies = dependencies;
type = Seam.getComponentType( getBeanClass() );
interceptionEnabled = Seam.isInterceptionEnabled( getBeanClass() );
perNestedConversation = hasAnnotation(getBeanClass(), PerNestedConversation.class);
@@ -302,7 +303,10 @@
throw new IllegalArgumentException("@Startup only supported for SESSION or APPLICATION scoped components: " + name);
}
Startup annotation = getBeanClass().getAnnotation(Startup.class);
- dependencies = annotation==null ? new String[0] : annotation.depends();
+ if (dependencies.length == 0 && annotation != null)
+ {
+ dependencies = annotation.depends();
+ }
}
}
Modified: trunk/src/main/org/jboss/seam/components-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/components-2.1.xsd 2008-03-06 10:11:52 UTC (rev 7515)
+++ trunk/src/main/org/jboss/seam/components-2.1.xsd 2008-03-07 04:52:03 UTC (rev 7516)
@@ -56,6 +56,7 @@
<xs:attribute name="installed" default="true" type="xs:boolean"/>
<xs:attribute name="auto-create" default="false" type="xs:boolean"/>
<xs:attribute name="startup" default="false" type="xs:boolean"/>
+ <xs:attribute name="startupDepends" type="xs:string"/>
</xs:attributeGroup>
<xs:element name="factory">
<xs:complexType>
Modified: trunk/src/main/org/jboss/seam/init/ComponentDescriptor.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/ComponentDescriptor.java 2008-03-06 10:11:52 UTC (rev 7515)
+++ trunk/src/main/org/jboss/seam/init/ComponentDescriptor.java 2008-03-07 04:52:03 UTC (rev 7516)
@@ -26,13 +26,14 @@
protected Boolean installed;
protected Boolean autoCreate;
protected Boolean startup;
+ protected String[] startupDepends;
protected Integer precedence;
/**
* For components.xml
*/
public ComponentDescriptor(String name, Class<?> componentClass, ScopeType scope,
- Boolean autoCreate, Boolean startup, String jndiName, Boolean installed, Integer precedence)
+ Boolean autoCreate, Boolean startup, String[] startupDepends, String jndiName, Boolean installed, Integer precedence)
{
this.name = name;
this.componentClass = componentClass;
@@ -42,6 +43,7 @@
this.autoCreate = autoCreate;
this.precedence = precedence;
this.startup = startup;
+ this.startupDepends = startupDepends;
}
/**
@@ -112,8 +114,21 @@
return pkg!=null && pkg.isAnnotationPresent(AutoCreate.class);
}
- public String[] getDependencies()
+ public String[] getStartupDependencies()
{
+ if (startupDepends != null && startupDepends.length > 0) {
+ return startupDepends;
+ }
+ Startup startup = componentClass.getAnnotation(Startup.class);
+ if (startup != null)
+ {
+ return startup.depends();
+ }
+ return new String[0];
+ }
+
+ public String[] getDependencies()
+ {
Install install = componentClass.getAnnotation(Install.class);
if (install == null)
{
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-03-06 10:11:52 UTC (rev 7515)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-03-07 04:52:03 UTC (rev 7516)
@@ -86,6 +86,7 @@
nonPropertyAttributes.add("installed");
nonPropertyAttributes.add("scope");
nonPropertyAttributes.add("startup");
+ nonPropertyAttributes.add("startupDepends");
nonPropertyAttributes.add("class");
nonPropertyAttributes.add("jndi-name");
nonPropertyAttributes.add("precedence");
@@ -370,6 +371,9 @@
Boolean autoCreate = autocreateAttribute==null ? null : "true".equals(autocreateAttribute);
String startupAttribute = component.attributeValue("startup");
Boolean startup = startupAttribute==null ? null : "true".equals(startupAttribute);
+ String startupDependsAttribute = component.attributeValue("startupDepends");
+ String[] startupDepends = startupDependsAttribute==null ? new String[0] : startupDependsAttribute.split(" ");
+
if (className != null)
{
Class<?> clazz = getClassUsingImports(className);
@@ -386,7 +390,7 @@
name = clazz.getAnnotation(Name.class).value();
}
- ComponentDescriptor descriptor = new ComponentDescriptor(name, clazz, scope, autoCreate, startup, jndiName, installed, precedence);
+ ComponentDescriptor descriptor = new ComponentDescriptor(name, clazz, scope, autoCreate, startup, startupDepends, jndiName, installed, precedence);
addComponentDescriptor(descriptor);
installedComponentClasses.add(clazz);
}
@@ -977,6 +981,7 @@
name,
descriptor.getScope(),
descriptor.isStartup(),
+ descriptor.getStartupDependencies(),
descriptor.getJndiName()
);
context.set(componentName, component);
18 years, 1 month
Seam SVN: r7515 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/core/dao and 3 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-03-06 05:11:52 -0500 (Thu, 06 Mar 2008)
New Revision: 7515
Added:
trunk/examples/wiki/view/themes/sfwkorg/img/seam_icon_large.png
Modified:
trunk/examples/wiki/src/etc/WEB-INF/urlrewrite.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/TagDAO.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
trunk/examples/wiki/view/plugins/tags/plugin.xhtml
Log:
Optimized forum queries
Modified: trunk/examples/wiki/src/etc/WEB-INF/urlrewrite.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/urlrewrite.xml 2008-03-05 19:03:14 UTC (rev 7514)
+++ trunk/examples/wiki/src/etc/WEB-INF/urlrewrite.xml 2008-03-06 10:11:52 UTC (rev 7515)
@@ -31,6 +31,13 @@
<to last="true" type="temporary-redirect">/robots.txt</to>
</rule>
+ <!-- Disable anything that comes out of Microsoft -->
+ <rule>
+ <from>.*</from>
+ <condition name="remote-addr">65.55.210.81</condition>
+ <to last="true" type="temporary-redirect">/robots.txt</to>
+ </rule>
+
<!-- Default browser -->
<rule>
<from>.*</from>
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/TagDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/TagDAO.java 2008-03-05 19:03:14 UTC (rev 7514)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/TagDAO.java 2008-03-06 10:11:52 UTC (rev 7515)
@@ -28,6 +28,7 @@
@In
protected EntityManager restrictedEntityManager;
+ // TODO: This query needs to be optimized, the nested subselect with in() is not good for MySQL, needs to be a join
public List<DisplayTagCount> findTagCounts(WikiDirectory startDir, WikiFile ignoreFile, int limit, long minimumCount) {
StringBuilder queryString = new StringBuilder();
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2008-03-05 19:03:14 UTC (rev 7514)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2008-03-06 10:11:52 UTC (rev 7515)
@@ -159,7 +159,8 @@
.list();
getSession(true).getNamedQuery(unreadRepliesQuery)
- .setParameter("parentDir", directory)
+ .setParameter("parentDirId", directory.getId())
+ .setParameter("readAccessLevel", currentAccessLevel)
.setParameter("lastLoginDate", lastLoginDate)
.setComment("Finding unread replies")
.setCacheable(true)
@@ -220,10 +221,10 @@
.setResultTransformer(
new ResultTransformer() {
public Object transformTuple(Object[] result, String[] strings) {
- if (topicInfoMap.containsKey((Long)result[0])) {
- TopicInfo info = topicInfoMap.get( (Long)result[0] );
- info.setNumOfReplies((Long)result[1]);
- info.setLastComment((WikiComment)result[2]);
+ if (topicInfoMap.containsKey((Long)result[1])) {
+ TopicInfo info = topicInfoMap.get( (Long)result[1] );
+ info.setNumOfReplies((Long)result[2]);
+ info.setLastComment((WikiComment)result[0]);
}
return null;
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2008-03-05 19:03:14 UTC (rev 7514)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2008-03-06 10:11:52 UTC (rev 7515)
@@ -57,6 +57,7 @@
group by dir0.NODE_ID
</sql-query>
+ <!-- TODO: This is based on the idea that the last topic is "one in a second", we should use a subselect with limit 1 order by -->
<query name="forumLastTopic">
select
f.id, t
@@ -137,19 +138,32 @@
and t.createdOn > :lastLoginDate
]]></query>
- <!-- TODO: Optimize this with native SQL, move where-clause subselect into from-clause join -->
- <query name="forumUnreadReplies"><![CDATA[
- select
- distinct t.id, t.parent.id
- from
- WikiDirectory f, WikiDocument t, WikiComment c
- where
- f.parent = :parentDir
- and t.parent = f
- and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
- and c.nodeInfo.nsThread in (select c2.nodeInfo.nsThread from WikiComment c2 where c2.parent = t)
- and c.createdOn > :lastLoginDate
- ]]></query>
+ <sql-query name="forumUnreadReplies">
+ <return-scalar column="UNREAD_TOPIC_ID" type="long"/>
+ <return-scalar column="FORUM_ID" type="long"/>
+ <![CDATA[
+ select
+ distinct doc0.NODE_ID as UNREAD_TOPIC_ID, doc1.PARENT_NODE_ID as FORUM_ID
+ from
+ WIKI_DIRECTORY dir0
+ inner join WIKI_NODE dir1 on dir0.NODE_ID=dir1.NODE_ID,
+ WIKI_DOCUMENT doc0
+ inner join WIKI_NODE doc1 on doc0.NODE_ID=doc1.NODE_ID
+ inner join WIKI_NODE ct0 on ct0.PARENT_NODE_ID = doc1.NODE_ID
+ inner join WIKI_COMMENT ct1 on ct0.NODE_ID = ct1.NODE_ID,
+ WIKI_COMMENT c0
+ inner join WIKI_NODE c1 on c0.NODE_ID=c1.NODE_ID
+ where
+ dir1.READ_ACCESS_LEVEL <= :readAccessLevel
+ and doc1.READ_ACCESS_LEVEL <= :readAccessLevel
+ and c1.READ_ACCESS_LEVEL <= :readAccessLevel
+ and dir1.PARENT_NODE_ID= :parentDirId
+ and doc1.PARENT_NODE_ID=dir1.NODE_ID
+ and (doc0.HEADER_MACROS like '%forumPosting%' or doc0.HEADER_MACROS like '%forumStickyPosting%')
+ and c0.NS_THREAD in (ct1.NS_THREAD)
+ and c1.CREATED_ON > :lastLoginDate
+ ]]>
+ </sql-query>
<query name="forumUnreadTopicsInForum"><![CDATA[
select
@@ -162,18 +176,28 @@
and t.createdOn > :lastLoginDate
]]></query>
- <!-- TODO: Optimize this with native SQL, move where-clause subselect into from-clause join -->
- <query name="forumUnreadRepliesInForum"><![CDATA[
- select
- distinct t.id, t.parent.id
- from
- WikiDocument t, WikiComment c
- where
- t.parent = :parentDir
- and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
- and c.nodeInfo.nsThread in (select c2.nodeInfo.nsThread from WikiComment c2 where c2.parent = t)
- and c.createdOn > :lastLoginDate
- ]]></query>
+ <sql-query name="forumUnreadRepliesInForum">
+ <return-scalar column="UNREAD_TOPIC_ID" type="long"/>
+ <return-scalar column="FORUM_ID" type="long"/>
+ <![CDATA[
+ select
+ distinct doc0.NODE_ID as UNREAD_TOPIC_ID, doc1.PARENT_NODE_ID as FORUM_ID
+ from
+ WIKI_DOCUMENT doc0
+ inner join WIKI_NODE doc1 on doc0.NODE_ID=doc1.NODE_ID
+ inner join WIKI_NODE ct0 on ct0.PARENT_NODE_ID = doc1.NODE_ID
+ inner join WIKI_COMMENT ct1 on ct0.NODE_ID = ct1.NODE_ID,
+ WIKI_COMMENT c0
+ inner join WIKI_NODE c1 on c0.NODE_ID=c1.NODE_ID
+ where
+ doc1.READ_ACCESS_LEVEL <= :readAccessLevel
+ and c1.READ_ACCESS_LEVEL <= :readAccessLevel
+ and doc1.PARENT_NODE_ID= :parentDirId
+ and (doc0.HEADER_MACROS like '%forumPosting%' or doc0.HEADER_MACROS like '%forumStickyPosting%')
+ and c0.NS_THREAD in (ct1.NS_THREAD)
+ and c1.CREATED_ON > :lastLoginDate
+ ]]>
+ </sql-query>
<query name="forumTopicsCount">
select count(t) from WikiDocument t
@@ -240,35 +264,78 @@
by STICKY desc, LAST_POST desc
]]></sql-query>
- <!-- TODO: Optimize this with native SQL, move where-clause subselect into from-clause join-->
- <query name="forumTopicsReplies"><![CDATA[
+ <sql-query name="forumTopicsReplies">
+ <return alias="c" class="org.jboss.seam.wiki.core.model.WikiComment"/>
+ <return-join alias="u" property="c.createdBy"/>
+ <return-scalar column="TOPIC_ID" type="long"/>
+ <return-scalar column="NUM_OF_REPLIES" type="long"/>
+ <![CDATA[
select
- t.id,
- count(c),
- c2
+ cl1.NODE_ID as NODE_ID,
+ cl1.OBJ_VERSION as OBJ_VERSION,
+ cl1.RATING as RATING,
+ cl1.AREA_NR as AREA_NR,
+ cl1.NAME as NAME,
+ cl1.WIKINAME as WIKINAME,
+ cl1.CREATED_ON as CREATED_ON,
+ cl1.CREATED_BY_USER_ID as CREATED_BY_USER_ID,
+ cl1.LAST_MODIFIED_ON as LAST_MODIFIED_ON,
+ cl1.LAST_MODIFIED_BY_USER_ID as LAST_MODIFIED_BY_USER_ID,
+ cl1.WRITE_ACCESS_LEVEL as WRITE_ACCESS_LEVEL,
+ cl1.READ_ACCESS_LEVEL as READ_ACCESS_LEVEL,
+ cl1.WRITE_PROTECTED as WRITE_PROTECTED,
+ cl1.PARENT_NODE_ID as PARENT_NODE_ID,
+
+ cl0.SUBJECT as SUBJECT,
+ cl0.FROM_USER_NAME as FROM_USER_NAME,
+ cl0.FROM_USER_EMAIL as FROM_USER_EMAIL,
+ cl0.FROM_USER_HOMEPAGE as FROM_USER_HOMEPAGE,
+ cl0.USE_WIKI_TEXT as USE_WIKI_TEXT,
+ cl0.NS_LEFT as NS_LEFT,
+ cl0.NS_RIGHT as NS_RIGHT,
+ cl0.NS_THREAD as NS_THREAD,
+
+ u.USER_ID, u.ACTIVATED, u.ACTIVATION_CODE, u.CREATED_ON, u.EMAIL, u.FIRSTNAME, u.LAST_LOGIN_ON,
+ u.LASTNAME, u.MEMBER_HOME_WIKI_DIRECTORY_ID, u.PASSWORDHASH, u.USER_PROFILE_ID, u.USERNAME, u.OBJ_VERSION,
+
+ doc0.NODE_ID as TOPIC_ID,
+ count(c0.NODE_ID) as NUM_OF_REPLIES
from
- WikiDocument t,
- WikiComment c,
- WikiComment c2 join fetch c2.createdBy u
+ WIKI_DOCUMENT doc0
+ inner join WIKI_NODE ct0 on ct0.PARENT_NODE_ID = doc0.NODE_ID
+ inner join WIKI_COMMENT ct1 on ct0.NODE_ID = ct1.NODE_ID,
+ WIKI_COMMENT c0,
+ WIKI_COMMENT cl0
+ inner join WIKI_NODE cl1 on cl0.NODE_ID = cl1.NODE_ID
+ inner join USERS u on cl1.CREATED_BY_USER_ID = u.USER_ID
where
- t.id in (:topicIds)
- and c.nodeInfo.nsThread in (select c3.nodeInfo.nsThread from WikiComment c3 where c3.parent = t)
- and c2.createdOn =
- (select max(c4.createdOn) from WikiComment c4 where c4.nodeInfo.nsThread in
- (select c5.nodeInfo.nsThread from WikiComment c5 where c5.parent = t) )
+ doc0.NODE_ID in (:topicIds)
+ and c0.NS_THREAD in (ct1.NS_THREAD)
+ and cl0.NODE_ID = (
+ select ct3.NODE_ID
+ from WIKI_COMMENT ct
+ inner join WIKI_NODE ct1 on ct.NODE_ID = ct1.NODE_ID
+ inner join WIKI_COMMENT ct2 on ct2.NS_THREAD in (ct.NS_THREAD)
+ inner join WIKI_NODE ct3 on ct2.NODE_ID = ct3.NODE_ID,
+ WIKI_NODE d0
+ inner join WIKI_DOCUMENT d1 on d0.NODE_ID = d1.NODE_ID
+ where
+ d0.NODE_ID = doc0.NODE_ID and
+ ct1.PARENT_NODE_ID = d0.NODE_ID
+ order by ct3.CREATED_ON desc
+ limit 1
+ )
group by
- t.id,
+ cl1.OBJ_VERSION, cl1.RATING, cl1.AREA_NR, cl1.NAME, cl1.WIKINAME, cl1.CREATED_ON, cl1.CREATED_BY_USER_ID, cl1.LAST_MODIFIED_ON,
+ cl1.LAST_MODIFIED_BY_USER_ID, cl1.WRITE_ACCESS_LEVEL, cl1.READ_ACCESS_LEVEL, cl1.WRITE_PROTECTED, cl1.PARENT_NODE_ID,
+ cl0.SUBJECT, cl0.FROM_USER_NAME, cl0.FROM_USER_EMAIL, cl0.FROM_USER_HOMEPAGE, cl0.USE_WIKI_TEXT, cl0.NS_LEFT, cl0.NS_RIGHT, cl0.NS_THREAD,
- c2.id, c2.nodeInfo.nsLeft, c2.nodeInfo.nsRight, c2.nodeInfo.nsThread,
- c2.version, c2.parent,
- c2.areaNumber, c2.name, c2.wikiname, c2.createdBy, c2.createdOn, c2.lastModifiedBy, c2.lastModifiedOn, c2.readAccessLevel, c2.writeAccessLevel, c2.writeProtected,
- c2.subject, c2.fromUserName, c2.fromUserEmail, c2.fromUserHomepage, c2.useWikiText,
+ u.USER_ID, u.ACTIVATED, u.ACTIVATION_CODE, u.CREATED_ON, u.EMAIL, u.FIRSTNAME, u.LAST_LOGIN_ON,
+ u.LASTNAME, u.MEMBER_HOME_WIKI_DIRECTORY_ID, u.PASSWORDHASH, u.USER_PROFILE_ID, u.USERNAME, u.OBJ_VERSION,
- u.id, u.version, u.firstname, u.lastname, u.username, u.passwordHash, u.email, u.activated, u.activationCode, u.createdOn, u.lastLoginOn, u.memberHome, u.profile
+ doc0.NODE_ID
+ ]]></sql-query>
- ]]></query>
-
- <!-- TODO: Optimize this with native SQL, move where-clause subselect into from-clause join -->
<sql-query name="forumPostersAndRatingPoints">
<return class="org.jboss.seam.wiki.core.model.User"/>
<return-scalar column="RATING_POINTS" type="long"/>
@@ -284,21 +351,17 @@
com2.RATING
from
WIKI_DOCUMENT doc0
- inner join WIKI_FILE doc1 on doc0.NODE_ID=doc1.NODE_ID
- inner join WIKI_NODE doc2 on doc0.NODE_ID=doc2.NODE_ID,
+ inner join WIKI_NODE doc1 on doc0.NODE_ID=doc1.NODE_ID
+ inner join WIKI_NODE ct0 on ct0.PARENT_NODE_ID = doc1.NODE_ID
+ inner join WIKI_COMMENT ct1 on ct0.NODE_ID = ct1.NODE_ID,
WIKI_COMMENT com1
inner join WIKI_NODE com2 on com1.NODE_ID=com2.NODE_ID
inner join USERS user2 on com2.CREATED_BY_USER_ID=user2.USER_ID
inner join USER_ROLE roles1 on user2.USER_ID=roles1.USER_ID
inner join ROLES roles2 on roles1.ROLE_ID=roles2.ROLE_ID
where
- doc2.PARENT_NODE_ID=:parentDirId
- and (com1.NS_THREAD in
- (select com3.NS_THREAD from WIKI_COMMENT com3
- inner join WIKI_NODE com4 on com3.NODE_ID=com4.NODE_ID
- where com4.PARENT_NODE_ID=doc0.NODE_ID
- )
- )
+ doc1.PARENT_NODE_ID=:parentDirId
+ and com1.NS_THREAD in (ct1.NS_THREAD)
and (roles2.NAME not in (:ignoreUserInRoles))
and com2.RATING<>0
) as ur
Modified: trunk/examples/wiki/view/plugins/tags/plugin.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/tags/plugin.xhtml 2008-03-05 19:03:14 UTC (rev 7514)
+++ trunk/examples/wiki/view/plugins/tags/plugin.xhtml 2008-03-06 10:11:52 UTC (rev 7515)
@@ -44,7 +44,7 @@
<s:fragment rendered="#{preferences.get('Tags', currentMacro).cloud}">
<ui:repeat var="tagCount" value="#{tagsSortedByCount}">
- <s:span styleClass="tagCloudItem noWrapWhitespace" style="font-size: #{50+(100/tagsAggregator.highestTagCount*tagCount.count)}%;">
+ <s:span styleClass="tagCloudItem noWrapWhitespace" style="font-size: #{70+(100/tagsAggregator.highestTagCount*tagCount.count)}%;">
<s:span rendered="#{param.tag != tagCount.tag and preferences.get('Tags', currentMacro).linkToCurrentDocument}" styleClass="undecoratedLink">
<h:outputLink value="#{wikiURLRenderer.renderURL(currentDocument)}/Tag/#{wiki:encodeURL(tagCount.tag)}">#{tagCount.tag}</h:outputLink>
</s:span>
Added: trunk/examples/wiki/view/themes/sfwkorg/img/seam_icon_large.png
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/seam_icon_large.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 1 month
Seam SVN: r7514 - branches/Seam_2_0/src/main/org/jboss/seam/navigation.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 14:03:14 -0500 (Wed, 05 Mar 2008)
New Revision: 7514
Modified:
branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java
Log:
JBSEAM-2447
Modified: branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java 2008-03-05 18:59:14 UTC (rev 7513)
+++ branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java 2008-03-05 19:03:14 UTC (rev 7514)
@@ -35,6 +35,7 @@
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Events;
@@ -64,6 +65,7 @@
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Name("org.jboss.seam.navigation.pages")
+@Startup
@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
public class Pages
{
18 years, 1 month
Seam SVN: r7513 - branches/Seam_2_0/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 13:59:14 -0500 (Wed, 05 Mar 2008)
New Revision: 7513
Modified:
branches/Seam_2_0/doc/reference/en/modules/configuration.xml
Log:
JBSEAM-2693
Modified: branches/Seam_2_0/doc/reference/en/modules/configuration.xml
===================================================================
--- branches/Seam_2_0/doc/reference/en/modules/configuration.xml 2008-03-05 18:58:36 UTC (rev 7512)
+++ branches/Seam_2_0/doc/reference/en/modules/configuration.xml 2008-03-05 18:59:14 UTC (rev 7513)
@@ -542,7 +542,7 @@
<para> You will also need to configure a <emphasis>managed session</emphasis> if you want a Seam managed
Hibernate <literal>Session</literal> to be available via injection. </para>
- <programlisting><![CDATA[<persistence:managed-hibernate-session name="hibernateSessionFactory"
+ <programlisting><![CDATA[<persistence:managed-hibernate-session name="hibernateSession"
session-factory="#{hibernateSessionFactory}"/>]]></programlisting>
</sect2>
18 years, 1 month
Seam SVN: r7512 - trunk/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 13:58:36 -0500 (Wed, 05 Mar 2008)
New Revision: 7512
Modified:
trunk/doc/reference/en/modules/configuration.xml
Log:
JBSEAM-2693
Modified: trunk/doc/reference/en/modules/configuration.xml
===================================================================
--- trunk/doc/reference/en/modules/configuration.xml 2008-03-05 18:48:57 UTC (rev 7511)
+++ trunk/doc/reference/en/modules/configuration.xml 2008-03-05 18:58:36 UTC (rev 7512)
@@ -551,7 +551,7 @@
<para> You will also need to configure a <emphasis>managed session</emphasis> if you want a Seam managed
Hibernate <literal>Session</literal> to be available via injection. </para>
- <programlisting><![CDATA[<persistence:managed-hibernate-session name="hibernateSessionFactory"
+ <programlisting><![CDATA[<persistence:managed-hibernate-session name="hibernateSession"
session-factory="#{hibernateSessionFactory}"/>]]></programlisting>
</sect2>
18 years, 1 month
Seam SVN: r7511 - trunk/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 13:48:57 -0500 (Wed, 05 Mar 2008)
New Revision: 7511
Modified:
trunk/doc/reference/en/modules/itext.xml
Log:
JBSEAM-2605
Modified: trunk/doc/reference/en/modules/itext.xml
===================================================================
--- trunk/doc/reference/en/modules/itext.xml 2008-03-05 18:47:08 UTC (rev 7510)
+++ trunk/doc/reference/en/modules/itext.xml 2008-03-05 18:48:57 UTC (rev 7511)
@@ -95,6 +95,13 @@
and <literal>attachment</literal>, which indicates that the document should be treated as a download.
The default value is <literal>inline</literal>.</para>
</listitem>
+ <listitem>
+ <para>
+ <literal>fileName</literal> — For attachments, this value
+ overrides the downloaded file name.
+ </para>
+ </listitem>
+
</itemizedlist>
18 years, 1 month
Seam SVN: r7510 - in trunk/src/pdf/org/jboss/seam/pdf: ui and 1 other directory.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 13:47:08 -0500 (Wed, 05 Mar 2008)
New Revision: 7510
Modified:
trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
Log:
JBSEAM-2605
Modified: trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-03-05 17:26:25 UTC (rev 7509)
+++ trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-03-05 18:47:08 UTC (rev 7510)
@@ -10,6 +10,7 @@
String baseName;
String disposition = "inline";
+ String fileName;
public DocumentData(String baseName, DocumentType documentType, byte[] data) {
super();
@@ -17,8 +18,8 @@
this.documentType = documentType;
this.baseName = baseName;
}
-
-
+
+
public byte[] getData() {
return data;
}
@@ -29,14 +30,23 @@
return baseName;
}
+
+ public void setFilename(String fileName) {
+ this.fileName = fileName;
+ }
+
public String getFileName() {
- return getBaseName() + "." + getDocumentType().getExtension();
+ if (fileName == null) {
+ return getBaseName() + "." + getDocumentType().getExtension();
+ } else {
+ return fileName;
+ }
}
-
+
public void setDisposition(String disposition) {
this.disposition = disposition;
}
-
+
public String getDisposition() {
return disposition;
}
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-03-05 17:26:25 UTC (rev 7509)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-03-05 18:47:08 UTC (rev 7510)
@@ -40,7 +40,6 @@
DocumentType documentType;
- String disposition;
String type;
String title;
String subject;
@@ -53,6 +52,9 @@
String margins;
Boolean marginMirroring;
+ String disposition;
+ String fileName;
+
boolean sendRedirect = true;
UISignature signatureField;
@@ -60,6 +62,10 @@
public void setDisposition(String disposition) {
this.disposition = disposition;
}
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
public void setType(String type) {
this.type = type;
@@ -283,6 +289,11 @@
documentData.setDisposition(dispositionValue);
}
+ String fileNameValue = (String) valueBinding(context, "fileName", fileName);
+ if (fileNameValue != null) {
+ documentData.setFilename(fileNameValue);
+ }
+
if (sendRedirect) {
DocumentStore store = DocumentStore.instance();
String id = store.newId();
18 years, 1 month