Integrade patch r1914 ccm-core: Fixed file separator so SQLLoader now works on Windoze as well as Linux, remove unused classes in c.a.sitenode (deprecated)

git-svn-id: https://svn.libreccm.org/ccm/trunk@238 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2009-08-28 13:34:30 +00:00
parent d2681805b0
commit 675d89710d
5 changed files with 46 additions and 17 deletions

View File

@ -87,8 +87,11 @@ public abstract class DomainObjectTraversal {
public static void registerAdapter(final ObjectType type, public static void registerAdapter(final ObjectType type,
final DomainObjectTraversalAdapter adapter, final DomainObjectTraversalAdapter adapter,
final String context) { final String context) {
Assert.assertNotNull(adapter, "The DomainObjectTraversalAdapter is null for context '" + context + "' and object type '" + type); Assert.exists(adapter,
Assert.assertNotNull(type, "The ObjectType for context '" + context + "' and adapter '" + adapter + "' is null"); "The DomainObjectTraversalAdapter is null for context '"
+ context + "' and object type '" + type);
Assert.exists(type, "The ObjectType for context '" + context +
"' and adapter '" + adapter + "' is null");
Assert.exists(context, String.class); Assert.exists(context, String.class);
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Registering adapter " + s_log.debug("Registering adapter " +
@ -223,7 +226,7 @@ public abstract class DomainObjectTraversal {
/** /**
* Walks over properties of a domain object, invoking * Walks over properties of a domain object, invoking
* methods to handle assoications, roles and attributes. * methods to handle associations, roles and attributes.
* *
* @param obj the domain object to traverse * @param obj the domain object to traverse
* @param context the context for the traversal adapter * @param context the context for the traversal adapter
@ -329,14 +332,20 @@ public abstract class DomainObjectTraversal {
// see #25808 - this hack prevents the content field of cms_files // see #25808 - this hack prevents the content field of cms_files
// (which is a blob) from being queried when all we need is a list // (which is a blob) from being queried when all we need is a
// of the files on an item.. // list of the files on an item..
if (prop.getName().equals("fileAttachments") && !Domain.getConfig().queryBlobContentForFileAttachments()) { // make true a config if (prop.getName().equals("fileAttachments") &&
DataQuery fileAttachmentsQuery = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.contentassets.fileAttachmentsQuery"); !Domain.getConfig().queryBlobContentForFileAttachments()) {
// make true a config
DataQuery fileAttachmentsQuery =
SessionManager.getSession().retrieveQuery(
"com.arsdigita.cms.contentassets.fileAttachmentsQuery");
fileAttachmentsQuery.setParameter("item_id", obj.getOID().get("id")); fileAttachmentsQuery.setParameter("item_id",
obj.getOID().get("id"));
DataCollection files = new DataQueryDataCollectionAdapter(fileAttachmentsQuery, "file"); DataCollection files = new DataQueryDataCollectionAdapter(
fileAttachmentsQuery, "file");
while(files.next()) { while(files.next()) {
DataObject file = files.getDataObject(); DataObject file = files.getDataObject();

View File

@ -127,11 +127,13 @@ public abstract class SQLLoader {
private String parent(String path) { private String parent(String path) {
path = path.trim(); path = path.trim();
if (path.endsWith(File.separator)) { // Fixed file separator, now works on Windoze as well as Linux
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 2); path = path.substring(0, path.length() - 2);
} }
int index = path.lastIndexOf(File.separatorChar); // Fixed file separator, now works on Windoze as well as Linux
int index = path.lastIndexOf("/");
if (index > 0) { if (index > 0) {
path = path.substring(0, index); path = path.substring(0, index);
} else { } else {
@ -152,6 +154,10 @@ public abstract class SQLLoader {
String front = parent(from); String front = parent(from);
String back = included; String back = included;
while (back.startsWith("../")) { while (back.startsWith("../")) {
if (s_log.isDebugEnabled()) {
s_log.debug("Back: '" + back + "'");
s_log.debug("Front: '" + front + "'");
}
back = back.substring(3); back = back.substring(3);
front = parent(front); front = parent(front);
} }

View File

@ -78,10 +78,18 @@ import org.apache.log4j.Logger;
* *
* <p> * <p>
* *
* @deprecated Use {@link com.arsdigita.web.DispatcherServlet} instead.
* @author Bill Schneider * @author Bill Schneider
* @version $Revision: #43 $ $Date: 2004/08/16 $ * @version $Revision: #43 $ $Date: 2004/08/16 $
* @since 4.5 * @since 4.5
* @deprecated Use {@link com.arsdigita.web.DispatcherServlet} instead.
* Pboy (2009-08-06):
* a) SiteNodeDispatcher is still included in web.xml
* b) content-center needs SiteNodeDispatcher
* c) SiteNodeDispatcher is fallback in web.DispatcherServlet (cf web.xml)
* d) webDispatcherServlet requires a fallback as parameter
* therefore: SideNodeDispatcher is still required at the moment.
* ToDo: test if web.LegacyAdapterServlet, a 'servlet that does what
* SiteNodeDispatcher does' can do the job.
*/ */
public class SiteNodeDispatcher extends KernelDispatcherServlet public class SiteNodeDispatcher extends KernelDispatcherServlet
implements Dispatcher { implements Dispatcher {

View File

@ -52,7 +52,8 @@ import org.apache.log4j.Logger;
/** /**
* Class for managing and obtaining Stylesheets. * Class for managing and obtaining Stylesheets.
* *
* @deprecated Use {@link com.arsdigita.bebop.page.PageTransformer} in conjunction with {@link com.arsdigita.templating.LegacyStylesheetResolver}. * @deprecated Use {@link com.arsdigita.bebop.page.PageTransformer} in conjunction
* with {@link com.arsdigita.templating.LegacyStylesheetResolver}.
* @author Bill Schneider * @author Bill Schneider
* @version $Id: SiteNodePresentationManager.java 562 2005-06-12 23:53:19Z apevec $ * @version $Id: SiteNodePresentationManager.java 562 2005-06-12 23:53:19Z apevec $
* @deprecated use BasePresentationManager instead. * @deprecated use BasePresentationManager instead.

View File

@ -5,9 +5,7 @@
</head> </head>
<body bgcolor="white"> <body bgcolor="white">
<p> <p>
Provides a Dispatcher implementation that is backed by the "Site Map" of
<b>Deprecated.</b> Use the com.arsdigita.web package instead. Provides
a Dispatcher implementation that is backed by the "Site Map" of
SiteNode domain objects. The reason this package is not part of the SiteNode domain objects. The reason this package is not part of the
Kernel is that the Kernel, being pure application logic, must have no Kernel is that the Kernel, being pure application logic, must have no
dependencies on the Presentation Infrastructure (of which the dependencies on the Presentation Infrastructure (of which the
@ -15,6 +13,13 @@ Dispatcher framework is a part). Thus, this package is what connects
SiteNodes (which are part of the Kernel) to the Dispatcher system. SiteNodes (which are part of the Kernel) to the Dispatcher system.
</p> </p>
<p>
<b>Deprecated.</b> Use the com.arsdigita.web package instead.
</p>
<p>
PBoy (2009-08-06): Deprecated at least since 2005, but still part of web.xml
and e.g. required by content-center and cms. <br />
<b>ToDo</b>: step by step replace the deprecated classes
</p>
</body> </body>
</html> </html>