Diverse Formatierungen und Bereinigungen.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1483 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-01-31 02:38:22 +00:00
parent ab0e27cf33
commit 2f0048fea7
21 changed files with 237 additions and 207 deletions

View File

@ -200,11 +200,9 @@
<xsl:choose> <xsl:choose>
<!-- CIs --> <!-- CIs -->
<xsl:when test="cms:contentPanel"> <xsl:when test="cms:contentPanel">
<xsl:apply-templates select="cms:contentPanel/cms:item"/> <xsl:apply-templates select="cms:contentPanel/cms:item"/>
<xsl:call-template name="fileAttachments" /> <xsl:call-template name="fileAttachments" />
<xsl:call-template name="associatedLinks" /> <xsl:call-template name="associatedLinks" />
<font family="arial">Data Protection and Information Sharing notice. No personal information you have given us will be passed on to third parties for commercial purposes. The Council's policy is that all information will be shared among officers and other agencies where the legal framework allows it, if this will help to improve the service you receive and to develop other services. If you do not wish certain information about you to be exchanged within the Council, you can request that this does not happen.
</font>
</xsl:when> </xsl:when>
<!-- A-Z --> <!-- A-Z -->
<xsl:when test="cms:alphabetNavigation"> <xsl:when test="cms:alphabetNavigation">

View File

@ -9,7 +9,8 @@
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator"> <xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
<!-- Content item is the simplest type --> <!-- Content item is the simplest type -->
<xrd:adapter objectType="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/id"/> <xrd:property name="/object/id"/>
<xrd:property name="/object/defaultDomainClass"/> <xrd:property name="/object/defaultDomainClass"/>
@ -33,7 +34,9 @@
</xrd:adapter> </xrd:adapter>
<!-- Special handling for Link (by Quasimodo)--> <!-- Special handling for Link (by Quasimodo)-->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.Link" extends="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.LinkTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.contenttypes.Link"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.LinkTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/targetItem/id"/> <xrd:property name="/object/targetItem/id"/>
<xrd:property name="/object/targetItem/defaultDomainClass"/> <xrd:property name="/object/targetItem/defaultDomainClass"/>
@ -50,7 +53,9 @@
</xrd:associations> </xrd:associations>
</xrd:adapter> </xrd:adapter>
<xrd:adapter objectType="com.arsdigita.cms.ContentPage" extends="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.ContentPage"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
@ -67,7 +72,9 @@
</xrd:adapter> </xrd:adapter>
<!-- Adds a text asset --> <!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.ContentPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentPage"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/textAsset/id"/> <xrd:property name="/object/textAsset/id"/>
<xrd:property name="/object/textAsset/defaultDomainClass"/> <xrd:property name="/object/textAsset/defaultDomainClass"/>
@ -129,7 +136,8 @@
<!-- Next the metadata for search --> <!-- Next the metadata for search -->
<xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider"> <xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider">
<!-- Content item is the simplest type --> <!-- Content item is the simplest type -->
<xrd:adapter objectType="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/id"/> <xrd:property name="/object/id"/>
<xrd:property name="/object/defaultDomainClass"/> <xrd:property name="/object/defaultDomainClass"/>
@ -153,7 +161,9 @@
</xrd:adapter> </xrd:adapter>
<!-- Adds a text asset --> <!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/textAsset/id"/> <xrd:property name="/object/textAsset/id"/>
<xrd:property name="/object/textAsset/defaultDomainClass"/> <xrd:property name="/object/textAsset/defaultDomainClass"/>
@ -214,7 +224,8 @@
<!-- Search metadata for file assets --> <!-- Search metadata for file assets -->
<xrd:context name="com.arsdigita.cms.search.AssetMetadataProvider"> <xrd:context name="com.arsdigita.cms.search.AssetMetadataProvider">
<xrd:adapter objectType="com.arsdigita.cms.FileAsset" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.FileAsset"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude"> <xrd:attributes rule="exclude">
<xrd:property name="/object/id"/> <xrd:property name="/object/id"/>
<xrd:property name="/object/content"/> <xrd:property name="/object/content"/>
@ -230,12 +241,15 @@
<!-- For assets, we want to pull out all HTML, or binary files --> <!-- For assets, we want to pull out all HTML, or binary files -->
<xrd:context name="com.arsdigita.cms.search.AssetExtractor"> <xrd:context name="com.arsdigita.cms.search.AssetExtractor">
<!-- Content item is the simplest type --> <!-- Content item is the simplest type -->
<xrd:adapter objectType="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:associations rule="include"/> <xrd:associations rule="include"/>
</xrd:adapter> </xrd:adapter>
<!-- Adds a text asset --> <!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.ContentItem" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> <xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:associations rule="include"> <xrd:associations rule="include">
<xrd:property name="/object/textAsset"/> <xrd:property name="/object/textAsset"/>
</xrd:associations> </xrd:associations>

View File

@ -105,7 +105,7 @@ public final class CMSConfig extends AbstractConfig {
* *
* @return The <code>ContentSectionConfig</code> record; it cannot be null * @return The <code>ContentSectionConfig</code> record; it cannot be null
*/ */
public static final synchronized CMSConfig getInstance() { public static synchronized CMSConfig getInstance() {
if (s_config == null) { if (s_config == null) {
s_config = new CMSConfig(); s_config = new CMSConfig();
s_config.load(); s_config.load();
@ -148,7 +148,8 @@ public final class CMSConfig extends AbstractConfig {
Parameter.REQUIRED, Parameter.REQUIRED,
"/default/folder.jsp"); "/default/folder.jsp");
/** /**
* Path for the default template folder. Path is relative to webapp root * Path or the root folter for template folders.
* Path is relative to webapp root.
*/ */
private final Parameter m_templateRootPath = private final Parameter m_templateRootPath =
new StringParameter( new StringParameter(
@ -696,6 +697,10 @@ public final class CMSConfig extends AbstractConfig {
loadInfo(); loadInfo();
} }
/**
* Retrieve path of the root folter for template folders.
* Path is relative to webapp root.
*/
public final String getTemplateRoot() { public final String getTemplateRoot() {
return (String) get(m_templateRootPath); return (String) get(m_templateRootPath);
} }

View File

@ -44,8 +44,10 @@ import javax.servlet.ServletException;
class BaseAsset extends ResourceHandlerImpl { class BaseAsset extends ResourceHandlerImpl {
private static final Logger s_log = Logger.getLogger(BaseAsset.class); private static final Logger s_log = Logger.getLogger(BaseAsset.class);
public final static String ASSET_ID = "asset_id"; public final static String ASSET_ID = "asset_id";
public static final String OID_PARAM = "oid"; public static final String OID_PARAM = "oid";
private final static String s_defaultName = "File"; private final static String s_defaultName = "File";
private static final BigDecimalParameter s_assetId = new BigDecimalParameter(ASSET_ID); private static final BigDecimalParameter s_assetId = new BigDecimalParameter(ASSET_ID);
private static final OIDParameter s_oid = new OIDParameter(OID_PARAM); private static final OIDParameter s_oid = new OIDParameter(OID_PARAM);
@ -72,7 +74,7 @@ class BaseAsset extends ResourceHandlerImpl {
} }
/** /**
* Sets RFC2183 governed Contnet-Disposition header to supply filename to * Sets RFC2183 governed Content-Disposition header to supply filename to
* client. See section 19.5.1 of RFC2616 for interpretation of * client. See section 19.5.1 of RFC2616 for interpretation of
* Content-Disposition in HTTP. * Content-Disposition in HTTP.
*/ */

View File

@ -55,6 +55,7 @@ public class ContentItemXSLServlet extends BaseServlet {
public static Map s_templateResolverCache = public static Map s_templateResolverCache =
Collections.synchronizedMap(new HashMap()); Collections.synchronizedMap(new HashMap());
@Override
protected void doService(HttpServletRequest sreq, protected void doService(HttpServletRequest sreq,
HttpServletResponse sresp) HttpServletResponse sresp)
throws ServletException, IOException { throws ServletException, IOException {

View File

@ -79,6 +79,7 @@ public class DefaultTemplateResolver extends AbstractTemplateResolver
public String getTemplate(ContentSection section, public String getTemplate(ContentSection section,
ContentItem item, ContentItem item,
HttpServletRequest request) { HttpServletRequest request) {
String template = getItemTemplate(section, item, request); String template = getItemTemplate(section, item, request);
MimeType mimeType = MimeType.loadMimeType(Template.JSP_MIME_TYPE); MimeType mimeType = MimeType.loadMimeType(Template.JSP_MIME_TYPE);

View File

@ -298,7 +298,7 @@ public class ServiceDispatcher extends LockableImpl implements Dispatcher {
* &lt;/dispatcher-configuration> * &lt;/dispatcher-configuration>
* </pre> * </pre>
*/ */
private final void readFromFile(final String file) { private void readFromFile(final String file) {
if ( isLocked() ) { if ( isLocked() ) {
s_log.error( s_log.error(

View File

@ -75,6 +75,7 @@ class DestinationStub {
return m_urlStub; return m_urlStub;
} }
@Override
public String toString() { public String toString() {
return "Doc Root " + m_documentRoot + return "Doc Root " + m_documentRoot +
(isSharedRoot() ? " (shared)" : " (not shared)") + (isSharedRoot() ? " (shared)" : " (not shared)") +

View File

@ -79,6 +79,7 @@ public class Initializer extends CompoundInitializer {
* registering object instantiators and observers. * registering object instantiators and observers.
* *
*/ */
@Override
public void init(DomainInitEvent e) { public void init(DomainInitEvent e) {
s_log.debug("publishToFile.Initializer.init(DomainInitEvent) invoked"); s_log.debug("publishToFile.Initializer.init(DomainInitEvent) invoked");
@ -106,6 +107,7 @@ public class Initializer extends CompoundInitializer {
public DomainObject doNewInstance(DataObject dataObject) { public DomainObject doNewInstance(DataObject dataObject) {
return new PublishedFile(dataObject); return new PublishedFile(dataObject);
} }
@Override
public DomainObjectInstantiator public DomainObjectInstantiator
resolveInstantiator(DataObject obj) { resolveInstantiator(DataObject obj) {
return this; return this;
@ -117,18 +119,6 @@ public class Initializer extends CompoundInitializer {
} }
// /**
// * An empty implementation of {@link Initializer#init(LegacyInitEvent)}.
// *
// * @param evt The legacy init event.
// */
// An empty implementations prevents this initializer from being executed.
// A missing implementations causes the super class method to be executed, which
// invokes the above added LegacyInitializer.
// That initializer starts P2fs background thread and creation of
// ~/packages/content-section/templates/content works now.
// SEE NEW LOCATION: ~/templates/ccm-cms/content-section
// public void init(LegacyInitEvent evt) {}
/** /**
* Implementation of the {@link Initializer#init(ContextInitEvent)} method * Implementation of the {@link Initializer#init(ContextInitEvent)} method
@ -138,6 +128,7 @@ public class Initializer extends CompoundInitializer {
* *
* @param evt The context init event. * @param evt The context init event.
**/ **/
@Override
public void init(ContextInitEvent evt) { public void init(ContextInitEvent evt) {
s_log.debug("publishToFile.Initializer.init(ContextInitEvent) invoked"); s_log.debug("publishToFile.Initializer.init(ContextInitEvent) invoked");
@ -193,6 +184,7 @@ public class Initializer extends CompoundInitializer {
* *
* @param evt The legacy init event. * @param evt The legacy init event.
**/ **/
@Override
public void close(ContextCloseEvent evt) { public void close(ContextCloseEvent evt) {
s_log.debug("publishToFile.Initializer.destroy() invoked"); s_log.debug("publishToFile.Initializer.destroy() invoked");

View File

@ -50,21 +50,27 @@ import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* Methods for writing content (as static pages) to the file * PublishToFile system provides two capability:
* system when an item is published, and removing the files when the * (1) It writes content as static html pages to the file system when an item is
* item is unpublished. * published and removes the files when the item is unpublished. It enables
* CCM to store content for delivery directly by a WEB server instead of
* generating pages dynamically every time a page is requested (standard usage).
* (2) It delivers (and synchronizes) templates stored in the database to the
* filesystem of each CCM instance (e.g. in a distributed multi tear
* environment but also in case of a single instance). User defined templates
* are stored in the database and must be synchronized with the filesystem
* in order to be used.
* *
* @author Jeff Teeters (teeters@arsdigita.com) * @author Jeff Teeters (teeters@arsdigita.com)
* @author <a href="mailto:dlutter@redhat.com">David Lutterkort</a> * @author <a href="mailto:dlutter@redhat.com">David Lutterkort</a>
* @version $Revision: #32 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Revision: #32 $ $DateTime: 2004/08/17 23:15:09 $
*/ */
public class PublishToFile implements PublishToFileListener { public class PublishToFile implements PublishToFileListener {
public static final int DEFAULT_TIMEOUT = 60; /** Private Logger instance for debugging purpose. */
private static Logger s_log = Logger.getLogger(PublishToFile.class);
private static Logger s_log = public static final int DEFAULT_TIMEOUT = 60;
Logger.getLogger(PublishToFile.class);
// Queue entry timeout // Queue entry timeout
// TODO: pickup value from configuration file as a single source! // TODO: pickup value from configuration file as a single source!

View File

@ -18,27 +18,20 @@
*/ */
package com.arsdigita.cms.publishToFile; package com.arsdigita.cms.publishToFile;
import com.arsdigita.cms.CMS;
import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.BooleanParameter;
// import com.arsdigita.util.parameter.ClassParameter;
import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.IntegerParameter;
import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.SpecificClassParameter; import com.arsdigita.util.parameter.SpecificClassParameter;
import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.StringParameter;
// import java.util.Arrays;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
// STATUS: All parameter and its values copied from the old Initializer class
// and from enterprise.init file.
// Temporary solution for m_destinations (destinations for published content
// items and template), returned as constant list.
/** /**
* Configuration object for the publish-to-file service. * Configuration object for the publish-to-file service.
* *
@ -47,10 +40,27 @@ import org.apache.log4j.Logger;
*/ */
public class PublishToFileConfig extends AbstractConfig { public class PublishToFileConfig extends AbstractConfig {
/** Private Logger instance for debugging purpose. */
private static final Logger s_log = Logger.getLogger(PublishToFileConfig.class); private static final Logger s_log = Logger.getLogger(PublishToFileConfig.class);
/** Private static instance of this class - singelton design pattern */
private static PublishToFileConfig s_conf; private static PublishToFileConfig s_conf;
/**
* Disable publish-to-filesystem for content items (not for templates!).
*
* NOTE: Templates are stored in the database and must be synchronized with
* the filesystem in order to be used. Therefore publish-to filesystem must
* not deactivated at all.
*/
private final Parameter
m_disableItemPfs = new BooleanParameter(
"com.arsdigita.cms.ptf.disable_item_pfs",
Parameter.REQUIRED,
new Boolean(true));
/** /**
* Temporary, constant list of publish destinations. It is intended as a * Temporary, constant list of publish destinations. It is intended as a
* temporary fix until we have a configurable pramameter * temporary fix until we have a configurable pramameter
@ -60,19 +70,7 @@ public class PublishToFileConfig extends AbstractConfig {
private static ArrayList s_tmpDestList; private static ArrayList s_tmpDestList;
/** /**
* Disable publish-to-filesystem for items other than templates. * List of publish destinations for content items.
* NOTE: Templates are stored in the database and must be synchronized with
* the filesystem in order to be used. Therefore publish-to filesystem must
* not deactivated at all.
*/
// Moved from ContentSectionConfig where this parameter was a temporary measure
// to allow limited parameter-based control of p2fs until MapParameter,
// which was intended to replace old Initilizer system's parameter
// implementation, is fully implemented)
private final Parameter m_disableItemPfs;
/**
* List of publish destinations for content types.
* Each list element is itself a four-element list in the format * Each list element is itself a four-element list in the format
* { "content type", "root directory", "shared storage", "url stub" }. * { "content type", "root directory", "shared storage", "url stub" }.
* *
@ -81,14 +79,29 @@ public class PublishToFileConfig extends AbstractConfig {
* webapp root(!). * webapp root(!).
* Shared storage must be true if the root directory is shared NFS storage, * Shared storage must be true if the root directory is shared NFS storage,
* false otherwise. * false otherwise.
* URL stub is the path componen3t of the URL from which the live * URL stub is the path component of the URL from which the live
* server will serve from this directory. * server will serve from this directory.
*/ */
// ToDO: Parameter destination is a list, but we have no ListParameter type // ToDO: Parameter destination is a list, but we have no ListParameter type
// for now. We have either to develop a ListParameter class or treat this // for now. We have either to develop a ListParameter class or treat this
// parameter as a set of StringArrayParameter. // parameter as a set of StringArrayParameter.
// Another possibility considered was MapParameter // Another possibility considered was MapParameter
private final Parameter m_destinations; // m_destinations is unfinished work! Not usable!
// Parameter is a list, but we have currently no ListParameter type.
// Others have considered to develop a MapParameter for it.
private final Parameter m_destinations = new StringParameter
("com.arsdigita.cms.ptf.destination", Parameter.REQUIRED,
"{ " +
" { 'com.arsdigita.cms.ContentItem', " +
" 'p2fs', " +
" false, " +
" '/p2fs' }, " +
" { 'com.arsdigita.cms.Template', " +
CMS.getConfig().getTemplateRoot() +
" false, " +
" '/templates' } " +
"} "
);
/** /**
* Class implementing PublishToFileListener Interface. * Class implementing PublishToFileListener Interface.
@ -98,7 +111,14 @@ public class PublishToFileConfig extends AbstractConfig {
* but custom classes can also be used. That can be used to perform * but custom classes can also be used. That can be used to perform
* additional actions when publishing or unpublishing to the file system. * additional actions when publishing or unpublishing to the file system.
*/ */
private final Parameter m_publishToFileListenerClass; // Originally (old initializer system):
// publishListener = "com.arsdigita.cms.publishToFile.PublishToFile";
private final Parameter
m_ListenerClass = new SpecificClassParameter(
"com.arsdigita.cms.ptf.listener_class",
Parameter.REQUIRED,
PublishToFile.class,
PublishToFileListener.class);
/** /**
* Time (in seconds) after system startup to wait before starting to monitor * Time (in seconds) after system startup to wait before starting to monitor
@ -109,7 +129,12 @@ public class PublishToFileConfig extends AbstractConfig {
* functionality of the system and is not recommended under normal * functionality of the system and is not recommended under normal
* conditions. * conditions.
*/ */
private final Parameter m_startupDelay; private final Parameter
m_startupDelay = new IntegerParameter(
"com.arsdigita.cms.ptf.startup_delay",
Parameter.REQUIRED,
new Integer(30) );
/** /**
* Time (in seconds) between checking whether there are entries in the * Time (in seconds) between checking whether there are entries in the
@ -117,22 +142,42 @@ public class PublishToFileConfig extends AbstractConfig {
* *
* A value <= 0 disables processing the queue on this server. * A value <= 0 disables processing the queue on this server.
*/ */
private final Parameter m_pollDelay; private final Parameter
m_pollDelay = new IntegerParameter(
"com.arsdigita.cms.ptf.poll_delay",
Parameter.REQUIRED,
new Integer(5) );
/** /**
* Time to wait (seconds) before retrying to process a failed entry. * Time to wait (seconds) before retrying to process a failed entry.
*/ */
private final Parameter m_retryDelay; private final Parameter
m_retryDelay = new IntegerParameter(
"com.arsdigita.cms.ptf.retry_delay",
Parameter.REQUIRED,
new Integer(120));
/** /**
* Time to wait (seconds) before aborting item request. * Time to wait (seconds) before aborting item request.
*/ */
private final Parameter m_requestTimeout; private final Parameter
m_requestTimeout = new IntegerParameter(
"com.arsdigita.cms.ptf.request_timeout",
Parameter.REQUIRED,
new Integer(60) );
/** /**
* Number of queue entries to process at once. * Number of queue entries to process at once.
*/ */
private final Parameter m_blockSize; private final Parameter
m_blockSize = new IntegerParameter(
"com.arsdigita.cms.ptf.block_size",
Parameter.REQUIRED,
new Integer(40) );
/** /**
* Method used to select entries for processing. * Method used to select entries for processing.
@ -142,7 +187,12 @@ public class PublishToFileConfig extends AbstractConfig {
* all elements in a folder can be done only once for the * all elements in a folder can be done only once for the
* folder). * folder).
*/ */
private final Parameter m_blockSelectMethod; private final Parameter
m_blockSelectMethod = new StringParameter(
"com.arsdigita.cms.ptf.block_select_method",
Parameter.REQUIRED,
"GroupByParent");
/** /**
* Number of times a failed queue entry will be reprocessed. * Number of times a failed queue entry will be reprocessed.
@ -151,8 +201,11 @@ public class PublishToFileConfig extends AbstractConfig {
* will ignore the action. * will ignore the action.
* The default value -1 will ignore this parameter. * The default value -1 will ignore this parameter.
*/ */
private final Parameter m_maximumFailCount; private final Parameter
m_maximumFailCount = new IntegerParameter(
"com.arsdigita.cms.ptf.maximum_fail_count",
Parameter.REQUIRED,
new Integer(10) );
/** /**
@ -174,82 +227,16 @@ public class PublishToFileConfig extends AbstractConfig {
/** /**
* Constructor. * Constructor.
* *
* Do not use it directly! * Do not use it directly! Use PublishToFileConfig.getConfig() instead
* (singelton design pattern!)
*/ */
public PublishToFileConfig() { public PublishToFileConfig() {
// Initialize field values
// Notice: Default now TRUE! Had previously be false.
// Parameter renamed and relocated, Adaptation of installation bundles
// required (version 6.0.2).
m_disableItemPfs = new BooleanParameter
("com.arsdigita.cms.publishToFile.disable_item_pfs",
Parameter.REQUIRED, new Boolean(true));
// m_destinations is unfinished work! Not usable!
// Parameter is a list, but we have currently no ListParameter type.
// Others have considered to develop a MapParameter for it.
m_destinations = new StringParameter
("com.arsdigita.cms.publishToFile.destination", Parameter.REQUIRED,
"{ " +
" { 'com.arsdigita.cms.ContentItem', " +
" 'p2fs', " +
" false, " +
" '/p2fs' }, " +
" { 'com.arsdigita.cms.Template', " +
" '/templates/ccm-cms/content-section', " +
" false, " +
" '/templates' } " +
"} "
);
// Originally (old initializer system):
// publishListener = "com.arsdigita.cms.publishToFile.PublishToFile";
m_publishToFileListenerClass = new SpecificClassParameter
("com.arsdigita.cms.publishToFile.publish_to_file_listener_class",
Parameter.REQUIRED,
PublishToFile.class,
PublishToFileListener.class);
// Queue management parameters.
m_startupDelay = new IntegerParameter
("com.arsdigita.cms.publishToFile.startup_delay", Parameter.REQUIRED,
new Integer(30));
m_pollDelay = new IntegerParameter
("com.arsdigita.cms.publishToFile.poll_delay", Parameter.REQUIRED,
new Integer(5));
m_retryDelay = new IntegerParameter
("com.arsdigita.cms.publishToFile.retry_delay", Parameter.REQUIRED,
new Integer(120));
m_requestTimeout = new IntegerParameter
("com.arsdigita.cms.publishToFile.request_timeout", Parameter.REQUIRED,
new Integer(60));
m_blockSize = new IntegerParameter
("com.arsdigita.cms.publishToFile.block_size", Parameter.REQUIRED,
new Integer(40));
m_blockSelectMethod = new StringParameter
("com.arsdigita.cms.publishToFile.block_select_method", Parameter.REQUIRED,
"GroupByParent");
m_maximumFailCount = new IntegerParameter
("com.arsdigita.cms.publishToFile.maximum_fail_count", Parameter.REQUIRED,
new Integer(10));
// Register parameters // Register parameters
register(m_disableItemPfs); register(m_disableItemPfs);
// register(m_destinations); Unfinished; currently not usable // register(m_destinations); Unfinished; currently not usable
register(m_publishToFileListenerClass); register(m_ListenerClass);
register(m_startupDelay); register(m_startupDelay);
register(m_pollDelay); register(m_pollDelay);
register(m_retryDelay); register(m_retryDelay);
@ -308,15 +295,15 @@ public class PublishToFileConfig extends AbstractConfig {
s_tmpDestList = new ArrayList(); s_tmpDestList = new ArrayList();
s_tmpDestList.add s_tmpDestList.add
( new ArrayList() {{ add("com.arsdigita.cms.ContentItem"); ( new ArrayList() {{ add("com.arsdigita.cms.ContentItem");
add("p2fs"); add("html");
add(new Boolean(false)); add(new Boolean(false));
add("/p2fs"); add("/html");
}} }}
); );
s_tmpDestList.add s_tmpDestList.add
( new ArrayList() {{ ( new ArrayList() {{
add("com.arsdigita.cms.Template"); add("com.arsdigita.cms.Template");
add("templates/ccm-cms/content-section"); add( CMS.getConfig().getTemplateRoot() );
add(new Boolean(false)); add(new Boolean(false));
add("/templates"); add("/templates");
}} }}
@ -333,7 +320,7 @@ public class PublishToFileConfig extends AbstractConfig {
* @return PublishToFileListener implementation class * @return PublishToFileListener implementation class
*/ */
public Class getPublishListenerClass() { public Class getPublishListenerClass() {
return (Class) get(m_publishToFileListenerClass); return (Class) get(m_ListenerClass);
} }
/** /**

View File

@ -1,41 +1,50 @@
com.arsdigita.cms.disable_item_pfs.title=Disable (non-Template) Item p2fs com.arsdigita.cms.ptf.disable_item_pfs.title=Disable (non-Template) Item p2fs
com.arsdigita.cms.disable_item_pfs.purpose=Disable publish-to-filesystem for items other than templates. com.arsdigita.cms.ptf.disable_item_pfs.purpose=Disable publish-to-filesystem for items other than templates.
com.arsdigita.cms.disable_item_pfs.example=true com.arsdigita.cms.ptf.disable_item_pfs.example=true
com.arsdigita.cms.disable_item_pfs.format=[boolean] com.arsdigita.cms.ptf.disable_item_pfs.format=[boolean]
com.arsdigita.cms.ptf.destination.title=Comming soon
com.arsdigita.cms.ptf.destination.purpose=Comming soon
com.arsdigita.cms.ptf.destination.example=Comming soon
com.arsdigita.cms.ptf.destination.format=Comming soon
com.arsdigita.cms.publish_to_file_class.title=Publish to File listener class com.arsdigita.cms.ptf.listener_class.title=Publish to File listener class
com.arsdigita.cms.publish_to_file_class.purpose=Class implementing PublishToFileListener. Contains the initial methods called when publishing or unpublishing. Normally this should be set to com.arsdigita.cms.publishToFile.PublishToFile, but custom classes can also be used. com.arsdigita.cms.ptf.listener_class.purpose=Class implementing PublishToFileListener. Contains the initial methods called when publishing or unpublishing. Normally this should be set to com.arsdigita.cms.publishToFile.PublishToFile, but custom classes can also be used.
com.arsdigita.cms.publish_to_file_class.example=com.arsdigita.cms.publishToFile.PublishToFile com.arsdigita.cms.ptf.listener_class.example=com.arsdigita.cms.publishToFile.PublishToFile
com.arsdigita.cms.publish_to_file_class.format=[class] com.arsdigita.cms.ptf.listener_class.format=[class]
com.arsdigita.cms.ptf.startup_delay.title=Publish to File Startup Delay
com.arsdigita.cms.ptf.startup_delay.purpose=Time after system startup to wait before starting to monitor publishToFile queue (in seconds).
com.arsdigita.cms.ptf.startup_delay.example=30
com.arsdigita.cms.ptf.startup_delay.format=[integer]
waf.notification.request_manager_delay.title=Request Manager Delay com.arsdigita.cms.ptf.poll_delay.title=Publish to File Poll Delay
waf.notification.request_manager_delay.purpose=Start of request manager's delay in seconds. com.arsdigita.cms.ptf.poll_delay.purpose=Time between checking whether there are entries in the publishToFile queue (in seconds).
waf.notification.request_manager_delay.example=900 com.arsdigita.cms.ptf.poll_delay.example=5
waf.notification.request_manager_delay.format=[integer] com.arsdigita.cms.ptf.poll_delay.format=[integer]
waf.notification.request_manager_period.title=Request Manager Period com.arsdigita.cms.ptf.retry_delay.title=Publish to File Retry Delay
waf.notification.request_manager_period.purpose=Request manager's activities period in seconds com.arsdigita.cms.ptf.retry_delay.purpose=Time to wait before retrying to process a failed entry (in seconds).
waf.notification.request_manager_period.example=900 com.arsdigita.cms.ptf.retry_delay.example=120
waf.notification.request_manager_period.format=[integer] com.arsdigita.cms.ptf.retry_delay.format=[integer]
waf.notification.simple_queue.title=Simple Queue Delay com.arsdigita.cms.ptf.request_timeout.title=Publish to File Request Timeout
waf.notification.simple_queue_delay.purpose=Start of Simple Queue's delay in seconds. com.arsdigita.cms.ptf.request_timeout.purpose=Time to wait (seconds) before aborting item request.
waf.notification.simple_queue_delay.example=900 com.arsdigita.cms.ptf.request_timeout.example=60
waf.notification.simple_queue_delay.format=[integer] com.arsdigita.cms.ptf.request_timeout.format=[integer]
waf.notification.simple_queue_period.title=Simple Queue Period com.arsdigita.cms.ptf.block_size.title=Publish to File Block Size
waf.notification.simple_queue_period.purpose=Simple Queue 's activities period in seconds com.arsdigita.cms.ptf.block_size.purpose=Number of queue entries to process at once.
waf.notification.simple_queue_period.example=900 com.arsdigita.cms.ptf.block_size.example=40
waf.notification.simple_queue_period.format=[integer] com.arsdigita.cms.ptf.block_size.format=[integer]
waf.notification.digest_queue.title=Digest Queue Delay com.arsdigita.cms.ptf.block_select_method.title=Publish to File Block Select Method
waf.notification.digest_queue_delay.purpose=Start of Digest Queue's delay in seconds. com.arsdigita.cms.ptf.block_select_method.purpose=Method used to select entries for processing.
waf.notification.digest_queue_delay.example=900 com.arsdigita.cms.ptf.block_select_method.example=[QueuedOrder|GroupByParent]
waf.notification.digest_queue_delay.format=[integer] com.arsdigita.cms.ptf.block_select_method.format=[String]
com.arsdigita.cms.ptf.maximum_fail_count.title=Publish to File Maximum Fails
com.arsdigita.cms.ptf.maximum_fail_count.purpose=If Fail Count in database is more than specified limit, Queue Manager will ignore the action.
com.arsdigita.cms.ptf.maximum_fail_count.example=10
com.arsdigita.cms.ptf.maximum_fail_count.format=[integer]
waf.notification.digest_queue_period.title=Digest Queue Period
waf.notification.digest_queue_period.purpose=Digest Queue 's activities period in seconds
waf.notification.digest_queue_period.example=900
waf.notification.digest_queue_period.format=[integer]

View File

@ -39,7 +39,7 @@ import org.apache.log4j.Logger;
/** /**
* Update from CCM version 6.6.1 to 6.6.2 where loader has been refactored to * Update from CCM version 6.6.1 to 6.6.2 where loader has been refactored to
* use (new style) applications in package com.arsdigita.weg instead of old * use (new style) applications in package com.arsdigita.web instead of old
* style applications using com.arsdigita.kermel.[Package* & SiteNode]. * style applications using com.arsdigita.kermel.[Package* & SiteNode].
* *
* Affected are the packages CMS Workspace and Service. They are now loaded * Affected are the packages CMS Workspace and Service. They are now loaded

View File

@ -614,6 +614,7 @@ public abstract class BaseDispatcherServlet extends HttpServlet
StringBuffer m_buffer = new StringBuffer(); StringBuffer m_buffer = new StringBuffer();
@Override
public InputSource resolveEntity(String publicId, String systemId) public InputSource resolveEntity(String publicId, String systemId)
throws SAXException { throws SAXException {
// we don't want to read the web.xml dtd // we don't want to read the web.xml dtd
@ -634,12 +635,14 @@ public abstract class BaseDispatcherServlet extends HttpServlet
} }
} }
@Override
public void characters(char[] ch, int start, int len) { public void characters(char[] ch, int start, int len) {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
m_buffer.append(ch[start + i]); m_buffer.append(ch[start + i]);
} }
} }
@Override
public void endElement(String uri, public void endElement(String uri,
String localName, String localName,
String qname) { String qname) {

View File

@ -42,6 +42,7 @@ public class RedirectorServlet extends HttpServlet {
public String m_target = null; public String m_target = null;
@Override
public void init() throws ServletException { public void init() throws ServletException {
ServletConfig conf = getServletConfig(); ServletConfig conf = getServletConfig();
m_target = conf.getInitParameter(PARAM_NAME); m_target = conf.getInitParameter(PARAM_NAME);
@ -50,6 +51,7 @@ public class RedirectorServlet extends HttpServlet {
} }
} }
@Override
public void service(HttpServletRequest req, HttpServletResponse resp) public void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException { throws ServletException, IOException {
@ -60,5 +62,6 @@ public class RedirectorServlet extends HttpServlet {
DispatcherHelper.sendExternalRedirect(resp, m_target); DispatcherHelper.sendExternalRedirect(resp, m_target);
} }
@Override
public void destroy() { } public void destroy() { }
} }

View File

@ -59,9 +59,19 @@ class BaseDispatcher {
return s_cache.isCached(path); return s_cache.isCached(path);
} }
/**
* Does all the work!
*
* @param sreq
* @param sresp
* @return
* @throws ServletException
* @throws IOException
*/
final boolean dispatch(final HttpServletRequest sreq, final boolean dispatch(final HttpServletRequest sreq,
final HttpServletResponse sresp) final HttpServletResponse sresp)
throws ServletException, IOException { throws ServletException, IOException {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Dispatching request " + sreq.getRequestURI() + " [" + s_log.debug("Dispatching request " + sreq.getRequestURI() + " [" +
sreq.getContextPath() + "," + sreq.getContextPath() + "," +
@ -160,11 +170,12 @@ class BaseDispatcher {
} }
} }
private final void forward(String contextPath, private void forward(String contextPath,
final String target, final String target,
final HttpServletRequest sreq, final HttpServletRequest sreq,
final HttpServletResponse sresp) final HttpServletResponse sresp)
throws ServletException, IOException { throws ServletException, IOException {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Forwarding by path to target '" + target + "'"); s_log.debug("Forwarding by path to target '" + target + "'");
} }
@ -277,6 +288,7 @@ class BaseDispatcher {
return target.toString(); return target.toString();
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if ( obj==null ) { return false; } if ( obj==null ) { return false; }

View File

@ -88,6 +88,9 @@ public class DispatcherServlet extends BaseServlet {
private String m_fallbackName = null; private String m_fallbackName = null;
private final BaseDispatcher m_dispatcher; private final BaseDispatcher m_dispatcher;
/**
*
*/
public DispatcherServlet() { public DispatcherServlet() {
m_dispatcher = new BaseDispatcher(); m_dispatcher = new BaseDispatcher();
} }
@ -106,16 +109,17 @@ public class DispatcherServlet extends BaseServlet {
@Override @Override
protected void doService(final HttpServletRequest sreq, protected void doService(final HttpServletRequest sreq,
final HttpServletResponse sresp) final HttpServletResponse sresp)
throws ServletException, IOException { throws ServletException, IOException {
DeveloperSupport.requestStart
(new RequestEvent(sreq, sresp, null, true, false));
DeveloperSupport.requestStart(new RequestEvent(
sreq, sresp, null, true, false));
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Servicing request '" + sreq.getRequestURI() + "'"); s_log.debug("Servicing request '" + sreq.getRequestURI() + "'");
} }
DeveloperSupport.startStage("BaseDispatcher.dispatch"); DeveloperSupport.startStage("BaseDispatcher.dispatch");
/* Try to dispatch to an applications servlet (i.e. new style legacy free) */
boolean dispatched = m_dispatcher.dispatch(sreq, sresp); boolean dispatched = m_dispatcher.dispatch(sreq, sresp);
DeveloperSupport.endStage("BaseDispatcher.dispatch"); DeveloperSupport.endStage("BaseDispatcher.dispatch");

View File

@ -65,6 +65,7 @@ public final class WebConfig extends AbstractConfig {
private final Parameter m_secureSwitchBack; private final Parameter m_secureSwitchBack;
public WebConfig() { public WebConfig() {
m_scheme = new DefaultSchemeParameter m_scheme = new DefaultSchemeParameter
("waf.web.default_scheme", Parameter.REQUIRED, "http"); ("waf.web.default_scheme", Parameter.REQUIRED, "http");

View File

@ -200,16 +200,14 @@
<xsl:choose> <xsl:choose>
<!-- CIs --> <!-- CIs -->
<xsl:when test="cms:contentPanel"> <xsl:when test="cms:contentPanel">
<xsl:apply-templates select="cms:contentPanel/cms:item"/> <xsl:apply-templates select="cms:contentPanel/cms:item"/>
<xsl:call-template name="fileAttachments" /> <xsl:call-template name="fileAttachments" />
<xsl:call-template name="associatedLinks" /> <xsl:call-template name="associatedLinks" />
<font family="arial">Data Protection and Information Sharing notice. No personal information you have given us will be passed on to third parties for commercial purposes. The Council's policy is that all information will be shared among officers and other agencies where the legal framework allows it, if this will help to improve the service you receive and to develop other services. If you do not wish certain information about you to be exchanged within the Council, you can request that this does not happen.
</font>
</xsl:when> </xsl:when>
<!-- A-Z --> <!-- A-Z -->
<xsl:when test="cms:alphabetNavigation"> <xsl:when test="cms:alphabetNavigation">
<xsl:apply-templates select="ui:simplePageContent/cms:alphabetNavigation"/> <xsl:apply-templates select="ui:simplePageContent/cms:alphabetNavigation"/>
<div id="navSpace"><img src="{$theme-prefix}/images/spacer.gif" alt="*" /></div> <div id="navSpace"><img src="{$theme-prefix}/images/spacer.gif" alt="*" /></div>
</xsl:when> </xsl:when>
<!-- Nav pages --> <!-- Nav pages -->
<xsl:otherwise> <xsl:otherwise>

View File

@ -108,8 +108,8 @@
<!-- Content Types --> <!-- Content Types -->
<!-- <!--
<ccm:application name="ccm-cms-types-agenda"/>
--> -->
<ccm:application name="ccm-cms-types-agenda"/>
<ccm:application name="ccm-cms-types-faqitem"/> <ccm:application name="ccm-cms-types-faqitem"/>
<ccm:application name="ccm-cms-types-glossaryitem"/> <ccm:application name="ccm-cms-types-glossaryitem"/>
<ccm:application name="ccm-cms-types-htmlform"/> <ccm:application name="ccm-cms-types-htmlform"/>

View File

@ -163,7 +163,7 @@
<a href="/copyright" title="copyright">copyright</a> <a href="/copyright" title="copyright">copyright</a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;nbsp;</xsl:text> <xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;nbsp;</xsl:text>
<a href="/disclaimer" title="disclaimer and privacy statement" accesskey="8">disclaimer and privacy statement</a> <a href="/disclaimer" title="disclaimer and privacy statement" accesskey="8">disclaimer and privacy statement</a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;</xsl:text> <xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;nbsp;</xsl:text>
<a href="/contact" title="contact" accesskey="9">contact</a> <a href="/contact" title="contact" accesskey="9">contact</a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;nbsp;</xsl:text> <xsl:text disable-output-escaping="yes">&amp;nbsp;|&amp;nbsp;</xsl:text>
<a href="/accessibility" title="accessibility statement" accesskey="0">accessibility</a> <a href="/accessibility" title="accessibility statement" accesskey="0">accessibility</a>
@ -187,23 +187,16 @@
</xsl:template> </xsl:template>
<xsl:template name="pageContent"> <xsl:template name="pageContent">
<a class="intLink" name="top" /> <a class="intLink" name="top" />
<xsl:choose> <xsl:choose>
<!-- CIs --> <!-- CIs -->
<xsl:when test="cms:contentPanel"> <xsl:when test="cms:contentPanel">
<xsl:apply-templates select="cms:contentPanel/cms:item"/> <xsl:apply-templates select="cms:contentPanel/cms:item"/>
<xsl:call-template name="fileAttachments" /> <xsl:call-template name="fileAttachments" />
<xsl:call-template name="associatedLinks" /> <xsl:call-template name="associatedLinks" />
<font family="arial">Data Protection and Information Sharing notice. No personal information you have given us will be passed on to third parties for commercial purposes. The Council's policy is that all information will be shared among officers and other agencies where the legal framework allows it, if this will help to improve the service you receive and to develop other services. If you do not wish certain information about you to be exchanged within the Council, you can request that this does not happen. <font family="arial">
</font> </font>
</xsl:when> </xsl:when>
<!-- A-Z --> <!-- A-Z -->
<xsl:when test="cms:alphabetNavigation"> <xsl:when test="cms:alphabetNavigation">