Integrated r1968, r1973, r1974: Postgresql 8.3 compatibility; various formatting and documentation.

git-svn-id: https://svn.libreccm.org/ccm/trunk@273 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2009-10-04 16:54:54 +00:00
parent 95aa6afb5b
commit 3a54653bb7
18 changed files with 50 additions and 73 deletions

View File

@ -20,7 +20,7 @@ query getContentItemExpiredBeforeInSection {
where where
m.item_id = o.object_id and m.item_id = o.object_id and
m.cycle_id = l.cycle_id and m.cycle_id = l.cycle_id and
l.has_ended = 0 and l.has_ended = '0' and
:endDateTime >= l.end_date_time and :endDateTime >= l.end_date_time and
i.item_id = o.object_id and i.item_id = o.object_id and
i.section_id = :sectionId and i.section_id = :sectionId and

View File

@ -57,7 +57,7 @@ query getLifecycleStart {
where where
m.item_id = o.object_id and m.item_id = o.object_id and
m.cycle_id = l.cycle_id and m.cycle_id = l.cycle_id and
l.has_begun = 0 and l.has_begun = '0' and
:startDateTime >= l.start_date_time :startDateTime >= l.start_date_time
} map { } map {
objectId = o.object_id; objectId = o.object_id;
@ -87,7 +87,7 @@ query getLifecycleEnd {
where where
m.item_id = o.object_id and m.item_id = o.object_id and
m.cycle_id = l.cycle_id and m.cycle_id = l.cycle_id and
l.has_ended = 0 and l.has_ended = '0' and
:endDateTime >= l.end_date_time :endDateTime >= l.end_date_time
} map { } map {
objectId = o.object_id; objectId = o.object_id;
@ -117,7 +117,7 @@ query getPhaseStart {
where where
m.item_id = o.object_id and m.item_id = o.object_id and
m.cycle_id = p.cycle_id and m.cycle_id = p.cycle_id and
p.has_begun = 0 and p.has_begun = '0' and
:startDateTime >= p.start_date_time :startDateTime >= p.start_date_time
} map { } map {
objectId = o.object_id; objectId = o.object_id;
@ -149,7 +149,7 @@ query getPhaseEnd {
where where
m.item_id = o.object_id and m.item_id = o.object_id and
m.cycle_id = p.cycle_id and m.cycle_id = p.cycle_id and
p.has_ended = 0 and p.has_ended = '0' and
:endDateTime >= p.end_date_time :endDateTime >= p.end_date_time
} map { } map {
objectId = o.object_id; objectId = o.object_id;

View File

@ -35,7 +35,7 @@ query getEnabledUserTasks {
BigDecimal lockingUserID; BigDecimal lockingUserID;
String taskType; String taskType;
String taskTypeClass; String taskTypeClass;
Integer status; String status;
String processLabel; String processLabel;
do { do {
select cw_tasks.task_id, select cw_tasks.task_id,
@ -56,11 +56,11 @@ query getEnabledUserTasks {
cms_items.name, cms_items.name,
cms_pages.title, cms_pages.title,
CASE WHEN (cw_user_tasks.locking_user_id = :userId) then CASE WHEN (cw_user_tasks.locking_user_id = :userId) then
1 '1'
WHEN (cw_user_tasks.locking_user_id is null) then WHEN (cw_user_tasks.locking_user_id is null) then
2 '2'
ELSE ELSE
3 '3'
END as status, END as status,
cw_user_tasks.locking_user_id, cw_user_tasks.locking_user_id,
cw_tasks_proc.label as processLabel cw_tasks_proc.label as processLabel

View File

@ -35,7 +35,7 @@ query getEnabledUserTasks {
BigDecimal lockingUserID; BigDecimal lockingUserID;
String taskType; String taskType;
String taskTypeClass; String taskTypeClass;
Integer status; String status;
String processLabel; String processLabel;
do { do {
select cw_tasks.task_id, select cw_tasks.task_id,
@ -56,11 +56,11 @@ query getEnabledUserTasks {
cms_items.name, cms_items.name,
cms_pages.title, cms_pages.title,
CASE WHEN (cw_user_tasks.locking_user_id = :userId) then CASE WHEN (cw_user_tasks.locking_user_id = :userId) then
1 '1'
WHEN (cw_user_tasks.locking_user_id is null) then WHEN (cw_user_tasks.locking_user_id is null) then
2 '2'
ELSE ELSE
3 '3'
END as status, END as status,
cw_user_tasks.locking_user_id, cw_user_tasks.locking_user_id,
cw_tasks_proc.label as processLabel cw_tasks_proc.label as processLabel

View File

@ -56,10 +56,6 @@ import org.apache.log4j.Logger;
* @version $Id: ContentBundle.java 967 2005-10-28 18:08:42Z sskracic $ * @version $Id: ContentBundle.java 967 2005-10-28 18:08:42Z sskracic $
*/ */
public class ContentBundle extends ContentItem { public class ContentBundle extends ContentItem {
public static final String versionId =
"$Id: ContentBundle.java 967 2005-10-28 18:08:42Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: $";
private static final Logger s_log = Logger.getLogger(ContentBundle.class); private static final Logger s_log = Logger.getLogger(ContentBundle.class);

View File

@ -159,8 +159,8 @@ public class UserHomeFolderMap extends ACSObject {
public static UserHomeFolderMap findUserHomeFolderMap(User user, ContentSection section) { public static UserHomeFolderMap findUserHomeFolderMap(User user, ContentSection section) {
DataCollection maps = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE); DataCollection maps = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE);
maps.addEqualsFilter(USER_ID,user.getID().toString()); maps.addEqualsFilter(USER_ID, user.getID());
maps.addEqualsFilter(SECTION_ID,section.getID().toString()); maps.addEqualsFilter(SECTION_ID, section.getID());
UserHomeFolderMap map = null; UserHomeFolderMap map = null;
if ( maps.next() ) { if ( maps.next() ) {

View File

@ -51,10 +51,6 @@ import java.util.StringTokenizer;
* @version $Id: MultilingualItemResolver.java 1795 2009-02-07 10:47:32Z pboy $ * @version $Id: MultilingualItemResolver.java 1795 2009-02-07 10:47:32Z pboy $
*/ */
public class MultilingualItemResolver extends AbstractItemResolver implements ItemResolver { public class MultilingualItemResolver extends AbstractItemResolver implements ItemResolver {
public static final String versionId =
"$Id: MultilingualItemResolver.java 1795 2009-02-07 10:47:32Z pboy $" +
"$Author: pboy $" +
"$DateTime: 2004/08/17 23:15:09 $";
private static final Logger s_log = Logger.getLogger private static final Logger s_log = Logger.getLogger
(MultilingualItemResolver.class); (MultilingualItemResolver.class);
@ -720,11 +716,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
// will have deal with 'foo' folder. // will have deal with 'foo' folder.
String name = index > 0 ? url.substring(0, index) : ""; String name = index > 0 ? url.substring(0, index) : "";
parentFolder = parentFolder = "".equals(name) ? parentFolder
// really object identity? Don't think so
// name != "" ? (Folder) parentFolder.getItem(URLEncoder.encode(name), true)
// : parentFolder;
name.isEmpty() ? parentFolder
: (Folder) parentFolder.getItem(URLEncoder.encode(name), true); : (Folder) parentFolder.getItem(URLEncoder.encode(name), true);
url = index + 1 < len ? url.substring(index + 1) : ""; url = index + 1 < len ? url.substring(index + 1) : "";

View File

@ -206,7 +206,7 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
// start thread for monitoring queue // start thread for monitoring queue
int startupDelay = getInteger(QUEUE_POLL_STARTUP_DELAY).intValue(); int startupDelay = getInteger(QUEUE_POLL_STARTUP_DELAY).intValue();
int pollDelay = getInteger(QUEUE_POLL_DELAY).intValue(); int pollDelay = getInteger(QUEUE_POLL_DELAY).intValue();
QueueManager.startWatchingQueue(startupDelay, pollDelay); // QueueManager.startWatchingQueue(startupDelay, pollDelay);
} }
// //

View File

@ -217,9 +217,9 @@ public class QueueManager implements Runnable {
* @pre ! item instanceof ContainerItem * @pre ! item instanceof ContainerItem
***/ ***/
public static void queuePublish(ContentItem item) { public static void queuePublish(ContentItem item) {
Assert.truth( !(item instanceof ContentBundle), Assert.isTrue( !(item instanceof ContentBundle),
"Cannot queue content bundle " + item ); "Cannot queue content bundle " + item );
Assert.truth(item.isLiveVersion(), "Item is not live"); Assert.isTrue(item.isLiveVersion(), "Item is not live");
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("Queue publish task for " + item.getID()); s_log.info("Queue publish task for " + item.getID());
} }
@ -330,11 +330,11 @@ public class QueueManager implements Runnable {
s_log.info("Queue move task for " + liveItem.getID()); s_log.info("Queue move task for " + liveItem.getID());
} }
Assert.truth(liveItem != null && liveItem.isLiveVersion(), Assert.isTrue(liveItem != null && liveItem.isLiveVersion(),
"Item is not live"); "Item is not live");
Assert.truth(source != null && source.isLiveVersion(), Assert.isTrue(source != null && source.isLiveVersion(),
"Source is not live"); "Source is not live");
Assert.truth(destination != null && destination.isLiveVersion(), Assert.isTrue(destination != null && destination.isLiveVersion(),
"Destination is not live"); "Destination is not live");
// for move put itemId as destination folder ID, for parent_id source // for move put itemId as destination folder ID, for parent_id source
@ -346,9 +346,9 @@ public class QueueManager implements Runnable {
} }
private static void queue(ContentItem item, String task) { private static void queue(ContentItem item, String task) {
Assert.truth( !(item instanceof ContentBundle), Assert.isTrue( !(item instanceof ContentBundle),
"Cannot queue content bundle " + item ); "Cannot queue content bundle " + item );
Assert.truth(item.isLiveVersion(), "Item is not live"); Assert.isTrue(item.isLiveVersion(), "Item is not live");
ACSObject parent = item.getParent(); ACSObject parent = item.getParent();
BigDecimal parentID = null; BigDecimal parentID = null;
@ -447,6 +447,9 @@ public class QueueManager implements Runnable {
* middle of processing a block of entries. * middle of processing a block of entries.
*/ */
public static void stopWatchingQueue() { public static void stopWatchingQueue() {
if (s_log.isInfoEnabled()) {
s_log.info("Going to stop queue processing.");
}
s_keepWatchingQueue = false; s_keepWatchingQueue = false;
} }

View File

@ -76,13 +76,9 @@ import javax.servlet.ServletException;
* separate item selection model is updated. * separate item selection model is updated.
* *
* @author <a href="mailto:lutter@arsdigita.com">David Lutterkort</a> * @author <a href="mailto:lutter@arsdigita.com">David Lutterkort</a>
* @version $Revision: #22 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Id: FolderBrowser.java 1540 2007-03-26 20:44:49Z apevec $
*/ */
public class FolderBrowser extends Table { public class FolderBrowser extends Table {
public static final String versionId =
"$Id: FolderBrowser.java 1540 2007-03-26 20:44:49Z apevec $" +
"$Author: apevec $" +
"$DateTime: 2004/08/17 23:15:09 $";
private static final Logger s_log = Logger.getLogger(FolderBrowser.class); private static final Logger s_log = Logger.getLogger(FolderBrowser.class);

View File

@ -139,7 +139,7 @@ public class PermissionManager {
Filter f = query.addFilter(" exists ( com.arsdigita.kernel.permissions." Filter f = query.addFilter(" exists ( com.arsdigita.kernel.permissions."
+ queryName + " and RAW[" + queryName + " and RAW["
+ permission.getPrivilegeDescriptor().getColumnName() + " = 1 ])"); + permission.getPrivilegeDescriptor().getColumnName() + " = '1' ])");
f.set("objectID", permission.getACSObjectOID().get("id")); f.set("objectID", permission.getACSObjectOID().get("id"));
f.set("partyID", constructAccessList(permission.getPartyOID()));//.get("id")); f.set("partyID", constructAccessList(permission.getPartyOID()));//.get("id"));
@ -541,7 +541,7 @@ public class PermissionManager {
Filter f = factory.simple( Filter f = factory.simple(
" exists ( com.arsdigita.kernel.permissions.PartyPermissionFilterQuery" " exists ( com.arsdigita.kernel.permissions.PartyPermissionFilterQuery"
+ " and RAW[dogc.pd_object_id] = " + propertyName + " and RAW[dogc.pd_object_id] = " + propertyName
+ " and RAW[" + privilege.getColumnName() + "] = 1)"); + " and RAW[" + privilege.getColumnName() + "] = '1')");
f.set("partyID", constructAccessList(partyOID));//partyOID.get("id")); f.set("partyID", constructAccessList(partyOID));//partyOID.get("id"));
return f; return f;
} }
@ -557,7 +557,7 @@ public class PermissionManager {
Filter f = factory.simple( Filter f = factory.simple(
" exists ( com.arsdigita.kernel.permissions.ObjectPermissionFilterQuery" " exists ( com.arsdigita.kernel.permissions.ObjectPermissionFilterQuery"
+ " and RAW[dgm.pd_member_id] = " + propertyName + " and RAW[dgm.pd_member_id] = " + propertyName
+ " and RAW[" + privilege.getColumnName() + "] = 1)"); + " and RAW[" + privilege.getColumnName() + "] = '1')");
f.set("objectID", objectOID.get("id")); f.set("objectID", objectOID.get("id"));
return f; return f;
} }

View File

@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
* by all domain init methods, followed by all legacy init methods. * by all domain init methods, followed by all legacy init methods.
* *
* @author Rafael H. Schloming &lt;rhs@mit.edu&gt; * @author Rafael H. Schloming &lt;rhs@mit.edu&gt;
* @version $Revision: #6 $ $Date: 2004/08/16 $ * @version $Id: CompoundInitializer.java 287 2005-02-22 00:29:02Z sskracic $
**/ **/
public class CompoundInitializer implements Initializer { public class CompoundInitializer implements Initializer {
@ -42,8 +42,6 @@ public class CompoundInitializer implements Initializer {
private static final Logger s_log = private static final Logger s_log =
Logger.getLogger(CompoundInitializer.class); Logger.getLogger(CompoundInitializer.class);
public final static String versionId = "$Id: CompoundInitializer.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
private Logger m_log; private Logger m_log;
private final List m_inits = new ArrayList(); private final List m_inits = new ArrayList();

View File

@ -35,10 +35,6 @@ package com.arsdigita.runtime;
* @version $Id: Initializer.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: Initializer.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public interface Initializer { public interface Initializer {
public final static String versionId =
"$Id: Initializer.java 287 2005-02-22 00:29:02Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/08/16 18:10:38 $";
/** /**
* Initializes the object-relational mapping metadata by loading * Initializes the object-relational mapping metadata by loading

View File

@ -103,15 +103,20 @@ public class ApplicationFileServlet extends BaseApplicationServlet {
private String m_templatePath; private String m_templatePath;
private ApplicationFileResolver m_resolver; private ApplicationFileResolver m_resolver;
/**
*
* @param config
* @throws ServletException
*/
public void init(ServletConfig config) public void init(ServletConfig config)
throws ServletException { throws ServletException {
super.init(config); super.init(config);
m_templatePath = config.getInitParameter("template-path"); m_templatePath = config.getInitParameter("template-path");
Assert.exists(m_templatePath, String.class); Assert.exists(m_templatePath, String.class);
Assert.truth(m_templatePath.startsWith("/"), Assert.isTrue(m_templatePath.startsWith("/"),
"template-path starts with '/'"); "template-path starts with '/'");
Assert.truth(!m_templatePath.endsWith("/"), Assert.isTrue(!m_templatePath.endsWith("/"),
"template-path does not end with '/'"); "template-path does not end with '/'");

View File

@ -60,10 +60,6 @@ import org.apache.log4j.Logger;
* @version $Id: BaseServlet.java 738 2005-09-01 12:36:52Z sskracic $ * @version $Id: BaseServlet.java 738 2005-09-01 12:36:52Z sskracic $
*/ */
public abstract class BaseServlet extends HttpServlet { public abstract class BaseServlet extends HttpServlet {
public static final String versionId =
"$Id: BaseServlet.java 738 2005-09-01 12:36:52Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/08/16 18:10:38 $";
private static Logger s_log = Logger.getLogger(BaseServlet.class); private static Logger s_log = Logger.getLogger(BaseServlet.class);

View File

@ -17,10 +17,6 @@
* *
*/ */
/*
* !!! WORK IN PROGRESS !!!
* NOT READY for prime time yet
*/
package com.arsdigita.web; package com.arsdigita.web;
import com.arsdigita.runtime.CCMResourceManager; import com.arsdigita.runtime.CCMResourceManager;
@ -33,6 +29,7 @@ import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener; import javax.servlet.ServletContextListener;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.log4j.LogManager;
import org.apache.log4j.PropertyConfigurator; import org.apache.log4j.PropertyConfigurator;
/** /**
@ -138,6 +135,7 @@ public class CCMApplicationContextListener implements ServletContextListener {
// do nothing at the moment // do nothing at the moment
s_log.info("CCM Application shut down."); s_log.info("CCM Application shut down.");
LogManager.shutdown();
} }
} }

View File

@ -42,12 +42,9 @@ import org.apache.log4j.Logger;
* *
* @author Rafael Schloming &lt;rhs@mit.edu&gt; * @author Rafael Schloming &lt;rhs@mit.edu&gt;
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: Web.java 738 2005-09-01 12:36:52Z sskracic $
*/ */
public class Web { public class Web {
public static final String versionId =
"$Id: Web.java 738 2005-09-01 12:36:52Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/08/16 18:10:38 $";
public static final String ROOT_WEBAPP = "ROOT"; public static final String ROOT_WEBAPP = "ROOT";
@ -137,8 +134,8 @@ public class Web {
* @return the servlet context matching uri, or null * @return the servlet context matching uri, or null
*/ */
public static final ServletContext getServletContext(String uri) { public static final ServletContext getServletContext(String uri) {
Assert.truth(uri.startsWith("/"), "uri must start with /"); Assert.isTrue(uri.startsWith("/"), "uri must start with /");
Assert.truth(uri.endsWith("/"), "uri must end with /"); Assert.isTrue(uri.endsWith("/"), "uri must end with /");
return (ServletContext)s_contexts.get(uri); return (ServletContext)s_contexts.get(uri);
} }
@ -149,7 +146,7 @@ public class Web {
static final void registerServletContext(String uri, static final void registerServletContext(String uri,
ServletContext ctx) { ServletContext ctx) {
s_log.debug("Mapping " + ctx + " to " + uri); s_log.debug("Mapping " + ctx + " to " + uri);
Assert.truth(s_contexts.get(uri) == null, Assert.isTrue(s_contexts.get(uri) == null,
"a context mapping exists at " + uri); "a context mapping exists at " + uri);
s_contexts.put(uri, ctx); s_contexts.put(uri, ctx);
} }

View File

@ -48,7 +48,7 @@
</xsl:if> </xsl:if>
</script> </script>
<!-- DE Lade die externe JavaScript-Datei für Xinha --> <!-- DE Lade die externe JavaScript-Datei fuer Xinha -->
<script type="text/javascript" src="{@editor_src}"/> <script type="text/javascript" src="{@editor_src}"/>
<!-- DE Lade die angegebene Konfiguration --> <!-- DE Lade die angegebene Konfiguration -->