svnno****@sourc*****
svnno****@sourc*****
2008年 4月 23日 (水) 16:59:29 JST
Revision: 885 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=885 Author: sone Date: 2008-04-23 16:59:29 +0900 (Wed, 23 Apr 2008) Log Message: ----------- apply patch Added Paths: ----------- pal-portal/trunk/portal/patches/components/page-manager/src/java/org/apache/jetspeed/page/impl/ pal-portal/trunk/portal/patches/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/impl/ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/pamanager/ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java pal-portal/trunk/portal/patches/components/profiler/ pal-portal/trunk/portal/patches/components/profiler/src/ pal-portal/trunk/portal/patches/components/profiler/src/java/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java pal-portal/trunk/portal/patches/components/rdbms/ pal-portal/trunk/portal/patches/components/rdbms/src/ pal-portal/trunk/portal/patches/components/rdbms/src/java/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java -------------- next part -------------- Added: pal-portal/trunk/portal/patches/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java =================================================================== --- pal-portal/trunk/portal/patches/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (rev 0) +++ pal-portal/trunk/portal/patches/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,67 @@ +Index: components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java +=================================================================== +--- components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (リビジョン 648465) ++++ components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (作業コピー) +@@ -692,7 +692,7 @@ + { + // query for folders + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter); + Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query); + +@@ -749,7 +749,7 @@ + { + // query for pages + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter); + Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query); + +@@ -806,7 +806,7 @@ + { + // query for links + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + QueryByCriteria query = QueryFactory.newQuery(LinkImpl.class, filter); + Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query); + +@@ -868,7 +868,7 @@ + { + // query for page security + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + QueryByCriteria query = QueryFactory.newQuery(PageSecurityImpl.class, filter); + PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query); + +@@ -906,7 +906,7 @@ + // query for all nodes + List all = DatabasePageManagerUtils.createList(); + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter); + Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query); + if (folders != null) +@@ -1221,7 +1221,7 @@ + { + // construct general node query criteria + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + + // update pages + QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter); +@@ -1345,7 +1345,7 @@ + { + // construct general node query criteria + Criteria filter = new Criteria(); +- filter.addEqualTo("parent", folderImpl.getId()); ++ filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId())); + + // remove folders first: depth first recursion + QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter); Added: pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java =================================================================== --- pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java (rev 0) +++ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,18 @@ +Index: components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java +=================================================================== +--- components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java (リビジョン 648465) ++++ components/portal/src/java/org/apache/jetspeed/profiler/impl/CreateUserTemplatePagesValveImpl.java (作業コピー) +@@ -156,6 +156,13 @@ + + // copy the entire dir tree from the template folder + this.pageManager.deepCopyFolder(source, userFolder, userName); ++ ++ // The user folder will have titles named after the user name. ++ Folder destFolder = this.pageManager.getFolder(userFolder); ++ destFolder.setTitle(userName); ++ destFolder.setShortTitle(userName); ++ this.pageManager.updateFolder(destFolder); ++ + created = true; + } + catch (Exception e) Added: pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java =================================================================== --- pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java (rev 0) +++ pal-portal/trunk/portal/patches/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,38 @@ +Index: components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java +=================================================================== +--- components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java (リビジョン 648465) ++++ components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java (作業コピー) +@@ -1063,13 +1063,9 @@ + return false; + } + +- private void checkDescriptorChanges() ++ private synchronized void checkDescriptorChanges() + { +- int size; +- synchronized (this) +- { +- size = monitorInfos.size(); +- } ++ int size = monitorInfos.size(); + + if (log.isDebugEnabled()) + { +@@ -1079,8 +1075,7 @@ + for (int i = size-1; i > -1; i--) + { + DescriptorChangeMonitorInfo monitorInfo; +- synchronized (this) +- { ++ + if ( started ) + { + monitorInfo = (DescriptorChangeMonitorInfo)monitorInfos.get(i); +@@ -1143,7 +1138,6 @@ + } + } + } +- } + } + } + Added: pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java =================================================================== --- pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java (rev 0) +++ pal-portal/trunk/portal/patches/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,13 @@ +Index: components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java +=================================================================== +--- components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java (リビジョン 648465) ++++ components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java (作業コピー) +@@ -67,7 +67,7 @@ + return false; + if (this.type != null) + { +- if (!(this.type.equals(r.getName()))) ++ if (!(this.type.equals(r.getType()))) + return false; + } + else Added: pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java =================================================================== --- pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java (rev 0) +++ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,20 @@ +Index: components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java +=================================================================== +--- components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java (リビジョン 648465) ++++ components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java (作業コピー) +@@ -32,15 +32,6 @@ + private JNDIComponent jndi; + private String bindName; + +- +- /* (non-Javadoc) +- * @see java.lang.Object#finalize() +- */ +- protected void finalize() throws Throwable +- { +- stop(); +- super.finalize(); +- } + /** + * + * @param user Added: pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java =================================================================== --- pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java (rev 0) +++ pal-portal/trunk/portal/patches/components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java 2008-04-23 07:59:29 UTC (rev 885) @@ -0,0 +1,114 @@ +Index: components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java +=================================================================== +--- components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java (リビジョン 648465) ++++ components/rdbms/src/java/org/apache/jetspeed/components/datasource/DBCPDatasourceComponent.java (作業コピー) +@@ -16,8 +16,12 @@ + */ + package org.apache.jetspeed.components.datasource; + ++import java.io.CharArrayWriter; ++import java.io.PrintWriter; + import java.sql.Connection; ++import java.sql.Driver; + import java.sql.DriverManager; ++import java.util.Properties; + + import javax.sql.DataSource; + +@@ -38,7 +42,8 @@ + * + * @ + * @author <a href="mailto:weave****@apach*****">Scott T. Weaver</a> +- * @version $ $ ++ * @author <a href="mailto:ate****@douma*****">Ate Douma</a> ++ * @version $Id$ + * + */ + public class DBCPDatasourceComponent implements DatasourceComponent +@@ -131,14 +136,6 @@ + return dataSource; + } + +- /** +- * <p> +- * start +- * </p> +- * +- * @see org.picocontainer.Startable#start() +- * +- */ + public void start() + { + +@@ -171,33 +168,58 @@ + } + catch (Throwable e) + { +- +- String msg = "Unable to start DBCPCDatasourceComponent: "+e.toString(); +- log.error(msg, e); +- throw new IllegalStateException(msg); ++ CharArrayWriter caw = new CharArrayWriter(); ++ e.printStackTrace(new PrintWriter(caw)); ++ String msg = "Unable to start DBCPCDatasourceComponent: "; ++ log.error(msg+e.toString(), e); ++ throw new IllegalStateException(msg+caw.toString()); + } + } + +- /** +- * <p> +- * stop +- * </p> +- * +- * @see org.picocontainer.Startable#stop() +- * +- */ + public void stop() + { + try + { ++ log.info("Stopping DBCPCDatasourceComponent"); + dsConnectionFactory.getPool().close(); ++ ++ // Support for using an embedded Derby database multiple times from one JVM ++ // by properly shutting it down after each (test) run ++ if (driverName.equals("org.apache.derby.jdbc.EmbeddedDriver")) ++ { ++ String shutDownURI = null; ++ int parIndex = connectURI.indexOf(";"); ++ if (parIndex > -1) ++ { ++ shutDownURI = connectURI.substring(0, parIndex)+";shutdown=true"; ++ } ++ else ++ { ++ shutDownURI = connectURI+";shutdown=true"; ++ } ++ Class dc = Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); ++ Driver driver = (Driver)dc.newInstance(); ++ Properties info = new Properties(); ++ info.put( "user", user ); ++ info.put( "password", password ); ++ ++ driver.connect(shutDownURI, info); ++ } ++ + } + catch (Exception e) + { + IllegalStateException ise = + new IllegalStateException("Unable to sfaely shutdown the DBCPConnection pool: " + e.toString()); + ise.initCause(e); ++ try ++ { ++ log.error(ise); ++ } ++ catch (Exception e1) ++ { ++ // ignore if logger itself is gone too ++ } + } + } +- + }