APLAWS Integration package clean up to avoid code duplication:

* Integrated WebAppPatternGenerator in Aplaws and in core into one. It is a core responsibility of templating and no APLAWS specific tasks involved anymore.

* Removed unused classes  ObjectTypeTrav* 

* Relocated ItemCategoryPicker to ldn-terms because it is a ldn-terms specific task to make terms available in cms in general, not an integration package task.

* Relocated initialisation of TermCategoryListener to sync terms and core categories to terms, because is is a core terms task.

* Various formatting and documentation.


git-svn-id: https://svn.libreccm.org/ccm/trunk@2035 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-01-13 13:19:41 +00:00
parent 47f50ad2c9
commit 690db3cde2
23 changed files with 206 additions and 143 deletions

View File

@ -83,12 +83,6 @@ public class Loader extends PackageLoader {
*/ */
private void setupHTTPAuth() { private void setupHTTPAuth() {
// ApplicationType type = ApplicationType
// .createApplicationType("auth-http",
// "CCM HTTP Authentication Admin",
// HTTPAuth.BASE_DATA_OBJECT_TYPE);
/* Create new type legacy free application type /* Create new type legacy free application type
* NOTE: The wording in the title parameter of ApplicationType * NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets. * determines the name of the subdirectory for the XSL stylesheets.

View File

@ -81,7 +81,8 @@ public class NotifyLifecycleListener implements LifecycleListener {
final ContentSection section = item.getContentSection(); final ContentSection section = item.getContentSection();
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("item = " + (item == null ? "null" : item.toString())); s_log.debug("item = " + (item == null ? "null" : item.toString()));
s_log.debug("section = "+ (section == null ? "null" : section.toString())); s_log.debug("section = "+ (section == null ? "null"
: section.toString()));
} }
Assert.exists(item); Assert.exists(item);
@ -206,11 +207,12 @@ public class NotifyLifecycleListener implements LifecycleListener {
if (alertRole != null) { if (alertRole != null) {
usersToAlert = alertRole.getContainedUsers(); usersToAlert = alertRole.getContainedUsers();
Filter pFilter = PermissionService Filter pFilter = PermissionService
.getObjectFilterQuery(usersToAlert.getFilterFactory(), .getObjectFilterQuery(
usersToAlert.getFilterFactory(),
"id", "id",
PrivilegeDescriptor. PrivilegeDescriptor.
get(SecurityManager.CMS_EDIT_ITEM), get(SecurityManager.CMS_EDIT_ITEM),
item.getDraftVersion().getParent().getOID()); // !! see above!! item.getDraftVersion().getParent().getOID()); // see above!!
usersToAlert.addFilter(pFilter); usersToAlert.addFilter(pFilter);
} }
return usersToAlert; return usersToAlert;
@ -245,19 +247,30 @@ public class NotifyLifecycleListener implements LifecycleListener {
String subject = "Content Item " + name + " is about to expire"; String subject = "Content Item " + name + " is about to expire";
// term section.getSiteNode below doesn't produce any meaningful
// value, because table sitenodes is empty since all apps are
// new style, legacy free apps. Term returns null.
String publicURL = URL.there(section.getSiteNode().getURL(DispatcherHelper.getWebappContext()) // section.getSiteNode() get the sigenote object for the current
+ ((ContentItem)item.getParent()).getPath(), // contentsection in use, getURL is a sitenode method to provide
null).getURL(); // the corresponding URL as String.
// Modification NOT test yet!
String publicURL = URL.there(
// section.getSiteNode().getURL(DispatcherHelper.getWebappContext())
section.getPath()
+ ((ContentItem)item.getParent()).getPath()
,null
).getURL();
// link to the trunk version of the item, which can be edited. // link to the trunk version of the item, which can be edited.
// the live item cannot! // the live item cannot!
//String adminURL = URL.there(ContentItemPage.getItemURL(item,ContentItemPage.AUTHORING_TAB), null).getURL();
ContentItem adminItem = item.getDraftVersion(); ContentItem adminItem = item.getDraftVersion();
if (adminItem == null) { if (adminItem == null) {
adminItem = item; adminItem = item;
} }
String adminURL = URL.there(ContentItemPage.getItemURL(adminItem, String adminURL = URL.there(ContentItemPage
.getItemURL(adminItem,
ContentItemPage.AUTHORING_TAB) ContentItemPage.AUTHORING_TAB)
, null).getURL(); , null).getURL();

View File

@ -3,8 +3,8 @@
# "PatternStylesheetResolver". Please read the Javadoc for that file for # "PatternStylesheetResolver". Please read the Javadoc for that file for
# the full story. # the full story.
http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::-::locale::.xsl http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::-::locale::.xsl
http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::.xsl http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::.xsl
http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::-::locale::.xsl http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::locale::.xsl
http://::host::/resource/::webapps::/themes/heirloom/apps/::application::/xsl/::url::.xsl http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::.xsl

View File

@ -78,9 +78,9 @@ import org.apache.log4j.Logger;
* <table border="1"> * <table border="1">
* <tr> <th> Pattern </th> <th> Meaning </th> <th> Examples </th> </tr> * <tr> <th> Pattern </th> <th> Meaning </th> <th> Examples </th> </tr>
* <tr> * <tr>
* <td> <code>::locale::</code> </td> * <td> <code>::host::</code> </td>
* <td> Current locale </td> * <td> Host name </td>
* <td> <code>fr_FR</code> </td> * <td> <code>www.aplaws.org</code> </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> <code>::vhost::</code> </td> * <td> <code>::vhost::</code> </td>
@ -88,6 +88,37 @@ import org.apache.log4j.Logger;
* <td> <code>business.camden.gov.uk</code> </td> * <td> <code>business.camden.gov.uk</code> </td>
* </tr> * </tr>
* <tr> * <tr>
* <td> <code>::webapp::</code> </td>
* <td> Current web application name (ie. context or document root) </td>
* <td> <code>ccm</code> </td>
* </tr>
* <tr>
* <td> <code>::application::</code> </td>
* <td> Current application name </td>
* <td> <code>navigation</code> </td>
* </tr>
* <tr>
* <td> <code>::url::</code> </td>
* <td> URL stub of the current applications name tree</td>
* <td> <code>admin</code> </td>
* </tr>
* <tr>
* <td> <code>::prefix::</code> </td>
* <td> ??</td>
* <td> <code>??</code> </td>
* </tr>
* <tr>
* <td> <code>::outputtype::</code> </td>
* <td> Output format. </td>
* <td> <code>text_html</code> </td>
* </tr>
* <tr>
* <td> <code>::locale::</code> </td>
* <td> Current locale </td>
* <td> <code>fr_FR</code> </td>
* </tr>
* <tr>clear
*
* <td> <code>::outputtype::</code> </td> * <td> <code>::outputtype::</code> </td>
* <td> Output format. </td> * <td> Output format. </td>
* <td> <code>text_html</code> </td> * <td> <code>text_html</code> </td>
@ -110,6 +141,17 @@ import org.apache.log4j.Logger;
* actually exists on disk is returned. * actually exists on disk is returned.
* </p> * </p>
* *
* Developer may customize the process by writing a custom pattern generator
* and add it in a custom integration package Initializer (e.g. ccm-ldn-aplaws)
* by following code:
* // Register additional PatternStyleSheetResolver for Web app.
* // With all modules installing in one context no longer required.
* PatternStylesheetResolver.registerPatternGenerator(
* "[myKey]",
* new [My]PatternGenerator()
* );
*
*
* @author Richard W.M. Jones * @author Richard W.M. Jones
*/ */
public class PatternStylesheetResolver implements StylesheetResolver { public class PatternStylesheetResolver implements StylesheetResolver {
@ -147,7 +189,7 @@ public class PatternStylesheetResolver implements StylesheetResolver {
registerPatternGenerator registerPatternGenerator
("prefix", new PrefixPatternGenerator()); ("prefix", new PrefixPatternGenerator());
registerPatternGenerator registerPatternGenerator
("webapps", new WebAppPatternGenerator()); ("webapp", new WebAppPatternGenerator());
registerPatternGenerator registerPatternGenerator
("host", new HostPatternGenerator()); ("host", new HostPatternGenerator());
s_log.debug("Static initalizer finished."); s_log.debug("Static initalizer finished.");

View File

@ -22,18 +22,27 @@ import com.arsdigita.dispatcher.DispatcherHelper;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* Generates a pattern for based on the request prefix, * Generates a pattern for based on the request dispatcher prefix,
* eg /print/content/myitem.jsp -> { 'print' } * eg /print/content/myitem.jsp -> { 'print' }
* /text-only/content/myitem.jsp -> { 'text-only' } * /text-only/content/myitem.jsp -> { 'text-only' }
*/ */
public class PrefixPatternGenerator implements PatternGenerator { public class PrefixPatternGenerator implements PatternGenerator {
/**
*
* @param key
* @param req
* @return
*/
public String[] generateValues(String key, public String[] generateValues(String key,
HttpServletRequest req) { HttpServletRequest req) {
String value = DispatcherHelper.getDispatcherPrefix(req); String value = DispatcherHelper.getDispatcherPrefix(req);
if (value != null) { if (value != null) {
return new String[] { value.substring(1) }; return new String[] { value.substring(1) };
} }
else {
return new String[] { }; return new String[] { };
} }
} }
}

View File

@ -23,18 +23,21 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/** /**
* Interface for styling and serving XML documents to * Interface for styling and serving XML documents to the response output
* the response output stream. The PresentationManager contains the * stream.
* code that determines which XSLT transformer(s) are to be applied to *
* a given document. The default * The PresentationManager contains the code that determines which
* BasePresentationManager should suffice for most cases. A custom * XSLT transformer(s) are to be applied to a given document.
* presentation manager is needed if an application needs to *
* The (default) SimplePresentationManager just links to the bebop
* implementation. It should suffice for most cases.
*
* A custom presentation manager is needed if an application needs to
* dynamically apply a set of templates to an XML document in a custom * dynamically apply a set of templates to an XML document in a custom
* way. Typically, this occurs if the template selection * way. Typically, this occurs if the template selection
* depends on the outcome of some application-specific logic. * depends on the outcome of some application-specific logic.
* *
* @see com.arsdigita.sitenode.SiteNodePresentationManager * @see com.arsdigita.templating.SimplePresentationManager
* @see com.arsdigita.sitenode.BasePresentationManager
* *
* @author Bill Schneider * @author Bill Schneider
* @version ACS 4.6 * @version ACS 4.6

View File

@ -28,7 +28,7 @@ package com.arsdigita.templating;
* configuration registry. * configuration registry.
*/ */
/* NON Javadoc comment: /* NON Javadoc comment:
* Used to be depracated in version 6.6.0. Reverted to non-deprecated in version * Used to be deprecated in version 6.6.0. Reverted to non-deprecated in version
* 6.6.0 release 3. Package templating provides the basic mechanism for CCM * 6.6.0 release 3. Package templating provides the basic mechanism for CCM
* templating system an should provide an implementation of the Presentation * templating system an should provide an implementation of the Presentation
* Manager interface to be complete. * Manager interface to be complete.

View File

@ -29,28 +29,48 @@ import org.apache.log4j.Logger;
/** /**
* Generates a set of patterns corresponding to the current * Generates a set of patterns corresponding to the current
* web application prefix * web application prefix.
*/ */
public class WebAppPatternGenerator implements PatternGenerator { public class WebAppPatternGenerator implements PatternGenerator {
/** Private Logger instance for debugging purpose. */
private static final Logger s_log = private static final Logger s_log =
Logger.getLogger(WebAppPatternGenerator.class); Logger.getLogger(WebAppPatternGenerator.class);
public String[] generateValues(String key, public String[] generateValues(String key,
HttpServletRequest req) { HttpServletRequest req) {
Application app = Web.getContext().getApplication(); Application app = Web.getContext().getApplication();
String ctx = app == null ? null : app.getContextPath(); String ctx = app == null ? null : app.getContextPath();
if (app == null || if (s_log.isDebugEnabled()) {
ctx == null || s_log.debug("Generating Values key: " + key + " [" +
"".equals(ctx)) { "Web.getContext(): " + Web.getContext() + "," +
return new String[] { Web.ROOT_WEBAPP }; "Application: " + Web.getContext().getApplication() + "," +
"ContextPath: " + ctx + "," + "]");
}
if (app == null || ctx == null || "".equals(ctx)) {
return new String[] { Web.ROOT_WEBAPP }; // Currently "ROOT"
} }
if (ctx.startsWith("/")) { if (ctx.startsWith("/")) {
ctx = ctx.substring(1); ctx = ctx.substring(1);
} }
return new String[] { ctx + "," + Web.ROOT_WEBAPP }; /* "Older version: prior 6.6. Some modules used to be installed into
* its own web application context, but needed access to the main
* applications package files (e.g. bebop) which were installed into
* to ROOT web context. Therefore ROOT had to be added.
*/
// return new String[] { ctx + "," + Web.ROOT_WEBAPP };
/* As of version 6.6 all packages are installed in one web application
* context, therefore the ROOT entry is no longer valid.
* This variation had first be introduced with the APLAWS integration
* package, which used to register an additional WebAppPatternGenerator,
* which simply cuts ","+ Web.ROOT_WEBAPP, under a different key
* "Webapp" (singular) */
return new String[] { ctx };
} }
} }

View File

@ -40,6 +40,7 @@ public class ForumTermPicker extends ACSObjectCategoryPicker {
public ForumTermPicker(BigDecimalParameter root, public ForumTermPicker(BigDecimalParameter root,
StringParameter mode) { StringParameter mode) {
super(root, mode); super(root, mode);
s_log.debug("instantiating ForumCategoryPicker"); s_log.debug("instantiating ForumCategoryPicker");
@ -47,9 +48,12 @@ public class ForumTermPicker extends ACSObjectCategoryPicker {
/* (non-Javadoc) /* (non-Javadoc)
* @see com.arsdigita.aplaws.ui.ACSObjectCategoryPicker#getForm(com.arsdigita.bebop.parameters.BigDecimalParameter, com.arsdigita.bebop.parameters.StringParameter) * @see com.arsdigita.aplaws.ui.ACSObjectCategoryPicker#getForm
* com.arsdigita.bebop.parameters.BigDecimalParameter,
* com.arsdigita.bebop.parameters.StringParameter)
*/ */
protected ACSObjectCategoryForm getForm(BigDecimalParameter root, StringParameter mode) { protected ACSObjectCategoryForm getForm(BigDecimalParameter root,
StringParameter mode) {
s_log.debug("getForm"); s_log.debug("getForm");
return new ForumTermForm(root, mode, new TermWidget(mode, this)); return new ForumTermForm(root, mode, new TermWidget(mode, this));
} }

View File

@ -26,7 +26,7 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
import com.arsdigita.aplaws.ui.ItemCategoryPicker; import com.arsdigita.london.terms.ui.ItemCategoryPicker;
import com.arsdigita.categorization.Category; import com.arsdigita.categorization.Category;
import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ContentBundle;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;

View File

@ -18,11 +18,11 @@
package com.arsdigita.aplaws; package com.arsdigita.aplaws;
import com.arsdigita.categorization.Categorization; //import com.arsdigita.categorization.Categorization;
import com.arsdigita.london.terms.TermCategoryListener; //import com.arsdigita.london.terms.TermCategoryListener;
import com.arsdigita.runtime.CompoundInitializer; import com.arsdigita.runtime.CompoundInitializer;
import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.DomainInitEvent;
import com.arsdigita.templating.PatternStylesheetResolver; //import com.arsdigita.templating.PatternStylesheetResolver;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -46,11 +46,17 @@ public class Initializer extends CompoundInitializer {
public void init(DomainInitEvent evt) { public void init(DomainInitEvent evt) {
super.init(evt); super.init(evt);
Categorization.addCategoryListener(new TermCategoryListener()); // Moved to terms initializer because it is a central responsibility of
// terms itself.
// /* Create new term in the proper terms domain whenever a new category
// * is created through CMS interface, keeping both insync */
// Categorization.addCategoryListener(new TermCategoryListener());
PatternStylesheetResolver.registerPatternGenerator( // /* Register additional PatternStyleSheetResolver for Web app.
"webapp", // * With all modules installing in one context no longer required. */
new WebAppPatternGenerator() // PatternStylesheetResolver.registerPatternGenerator(
); // "webapp",
// new WebAppPatternGenerator()
// );
} }
} }

View File

@ -37,6 +37,7 @@ import org.apache.log4j.Logger;
// At minimum the process for registering & looking up hierachical // At minimum the process for registering & looking up hierachical
// adapters can be shared. Also the mangling of names / paths. // adapters can be shared. Also the mangling of names / paths.
// Currently just used by ObjectTypeSchemaGenerator
/** /**
* <p>This class provides a general purpose framework for iterating * <p>This class provides a general purpose framework for iterating

View File

@ -26,6 +26,9 @@ import com.arsdigita.persistence.metadata.Property;
// some of their logic (provided it didn't cripple / obfuscate // some of their logic (provided it didn't cripple / obfuscate
// the API). // the API).
// Currently just used by ObjectTypeTraversal and SimpleObjectTypeAdapter
// of this package.
/** /**
* <p>This interface is used to control traversal of domain * <p>This interface is used to control traversal of domain
* objects. Whenever a property is encountered, the {@link * objects. Whenever a property is encountered, the {@link

View File

@ -37,11 +37,13 @@ import org.apache.log4j.Logger;
*/ */
public class WebAppPatternGenerator implements PatternGenerator { public class WebAppPatternGenerator implements PatternGenerator {
/** Private Logger instance for debugging purpose. */
private static final Logger s_log = private static final Logger s_log =
Logger.getLogger(WebAppPatternGenerator.class); Logger.getLogger(WebAppPatternGenerator.class);
public String[] generateValues(String key, public String[] generateValues(String key,
HttpServletRequest req) { HttpServletRequest req) {
Application app = Web.getContext().getApplication(); Application app = Web.getContext().getApplication();
String ctx = app == null ? null : app.getContextPath(); String ctx = app == null ? null : app.getContextPath();

View File

@ -1,46 +0,0 @@
/**
* Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.arsdigita.bundle.ui;
import com.arsdigita.bebop.PageState;
import com.arsdigita.cms.CMS;
import com.arsdigita.cms.ContentBundle;
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentPage;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.london.navigation.Navigation;
import com.arsdigita.london.terms.ui.AbstractAssignedTerms;
import org.apache.log4j.Logger;
public class AssignedIndexItemTerms extends AbstractAssignedTerms {
private static final Logger s_log = Logger.getLogger(AssignedIndexItemTerms.class);
protected ACSObject getObject(PageState state) {
ACSObject obj = Navigation.getConfig().getDefaultModel().getObject();
if (s_log.isDebugEnabled()) {
s_log.debug("Dealing with item " + obj);
}
return obj;
}
}

View File

@ -18,6 +18,7 @@
package com.arsdigita.london.terms; package com.arsdigita.london.terms;
import com.arsdigita.categorization.Categorization;
import com.arsdigita.categorization.Category; import com.arsdigita.categorization.Category;
import com.arsdigita.db.DbHelper; import com.arsdigita.db.DbHelper;
import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainObject;
@ -51,7 +52,9 @@ public class Initializer extends CompoundInitializer {
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
} }
@Override
public void init(DomainInitEvent e) { public void init(DomainInitEvent e) {
DomainObjectFactory.registerInstantiator DomainObjectFactory.registerInstantiator
(Domain.BASE_DATA_OBJECT_TYPE, (Domain.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() { new DomainObjectInstantiator() {
@ -63,6 +66,7 @@ public class Initializer extends CompoundInitializer {
DomainObjectFactory.registerInstantiator DomainObjectFactory.registerInstantiator
(Term.BASE_DATA_OBJECT_TYPE, (Term.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() { new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) { public DomainObject doNewInstance(DataObject dataObject) {
return new Term(dataObject); return new Term(dataObject);
} }
@ -71,6 +75,7 @@ public class Initializer extends CompoundInitializer {
DomainObjectFactory.registerInstantiator DomainObjectFactory.registerInstantiator
(Terms.BASE_DATA_OBJECT_TYPE, (Terms.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() { new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) { public DomainObject doNewInstance(DataObject dataObject) {
return new Terms(dataObject); return new Terms(dataObject);
} }
@ -124,5 +129,9 @@ public class Initializer extends CompoundInitializer {
XML.parse(Terms.getConfig().getTraversalAdapters(), XML.parse(Terms.getConfig().getTraversalAdapters(),
new TraversalHandler()); new TraversalHandler());
/* Create new term in the proper terms domain whenever a new category
* is created through CMS interface, keeping both insync */
Categorization.addCategoryListener(new TermCategoryListener());
} }
} }

View File

@ -18,8 +18,6 @@
*/ */
package com.arsdigita.london.terms; package com.arsdigita.london.terms;
import org.apache.log4j.Logger;
import com.arsdigita.categorization.Category; import com.arsdigita.categorization.Category;
import com.arsdigita.categorization.CategoryCollection; import com.arsdigita.categorization.CategoryCollection;
import com.arsdigita.categorization.CategoryListener; import com.arsdigita.categorization.CategoryListener;
@ -28,6 +26,8 @@ import com.arsdigita.kernel.ACSObject;
import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
import org.apache.log4j.Logger;
/** /**
* Attempts to create new term in the proper terms domain * Attempts to create new term in the proper terms domain
* whenever a new category is created through CMS interface. * whenever a new category is created through CMS interface.

View File

@ -27,6 +27,10 @@ import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
/**
*
*
*/
public class FlatCategoryPicker extends AbstractCategoryPicker { public class FlatCategoryPicker extends AbstractCategoryPicker {
public FlatCategoryPicker(String name) { public FlatCategoryPicker(String name) {

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
package com.arsdigita.aplaws.ui; package com.arsdigita.london.terms.ui;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.BigDecimalParameter;
@ -31,19 +31,20 @@ import com.arsdigita.london.terms.ui.TermWidget;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* <p> cms specific Concrete implementation of * Replacement for cms authoring ItemCategoryForm which replaces the
* category widget with a terms based widget.
*
* Provides a cms specific concrete implementation of
* <code>com.arsdigita.london.terms.ui.ACSObjectCategoryPicker</code>. </p> * <code>com.arsdigita.london.terms.ui.ACSObjectCategoryPicker</code>. </p>
* *
* * <p> Is is activated / used by pointing the parameter
*
* <p>Activated by pointing the parameter
* <code>com.arsdigita.cms.category_authoring_add_form<</code> to it.</p> * <code>com.arsdigita.cms.category_authoring_add_form<</code> to it.</p>
*/ */
public class ItemCategoryPicker extends ACSObjectCategoryPicker { public class ItemCategoryPicker extends ACSObjectCategoryPicker {
/** Private Logger instance for debugging */
private static final Logger s_log = Logger.getLogger(ItemCategoryPicker.class); private static final Logger s_log = Logger.getLogger(ItemCategoryPicker.class);
@ -71,6 +72,7 @@ public class ItemCategoryPicker extends ACSObjectCategoryPicker {
* @see com.arsdigita.london.terms.ui.ACSObjectCategoryPicker#getObject() * @see com.arsdigita.london.terms.ui.ACSObjectCategoryPicker#getObject()
*/ */
protected ACSObject getObject(PageState state) { protected ACSObject getObject(PageState state) {
ContentItem item = CMS.getContext().getContentItem(); ContentItem item = CMS.getContext().getContentItem();
return item.getParent(); return item.getParent();

View File

@ -50,7 +50,9 @@ public class RootCategoryPicker extends AbstractCategoryPicker {
*/ */
protected void addOptions( PageState state, protected void addOptions( PageState state,
SingleSelect target) { SingleSelect target) {
DataCollection domains = SessionManager.getSession()
DataCollection domains = SessionManager
.getSession()
.retrieve(Domain.BASE_DATA_OBJECT_TYPE); .retrieve(Domain.BASE_DATA_OBJECT_TYPE);
domains.addPath("model.id"); domains.addPath("model.id");
domains.addPath("model.objectType"); domains.addPath("model.objectType");
@ -58,8 +60,8 @@ public class RootCategoryPicker extends AbstractCategoryPicker {
target.addOption(new Option(null, "-- pick one --")); target.addOption(new Option(null, "-- pick one --"));
while (domains.next()) { while (domains.next()) {
Domain domain = (Domain) Domain domain = (Domain) DomainObjectFactory
DomainObjectFactory.newInstance(domains.getDataObject()); .newInstance(domains.getDataObject());
target.addOption( target.addOption(
new Option(new OID((String)domains.get("model.objectType"), new Option(new OID((String)domains.get("model.objectType"),

View File

@ -69,11 +69,6 @@ public class Loader extends PackageLoader {
s_log.debug("Creating an application type for shortcuts. " + s_log.debug("Creating an application type for shortcuts. " +
"Base Data Object Type: " + Shortcuts.BASE_DATA_OBJECT_TYPE); "Base Data Object Type: " + Shortcuts.BASE_DATA_OBJECT_TYPE);
/* Create legacy-campatible application type */
/* ApplicationType type = ApplicationType
.createApplicationType("shortcuts",
"CCM Shortcuts Admin",
Shortcuts.BASE_DATA_OBJECT_TYPE); */
/* Create legacy-free application type /* Create legacy-free application type
* NOTE: The wording in the title parameter of ApplicationType * NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets. * determines the name of the subdirectory for the XSL stylesheets.