Beseitigen Fehler mit Initialisierung PublishToFile, diverse Formatierungen.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1486 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-02-03 17:27:05 +00:00
parent 5d6b8e9b9c
commit 19da24d433
20 changed files with 335 additions and 69 deletions

View File

@ -616,9 +616,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
* The item's root is the ancestor reachable through repeated
* <code>getParent()</code> calls whose parent is
* <code>null</code>. This is usually a folder, but may be any
* {
*
* @see com.arsdigita.kernel.ACSObject}.
* {@see com.arsdigita.kernel.ACSObject}.
*
* Note that the name of the root folder of the content section where the
* item resides is not included in the path.

View File

@ -47,8 +47,6 @@ import com.arsdigita.web.BaseApplicationServlet;
import com.arsdigita.web.LoginSignal;
import com.arsdigita.web.Web;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
@ -61,7 +59,10 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
/**
* Content Section's application servlet
*
* Repaired ItemURLCache to save multilingual items with automatic
* language negotiation. The cahce now uses the remaining url part
@ -74,23 +75,23 @@ import javax.servlet.http.HttpServletResponse;
public class ContentSectionServlet extends BaseApplicationServlet {
private static final Logger s_log =
Logger.getLogger(ContentSectionServlet.class);
/** Stringarray of file name patterns for index files. Should be made
configurable. */
private static final String[] WELCOME_FILES = new String[] {
"index.jsp", "index.html"
};
private static final Logger s_log =
Logger.getLogger(ContentSectionServlet.class);
private ContentItemDispatcher m_disp = new ContentItemDispatcher();
public static Map s_itemResolverCache =
Collections.synchronizedMap(new HashMap());
public static Map s_itemResolverCache = Collections
.synchronizedMap(new HashMap());
//cache the content items
/** cache the content items */
private static Map s_itemURLCacheMap = null;
/**
* The context for previewing items
*/
/** The context for previewing items */
public static final String PREVIEW = "/preview";
public static final String FILE_SUFFIX = ".jsp";
public static final String INDEX_FILE = "/index";
@ -107,17 +108,20 @@ public class ContentSectionServlet extends BaseApplicationServlet {
private static final String CACHE_KEY_DELIMITER = "%";
/**
* Implements the service method of BaseApplicationServlet
* @see com.arsdigita.web.BaseApplicationServlet#doService
* (HttpServletRequest, HttpServletResponse, Application)
*/
protected void doService
(HttpServletRequest sreq, HttpServletResponse sresp, Application app)
throws ServletException, IOException {
protected void doService( HttpServletRequest sreq,
HttpServletResponse sresp,
Application app)
throws ServletException, IOException {
ContentSection section = (ContentSection) app;
RequestContext ctx = DispatcherHelper.getRequestContext();
String url = ctx.getRemainingURLPart();
String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext
if (s_log.isInfoEnabled()) {
s_log.info("Resolving item URL " + url);
@ -129,6 +133,8 @@ public class ContentSectionServlet extends BaseApplicationServlet {
final ContentItem item = getItem(section, url, itemResolver);
if (item != null) {
/* We have to serve an item here */
String param = sreq.getParameter("transID");
if (param != null) {
@ -148,7 +154,10 @@ public class ContentSectionServlet extends BaseApplicationServlet {
}
serveItem(sreq, sresp, section, item);
} else {
/* We have to deal with a content-section, folder or an other bit*/
if (s_log.isInfoEnabled()) {
s_log.info("NOT serving content item");
}
@ -196,6 +205,15 @@ public class ContentSectionServlet extends BaseApplicationServlet {
}
}
/**
*
* @param sreq
* @param sresp
* @param section
* @param item
* @throws ServletException
* @throws IOException
*/
private void serveItem(HttpServletRequest sreq,
HttpServletResponse sresp,
ContentSection section,

View File

@ -59,7 +59,9 @@ import org.apache.log4j.Logger;
//
// Next Try
// Refactor using legacy compatible web/Application and ApplicationSetup DONE
// Refactor content-section als legacy free application
// Refactor workspace (content-center) as a legacy free application
// Refactor cms-service as a legacy free application
/**
* <p>Executes nonrecurring at install time and loads (installs and initializes)
@ -93,10 +95,10 @@ public class Loader extends PackageLoader {
private static final Logger s_log = Logger.getLogger(Loader.class);
/** Loader configuration object, singleton design pattern
* NOTE: LoaderConfig only supplies unmutable hatrd coded defaults! It is
* not possible to alter any to the contained values by specifiying an
* NOTE: LoaderConfig only supplies unmutable hard coded defaults! It is
* not possible to alter any of the contained values by specifiying an
* configuration parameter during load step. If a configuration value
* has to be configurable at load time, the parameter must be relcated
* has to be configurable at load time, the parameter must be relocated
* into this Loader class! */
private static final LoaderConfig s_conf = LoaderConfig.getInstance();
@ -116,13 +118,12 @@ public class Loader extends PackageLoader {
new String[] {"content"}
);
/** List of classnames of internal base content types (needed in every
* section created), generated while loading those content types in
* loadContentTypeDefinitions(files) for later use in register step. */
private ArrayList m_content_type_list = new ArrayList();
/**
* Standard constructor.
*/
@ -192,7 +193,7 @@ public class Loader extends PackageLoader {
}
/**
* Loads and instantiates the Workspace package (content-center) in the
* Loads and instantiates the Workspace subpackage (content-center) in the
* database.
* It is made public to be able to invoke it from the update script
* (e.g. 6.6.1-6.6.2).
@ -323,7 +324,7 @@ public class Loader extends PackageLoader {
* NOTE: At ccm-cms load time no content type packages are available because
* any content type depends on ccm-cms. Therefore, the loading step can not
* process content type package assignment! Instead each content type itself
* must assign itself to an apropriate content section at it's load time.
* must assign itself to an appropriate content section at it's load time.
* Cf. {@link com.arsdigita.cms.contenttype.AbstractContentTypeLoader}.
*
* But the load step has to process the cms internal content types!
@ -332,27 +333,49 @@ public class Loader extends PackageLoader {
// Step 1: Create content section application type
// prerequisite for concrete content-section instance creation.
ApplicationSetup appType = new ApplicationSetup(s_log);
appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE);
appType.setKey(ContentSection.PACKAGE_TYPE); // by default: content-section
appType.setTitle("CMS Content Section");
appType.setDescription("A CMS Content Section");
appType.setPortalApplication(false);
// ////////////// Deprecated style to create app type ///////////////
// ////////////// Delete when migration process completed ///////////////
// ApplicationSetup appType = new ApplicationSetup(s_log);
// appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE);
// appType.setKey(ContentSection.PACKAGE_TYPE); // by default: content-section
// appType.setTitle("CMS Content Section");
// appType.setDescription("A CMS Content Section");
// appType.setPortalApplication(false);
//setup.setDispatcherClass(ContentItemDispatcher.class.getName());
// contains the xsl to generate the page
// ApplicationSetup requires an Instantiator which has to be set here
// Setting it up in Initializer prior to creating the application type
// doesn't work!
appType.setInstantiator(new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) {
return new ContentSection(dataObject);
}
});
appType.run();
// appType.setInstantiator(new ACSObjectInstantiator() {
// @Override
// public DomainObject doNewInstance(DataObject dataObject) {
// return new ContentSection(dataObject);
// }
// });
// appType.run();
// ////////////////////////////////////////////////////////////////////////
/* Create new stype legacy compatible application type * /
ApplicationType type = ApplicationType
.createApplicationType(ContentSection.PACKAGE_TYPE,
"CMS Content Section",
ContentSection.BASE_DATA_OBJECT_TYPE);
*/
/* Create legacy-free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.
* It gets "urlized", i.e. trimming leading and trailing blanks and
* replacing blanks between words and illegal characters with an
* hyphen and converted to lower case.
* "Content Section" will become "content-section". */
ApplicationType type = new ApplicationType(
"Content Section",
ContentSection.BASE_DATA_OBJECT_TYPE );
type.setDescription("A CMS Content Section.");
type.save();
// Step 2: Load CMS specific privileges into central (core) privilege
// system.
createPrivileges();

View File

@ -29,12 +29,12 @@ import com.arsdigita.mimetypes.MimeType;
* Represents a collection of template mappings along with their
* link attributes.
*
* @author Stanislav Freidin (sfreidin@arsdigita.com)
* @version $Id: TemplateCollection.java 2090 2010-04-17 08:04:14Z pboy $
*
* @see com.arsdigita.domain.DomainCollection
* @see com.arsdigita.persistence.DataCollection
* @see com.arsdigita.cms.ItemTemplateCollection
*
* @author Stanislav Freidin (sfreidin@arsdigita.com)
* @version $Id: TemplateCollection.java 2090 2010-04-17 08:04:14Z pboy $
*/
public abstract class TemplateCollection extends DomainCollection {
@ -55,6 +55,7 @@ public abstract class TemplateCollection extends DomainCollection {
* before <code>next()</code> is called on this collection.
*
*/
@Override
public void addOrder(String order) {
m_dataCollection.addOrder(order);
}
@ -90,6 +91,7 @@ public abstract class TemplateCollection extends DomainCollection {
/**
* Filter this collection for equality by the specified attribute
*/
@Override
public Filter addEqualsFilter(String attr, Object value)
throws PersistenceException {
return m_dataCollection.addEqualsFilter(attr, value);

View File

@ -61,7 +61,7 @@ import com.arsdigita.mimetypes.MimeType;
* @author Stanislav Freidin (sfreidin@arsdigita.com)
* @version $Revision: #9 $ $DateTime: 2004/08/17 23:15:09 $
* @version $Id: TemplateManager.java 2090 2010-04-17 08:04:14Z pboy $
**/
*/
public interface TemplateManager {
/**

View File

@ -97,7 +97,7 @@ public class PublishToFileConfig extends AbstractConfig {
" false, " +
" '/p2fs' }, " +
" { 'com.arsdigita.cms.Template', " +
CMS.getConfig().getTemplateRoot() +
" '/templates/ccm-cms/content-section', " +
" false, " +
" '/templates' } " +
"} "

View File

@ -55,12 +55,13 @@ import org.apache.log4j.Logger;
* Contains various generally useful procedural abstractions.
*
* @author Bill Schneider
* @version ACS 4.5
* @since 4.5
* @version $Id: DispatcherHelper.java 311 2005-02-28 11:10:00Z mbooth $
* @since 4.5 */
*/
public final class DispatcherHelper implements DispatcherConstants {
private static final Logger s_log = Logger.getLogger(DispatcherHelper.class);
private static String s_webappCtx;
private static String s_staticURL;
private static boolean s_cachingActive;
@ -85,6 +86,7 @@ public final class DispatcherHelper implements DispatcherConstants {
initialized = true;
}
/**
* The current HttpServletRequest.
*/
@ -841,6 +843,7 @@ public final class DispatcherHelper implements DispatcherConstants {
* Gets the current HttpServletRequest for this thread.
* @return the current HttpServletRequest for this thread.
*/
public static HttpServletRequest getRequest() {
init();
return (HttpServletRequest) s_request.get();

View File

@ -62,7 +62,7 @@ import org.apache.log4j.Logger;
* @version $Id: JSPApplicationDispatcher.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class JSPApplicationDispatcher extends BaseDispatcherServlet
implements Dispatcher {
implements Dispatcher {
private static final Logger s_log = Logger.getLogger
(JSPApplicationDispatcher.class);

View File

@ -33,6 +33,8 @@ package com.arsdigita.kernel;
* @since ACS 5.0
* @version $Revision: #7 $, $Date: 2004/08/16 $
* @version $Id: PackageEventListener.java 287 2005-02-22 00:29:02Z sskracic $
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public interface PackageEventListener {
@ -42,6 +44,8 @@ public interface PackageEventListener {
*
* @param siteNode the SiteNode where the instance is mounted
* @param pkg the instance being mounted
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void onMount(SiteNode siteNode, PackageInstance pkg);
@ -51,6 +55,8 @@ public interface PackageEventListener {
*
* @param siteNode the SiteNode where the instance is mounted
* @param pkg the instance being unmounted
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void onUnmount(SiteNode siteNode, PackageInstance pkg);
@ -59,6 +65,8 @@ public interface PackageEventListener {
* Called when a new package instance is created.
*
* @param pkg a PackageInstance value
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void onCreate(PackageInstance pkg);
@ -66,6 +74,8 @@ public interface PackageEventListener {
* Describe onDelete method here.
*
* @param pkg a PackageInstance value
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void onDelete(PackageInstance pkg);

View File

@ -43,6 +43,8 @@ import org.apache.log4j.Logger;
* @see PackageType
* @version $Revision: #14 $, $Date: 2004/08/16 $
* @version $Id: PackageInstance.java 287 2005-02-22 00:29:02Z sskracic $
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public class PackageInstance extends ACSObject {
@ -87,7 +89,9 @@ public class PackageInstance extends ACSObject {
* @see com.arsdigita.domain.DomainObject#DomainObject(String)
* @see PackageType#createInstance
* @see #PackageInstance(OID)
**/
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
protected PackageInstance() {
super(BASE_DATA_OBJECT_TYPE);
}
@ -97,6 +101,8 @@ public class PackageInstance extends ACSObject {
* data object.
*
* @param dataObject a PackageInstance data object
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public PackageInstance(DataObject dataObject) {
super(dataObject);
@ -108,6 +114,8 @@ public class PackageInstance extends ACSObject {
* @param id the primary key of the package instance
* @exception DataObjectNotFoundException if the id does not
* correspond to an existing package instance.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public PackageInstance(BigDecimal id) throws DataObjectNotFoundException {
super(new OID(BASE_DATA_OBJECT_TYPE, id));
@ -119,6 +127,8 @@ public class PackageInstance extends ACSObject {
* @param oid the objectID of the package instance
* @exception DataObjectNotFoundException If the OID does not
* correspond to an existing package instance.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public PackageInstance(OID oid) throws DataObjectNotFoundException {
super(oid);
@ -135,6 +145,10 @@ public class PackageInstance extends ACSObject {
return m_packageType;
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
protected void setType(PackageType type) {
setAssociation("packageType", type);
m_packageType = type;
@ -149,6 +163,9 @@ public class PackageInstance extends ACSObject {
* if this package instance is not mounted.
* @return the first site node on which this package instance is mounted,
* or null if this package instance is not mounted.
*
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
**/
public SiteNode getDefaultMountPoint() {
SiteNode defaultMountPoint = null;
@ -180,6 +197,8 @@ public class PackageInstance extends ACSObject {
/**
* Gets the name of this package.
* @return the package key.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getKey() {
return getType().getKey();
@ -188,6 +207,8 @@ public class PackageInstance extends ACSObject {
/**
* Sets the package key.
* @param key the key for this package
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void setKey(String key) {
set("packageKey", key);
@ -196,6 +217,8 @@ public class PackageInstance extends ACSObject {
/**
* Gets the package name.
* @return the package's name.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getName() {
return (String)get("prettyName");
@ -205,7 +228,10 @@ public class PackageInstance extends ACSObject {
* Returns a display name for this package instance.
*
* @see ACSObject#getDisplayName()
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
@Override
public String getDisplayName() {
return getName();
}

View File

@ -45,7 +45,6 @@ import org.apache.log4j.Logger;
* @since ACS 5.0
* @version $Revision: #15 $, $Date: 2004/08/16 $
* @version $Id: PackageType.java 287 2005-02-22 00:29:02Z sskracic $
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationType} instead.
*/

View File

@ -23,19 +23,46 @@ import com.arsdigita.domain.DomainObject;
import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.DataObject;
/**
* Represents a collection of package types.
*
* @since ACS 5.0
* @version $Revision: #15 $, $Date: 2004/08/16 $
* @version $Id: PackageTypeCollection.java 287 2005-02-22 00:29:02Z sskracic $
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationTypeCollection} instead.
*/
public class PackageTypeCollection extends DomainCollection {
public static final String versionId = "$Id: PackageTypeCollection.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
/**
*
* @param dataCollection
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationTypeCollection} instead.
*/
protected PackageTypeCollection(DataCollection dataCollection) {
super(dataCollection);
}
/**
*
* @return
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationTypeCollection} instead.
*/
public DomainObject getDomainObject() {
DomainObject domainObject = getPackageType();
return domainObject;
}
/**
*
* @return
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationTypeCollection} instead.
*/
public PackageType getPackageType() {
DataObject dataObject = m_dataCollection.getDataObject();

View File

@ -62,6 +62,7 @@ import org.apache.log4j.Logger;
* @version $Id: SiteNode.java 287 2005-02-22 00:29:02Z sskracic $
* @since ACS 5.0
* @deprecated Refactor to use {@link com.arsdigita.web.Application} instead.
* The class is due to completly be removed.
*/
public class SiteNode extends ACSObject {
@ -148,11 +149,22 @@ public class SiteNode extends ACSObject {
*
* @param req Servlet request. This is needed to get the context
* path, in case the servlet is not mounted at /.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getURL(HttpServletRequest req) {
return getURL(req==null ? (String) null : req.getContextPath());
}
/**
* Gets the URL of the site note.
*
* @param req Servlet request. This is needed to get the context
* path, in case the servlet is not mounted at /.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getUrl(HttpServletRequest req) {
return getURL(req);
}
@ -162,6 +174,8 @@ public class SiteNode extends ACSObject {
* user!
*
* @param ContextPath in case the servlet is not mounted at /
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getURL(String contextPath) {
if (contextPath != null) {
@ -171,19 +185,35 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getUrl(String contextPath) {
return getURL(contextPath);
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getURL() {
return getURLNoContext();
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
private void setURL() {
s_log.debug("Setting url: " + getURLFromParent());
set("url", getURLFromParent());
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
private String getURLFromParent() {
SiteNode parent = getParent();
if (parent != null) {
@ -196,6 +226,8 @@ public class SiteNode extends ACSObject {
/**
* @return the URL of the site node, <em>not</em> the URL
* requested by the user!
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getURLNoContext() {
String value = (String)get("url");
@ -206,15 +238,27 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public BigDecimal getNodeId() {
return (BigDecimal) get("id");
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void setName(String name) {
set("name", name);
setURL();
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void setParent(SiteNode siteNode) {
// Should throw an Exception if parent is not a directory.
@ -229,6 +273,10 @@ public class SiteNode extends ACSObject {
setURL();
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public String getName() {
String name = (String) get("name");
@ -243,6 +291,8 @@ public class SiteNode extends ACSObject {
* Returns a display name for this site node.
*
* @see ACSObject#getDisplayName()
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
@Override
public String getDisplayName() {
@ -252,6 +302,8 @@ public class SiteNode extends ACSObject {
/**
* @return <code>true</code> if this SiteNode can have children;
* <code>false</code> otherwise.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public boolean isDirectory() {
return ((Boolean) (get("isDirectory"))).booleanValue();
@ -266,6 +318,10 @@ public class SiteNode extends ACSObject {
return ((Boolean)(get("isPattern"))).booleanValue();
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public PackageInstance getPackageInstance() {
DataObject dataObject = (DataObject)get("mountedObject");
if (dataObject != null) {
@ -278,6 +334,10 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void mountPackage(PackageInstance pkg) {
unMountPackage();
@ -291,6 +351,10 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public void unMountPackage() {
PackageInstance pkg = getPackageInstance();
@ -306,6 +370,10 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public SiteNode getParent() {
DataObject dataObject = (DataObject)get("parent");
@ -316,11 +384,19 @@ public class SiteNode extends ACSObject {
}
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public SiteNodeCollection getChildren() {
DataAssociation childAssociation = (DataAssociation) get("children");
return new SiteNodeCollection(childAssociation);
}
/**
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public static SiteNode getRootSiteNode() {
// cache the site node statically
// note lack of synchronization. worst case:
@ -363,6 +439,8 @@ public class SiteNode extends ACSObject {
* cached site nodes. Call this method AFTER creating
* any new site nodes as part of your unit test's
* setup method
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public static void repopulateCache() {
s_cache.refresh();
@ -385,6 +463,8 @@ public class SiteNode extends ACSObject {
* with a slash (probably the wrong behavior) or if the
* RootSiteNode was requested but couldn't be found (also
* probably wrong).
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public static SiteNode getSiteNode(final String path, boolean readOnly)
throws DataObjectNotFoundException {
@ -415,6 +495,8 @@ public class SiteNode extends ACSObject {
* with a slash (probably the wrong behavior) or if the
* RootSiteNode was requested but couldn't be found (also
* probably wrong).
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
public static SiteNode getSiteNode(String path)
throws DataObjectNotFoundException {
@ -429,6 +511,8 @@ public class SiteNode extends ACSObject {
* Overrides the default save method. If we've changed the
* URL of this site node (either by changing its name or its parent),
* we need to also update the URL for all descendants of this site node.
* @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.Application} instead.
*/
protected void beforeSave() {
if (isPropertyModified("url") || isNew()) {

View File

@ -54,7 +54,8 @@ public class SiteNodeRequestContext extends KernelRequestContext {
/**
* Copy constructor.
**/
* @deprecated
*/
protected SiteNodeRequestContext(SiteNodeRequestContext that) {
super(that);
this.m_sn = that.m_sn;
@ -65,7 +66,8 @@ public class SiteNodeRequestContext extends KernelRequestContext {
* Build a new application context given an original app context,
* and a destination site node. Part of the previously-remaining URL
* is consumed by the site node's URL, and part remains.
**/
* @deprecated
*/
public SiteNodeRequestContext(HttpServletRequest req,
RequestContext parent,
SiteNode sn,
@ -178,6 +180,7 @@ public class SiteNodeRequestContext extends KernelRequestContext {
* JSP-based resources will be found.
* Returns with a trailing slash, e.g.,
* "/packages/package-key/www/"
* @deprecated
*/
public String getPageBase() {
return "/packages/"
@ -185,6 +188,11 @@ public class SiteNodeRequestContext extends KernelRequestContext {
"/www/";
}
/**
*
* @return
* @deprecated
*/
public PackageInstance getPackageInstance() {
return getSiteNode().getPackageInstance();
}

View File

@ -32,17 +32,15 @@ import javax.servlet.http.HttpServletResponse;
* dynamically apply a set of templates to an XML document in a custom
* way. Typically, this occurs if the template selection
* depends on the outcome of some application-specific logic.
*
* @see com.arsdigita.sitenode.SiteNodePresentationManager
* @see com.arsdigita.sitenode.BasePresentationManager
*
* @author Bill Schneider
* @version ACS 4.6
* @see com.arsdigita.sitenode.SiteNodePresentationManager
* @see com.arsdigita.sitenode.BasePresentationManager
* @version $Id: PresentationManager.java 738 2005-09-01 12:36:52Z sskracic $
*/
public interface PresentationManager {
public static final String versionId =
"$Id: PresentationManager.java 738 2005-09-01 12:36:52Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/08/16 18:10:38 $";
/**
* Serves a page whose content is defined by the input XML

View File

@ -35,8 +35,7 @@ import org.apache.log4j.Logger;
/**
* <p>
* A simple servlet for dispatching abstract URLs
* to concrete JSP files.
* A simple servlet for dispatching abstract URLs to concrete JSP files.
* </p>
* <p>
* This is intended to be used in all places where BebopMapServlet would
@ -64,6 +63,7 @@ import org.apache.log4j.Logger;
* &lt;/servlet-mapping&gt;
* &lt;/web-app&gt;
* </pre>
*
* <p>
* In the Application class it should define:
* </p>
@ -88,7 +88,7 @@ import org.apache.log4j.Logger;
* gets resolved to
* </p>
* <pre>
* /templaates/myparentapp/myappinstance/foo.jsp
* /templates/myparentapp/myappinstance/foo.jsp
* /templates/myparentapp/foo.jsp
* /templates/foo.jsp
* </pre>
@ -111,7 +111,8 @@ public class ApplicationFileServlet extends BaseApplicationServlet {
*/
@Override
public void init(ServletConfig config)
throws ServletException {
throws ServletException {
super.init(config);
// init-param named template-path from ~/WEB-INF/web.xml
@ -123,6 +124,7 @@ public class ApplicationFileServlet extends BaseApplicationServlet {
"template-path must not end with '/'");
// optional init-param named file-resolver from ~/WEB-INF/web.xml
String resolverName = config.getInitParameter("file-resolver");
if (resolverName == null) {
m_resolver = Web.getConfig().getApplicationFileResolver();
@ -135,10 +137,18 @@ public class ApplicationFileServlet extends BaseApplicationServlet {
}
}
/**
*
* @param sreq
* @param sresp
* @param app
* @throws ServletException
* @throws IOException
*/
protected void doService(HttpServletRequest sreq,
HttpServletResponse sresp,
Application app)
throws ServletException, IOException {
throws ServletException, IOException {
RequestDispatcher rd = m_resolver.resolve(m_templatePath,
sreq, sresp, app);

View File

@ -58,6 +58,14 @@ import org.apache.log4j.Category;
* @see com.arsdigita.web.ApplicationType
* @author Justin Ross &lt;<a href="mailto:jross@redhat.com">jross@redhat.com</a>&gt;
* @version $Id: ApplicationSetup.java 287 2005-02-22 00:29:02Z sskracic $
* @deprecated without direct replacement.
* Class requires ApplicationSetup.setInstantiator( ...) domain initialization
* code which is only useful in old legacy initialization code. Initialization
* now differentiates bitween one time loading step and recurring initialization
* step.
* Use ApplicationType apptype = new ApplicationType(...) and
* Application app Application.createApplication(...) instead to create
* new style legacy free applications.
*/
public class ApplicationSetup {

View File

@ -179,6 +179,7 @@ public class ApplicationType extends ResourceType {
* Creates a legacy-compatible application type. Types created
* via this constructor use the passed in package type to back the
* new application type.
* @deprecated without direct replacement. Refactor to legacy free app.
*/
protected ApplicationType(final String dataObjectType,
final PackageType packageType,
@ -196,6 +197,7 @@ public class ApplicationType extends ResourceType {
* @param title
* @param applicationObjectType
* @param createContainerGroup
* @deprecated without direct replacement. Refactor to legacy free app.
*/
protected ApplicationType(final String dataObjectType,
final PackageType packageType,
@ -223,6 +225,7 @@ public class ApplicationType extends ResourceType {
/**
* Creates a legacy-compatible application type using the passed
* in package type using an internal constructor (below).
* @deprecated without direct replacement. Refactor to legacy free app.
*/
public static ApplicationType createApplicationType(PackageType packageType,
String title,
@ -236,6 +239,7 @@ public class ApplicationType extends ResourceType {
* parameter is used to create a legacy package type to back the
* new application type.
* This variant is applicatable if packageType does not already exist!
* @deprecated without direct replacement. Refactor to legacy free app.
*/
protected ApplicationType(String dataObjectType, String key, String title,
String applicationObjectType) {
@ -251,8 +255,9 @@ public class ApplicationType extends ResourceType {
* @param key of the package to be created
* @param title of the package to be created
* @return
* @deprecated without direct replacement. Refactor to legacy free app.
*/
private static final PackageType makePackageType(String key, String title) {
private static PackageType makePackageType(String key, String title) {
PackageType packageType = new PackageType();
Assert.exists(key, "key");
@ -269,6 +274,7 @@ public class ApplicationType extends ResourceType {
* Creates a legacy-compatible application type. The key
* parameter is used to create a legacy package type to back the
* new application type.
* @deprecated without direct replacement. Refactor to legacy free app.
*/
public static ApplicationType createApplicationType(String key, String title,
String applicationObjectType) {
@ -282,6 +288,7 @@ public class ApplicationType extends ResourceType {
* Creates a legacy-compatible application type. The key
* parameter is used to create a legacy package type to back the
* new application type.
* @deprecated without direct replacement. Refactor to legacy free app.
*/
public static ApplicationType createApplicationType(
String key, String title,
@ -368,7 +375,11 @@ public class ApplicationType extends ResourceType {
// Association properties (some by proxy)
//
// Can return null.
/**
* Can return null.
* @return
* @deprecated without direct replacement. Refactor to legacy free app.
*/
public PackageType getPackageType() {
if (m_legacyFree == true) {
throw new UnsupportedOperationException
@ -423,6 +434,7 @@ public class ApplicationType extends ResourceType {
// Member properties
//
@Override
public String getTitle() {
String title = (String) get("title");
@ -431,6 +443,7 @@ public class ApplicationType extends ResourceType {
return title;
}
@Override
public void setTitle(String title) {
Assert.exists(title, "title");
@ -438,6 +451,7 @@ public class ApplicationType extends ResourceType {
}
// Can return null.
@Override
public String getDescription() {
final String description = (String) get("description");
@ -445,6 +459,7 @@ public class ApplicationType extends ResourceType {
}
// Param description can be null.
@Override
public void setDescription(String description) {
set("description", description);
}
@ -495,6 +510,9 @@ public class ApplicationType extends ResourceType {
set("hasFullPageView", new Boolean(hasFullPageView));
}
/**
* @deprecated with no replacement.
*/
public boolean hasEmbeddedView() {
final Boolean result = (Boolean) get("hasEmbeddedView");
@ -537,6 +555,7 @@ public class ApplicationType extends ResourceType {
*
* @return A Collection of {@link PrivilegeDescriptor PrivilegeDescriptors}
*/
@Override
public Collection getRelevantPrivileges() {
LinkedList result = new LinkedList();
@ -556,6 +575,7 @@ public class ApplicationType extends ResourceType {
* <p>Add an entry to the list of relevant privileges for this
* ApplicationType.</p>
*/
@Override
public void addRelevantPrivilege(PrivilegeDescriptor privilege) {
addRelevantPrivilege(privilege.getName());
}
@ -564,6 +584,7 @@ public class ApplicationType extends ResourceType {
* <p>Add an entry to the list of relevant privileges for this
* ApplicationType.</p>
*/
@Override
public void addRelevantPrivilege(String privilegeName) {
OID privOID = new OID("com.arsdigita.kernel.permissions.Privilege",
privilegeName);
@ -671,6 +692,7 @@ public class ApplicationType extends ResourceType {
/**
* Tell whether this ApplicationType is a singleton.
* @deprecated with no replacement.
*/
public boolean isSingleton() {
final Boolean result = (Boolean) get("isSingleton");
@ -685,6 +707,7 @@ public class ApplicationType extends ResourceType {
*
* @return the value of the ID property.
*/
@Override
public BigDecimal getID() {
BigDecimal id = (BigDecimal)get("id");

View File

@ -64,9 +64,10 @@ public class Web {
private static WebConfig s_config;
final static void init(final HttpServletRequest sreq,
final ServletContext sc,
final UserContext uc) {
static void init(final HttpServletRequest sreq,
final ServletContext sc,
final UserContext uc) {
Assert.exists(sreq, HttpServletRequest.class);
Assert.exists(sc, ServletContext.class);
Assert.exists(uc, UserContext.class);
@ -386,10 +387,12 @@ public class Web {
}
private static class WebContextLocal extends InternalRequestLocal {
@Override
protected Object initialValue() {
return Web.s_initialContext.copy();
}
@Override
protected void clearValue() {
((WebContext) get()).clear();
}

View File

@ -59,6 +59,11 @@ public final class WebContext extends Record {
super(WebContext.class, s_log, s_fields);
}
/**
* Creates a copy of this WebContext
*
* @return a new WebContext as a copy of this one
*/
final WebContext copy() {
WebContext result = new WebContext();
@ -68,6 +73,11 @@ public final class WebContext extends Record {
return result;
}
/**
* Initializes this WebContext object and setting its properties.
* @param app
* @param requestURL
*/
final void init(final Application app, final URL requestURL) {
setApplication(app);
setRequestURL(requestURL);
@ -88,20 +98,36 @@ public final class WebContext extends Record {
}
}
/**
*
* @return
*/
public final Application getApplication() {
return m_application;
}
/**
*
* @param app
*/
final void setApplication(final Application app) {
m_application = app;
mutated("Application");
}
/**
*
* @return
*/
public final URL getRequestURL() {
return m_requestURL;
}
/**
*
* @param url
*/
final void setRequestURL(final URL url) {
Assert.exists(url, "URL url");