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 * The item's root is the ancestor reachable through repeated
* <code>getParent()</code> calls whose parent is * <code>getParent()</code> calls whose parent is
* <code>null</code>. This is usually a folder, but may be any * <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 * Note that the name of the root folder of the content section where the
* item resides is not included in the path. * 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.LoginSignal;
import com.arsdigita.web.Web; import com.arsdigita.web.Web;
import org.apache.log4j.Logger;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
@ -61,7 +59,10 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
/** /**
* Content Section's application servlet
* *
* Repaired ItemURLCache to save multilingual items with automatic * Repaired ItemURLCache to save multilingual items with automatic
* language negotiation. The cahce now uses the remaining url part * language negotiation. The cahce now uses the remaining url part
@ -74,23 +75,23 @@ import javax.servlet.http.HttpServletResponse;
public class ContentSectionServlet extends BaseApplicationServlet { 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[] { private static final String[] WELCOME_FILES = new String[] {
"index.jsp", "index.html" "index.jsp", "index.html"
}; };
private static final Logger s_log =
Logger.getLogger(ContentSectionServlet.class);
private ContentItemDispatcher m_disp = new ContentItemDispatcher(); private ContentItemDispatcher m_disp = new ContentItemDispatcher();
public static Map s_itemResolverCache = public static Map s_itemResolverCache = Collections
Collections.synchronizedMap(new HashMap()); .synchronizedMap(new HashMap());
//cache the content items /** cache the content items */
private static Map s_itemURLCacheMap = null; 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 PREVIEW = "/preview";
public static final String FILE_SUFFIX = ".jsp"; public static final String FILE_SUFFIX = ".jsp";
public static final String INDEX_FILE = "/index"; public static final String INDEX_FILE = "/index";
@ -107,17 +108,20 @@ public class ContentSectionServlet extends BaseApplicationServlet {
private static final String CACHE_KEY_DELIMITER = "%"; private static final String CACHE_KEY_DELIMITER = "%";
/** /**
* Implements the service method of BaseApplicationServlet
* @see com.arsdigita.web.BaseApplicationServlet#doService * @see com.arsdigita.web.BaseApplicationServlet#doService
* (HttpServletRequest, HttpServletResponse, Application) * (HttpServletRequest, HttpServletResponse, Application)
*/ */
protected void doService protected void doService( HttpServletRequest sreq,
(HttpServletRequest sreq, HttpServletResponse sresp, Application app) HttpServletResponse sresp,
throws ServletException, IOException { Application app)
throws ServletException, IOException {
ContentSection section = (ContentSection) app; ContentSection section = (ContentSection) app;
RequestContext ctx = DispatcherHelper.getRequestContext(); RequestContext ctx = DispatcherHelper.getRequestContext();
String url = ctx.getRemainingURLPart();
String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("Resolving item URL " + url); s_log.info("Resolving item URL " + url);
@ -129,6 +133,8 @@ public class ContentSectionServlet extends BaseApplicationServlet {
final ContentItem item = getItem(section, url, itemResolver); final ContentItem item = getItem(section, url, itemResolver);
if (item != null) { if (item != null) {
/* We have to serve an item here */
String param = sreq.getParameter("transID"); String param = sreq.getParameter("transID");
if (param != null) { if (param != null) {
@ -148,7 +154,10 @@ public class ContentSectionServlet extends BaseApplicationServlet {
} }
serveItem(sreq, sresp, section, item); serveItem(sreq, sresp, section, item);
} else { } else {
/* We have to deal with a content-section, folder or an other bit*/
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("NOT serving content item"); 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, private void serveItem(HttpServletRequest sreq,
HttpServletResponse sresp, HttpServletResponse sresp,
ContentSection section, ContentSection section,

View File

@ -59,7 +59,9 @@ import org.apache.log4j.Logger;
// //
// Next Try // Next Try
// Refactor using legacy compatible web/Application and ApplicationSetup DONE // 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) * <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); private static final Logger s_log = Logger.getLogger(Loader.class);
/** Loader configuration object, singleton design pattern /** Loader configuration object, singleton design pattern
* NOTE: LoaderConfig only supplies unmutable hatrd coded defaults! It is * NOTE: LoaderConfig only supplies unmutable hard coded defaults! It is
* not possible to alter any to the contained values by specifiying an * not possible to alter any of the contained values by specifiying an
* configuration parameter during load step. If a configuration value * 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! */ * into this Loader class! */
private static final LoaderConfig s_conf = LoaderConfig.getInstance(); private static final LoaderConfig s_conf = LoaderConfig.getInstance();
@ -116,13 +118,12 @@ public class Loader extends PackageLoader {
new String[] {"content"} new String[] {"content"}
); );
/** List of classnames of internal base content types (needed in every /** List of classnames of internal base content types (needed in every
* section created), generated while loading those content types in * section created), generated while loading those content types in
* loadContentTypeDefinitions(files) for later use in register step. */ * loadContentTypeDefinitions(files) for later use in register step. */
private ArrayList m_content_type_list = new ArrayList(); private ArrayList m_content_type_list = new ArrayList();
/** /**
* Standard constructor. * 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. * database.
* It is made public to be able to invoke it from the update script * It is made public to be able to invoke it from the update script
* (e.g. 6.6.1-6.6.2). * (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 * 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 * any content type depends on ccm-cms. Therefore, the loading step can not
* process content type package assignment! Instead each content type itself * 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}. * Cf. {@link com.arsdigita.cms.contenttype.AbstractContentTypeLoader}.
* *
* But the load step has to process the cms internal content types! * 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 // Step 1: Create content section application type
// prerequisite for concrete content-section instance creation. // prerequisite for concrete content-section instance creation.
ApplicationSetup appType = new ApplicationSetup(s_log);
appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE); // ////////////// Deprecated style to create app type ///////////////
appType.setKey(ContentSection.PACKAGE_TYPE); // by default: content-section // ////////////// Delete when migration process completed ///////////////
appType.setTitle("CMS Content Section"); // ApplicationSetup appType = new ApplicationSetup(s_log);
appType.setDescription("A CMS Content Section"); // appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE);
appType.setPortalApplication(false); // 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()); //setup.setDispatcherClass(ContentItemDispatcher.class.getName());
// contains the xsl to generate the page // contains the xsl to generate the page
// ApplicationSetup requires an Instantiator which has to be set here // ApplicationSetup requires an Instantiator which has to be set here
// Setting it up in Initializer prior to creating the application type // Setting it up in Initializer prior to creating the application type
// doesn't work! // doesn't work!
appType.setInstantiator(new ACSObjectInstantiator() { // appType.setInstantiator(new ACSObjectInstantiator() {
@Override // @Override
public DomainObject doNewInstance(DataObject dataObject) { // public DomainObject doNewInstance(DataObject dataObject) {
return new ContentSection(dataObject); // return new ContentSection(dataObject);
} // }
}); // });
// appType.run();
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 // Step 2: Load CMS specific privileges into central (core) privilege
// system. // system.
createPrivileges(); createPrivileges();

View File

@ -29,12 +29,12 @@ import com.arsdigita.mimetypes.MimeType;
* Represents a collection of template mappings along with their * Represents a collection of template mappings along with their
* link attributes. * 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.domain.DomainCollection
* @see com.arsdigita.persistence.DataCollection * @see com.arsdigita.persistence.DataCollection
* @see com.arsdigita.cms.ItemTemplateCollection * @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 { 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. * before <code>next()</code> is called on this collection.
* *
*/ */
@Override
public void addOrder(String order) { public void addOrder(String order) {
m_dataCollection.addOrder(order); m_dataCollection.addOrder(order);
} }
@ -90,6 +91,7 @@ public abstract class TemplateCollection extends DomainCollection {
/** /**
* Filter this collection for equality by the specified attribute * Filter this collection for equality by the specified attribute
*/ */
@Override
public Filter addEqualsFilter(String attr, Object value) public Filter addEqualsFilter(String attr, Object value)
throws PersistenceException { throws PersistenceException {
return m_dataCollection.addEqualsFilter(attr, value); return m_dataCollection.addEqualsFilter(attr, value);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,7 +54,8 @@ public class SiteNodeRequestContext extends KernelRequestContext {
/** /**
* Copy constructor. * Copy constructor.
**/ * @deprecated
*/
protected SiteNodeRequestContext(SiteNodeRequestContext that) { protected SiteNodeRequestContext(SiteNodeRequestContext that) {
super(that); super(that);
this.m_sn = that.m_sn; 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, * Build a new application context given an original app context,
* and a destination site node. Part of the previously-remaining URL * and a destination site node. Part of the previously-remaining URL
* is consumed by the site node's URL, and part remains. * is consumed by the site node's URL, and part remains.
**/ * @deprecated
*/
public SiteNodeRequestContext(HttpServletRequest req, public SiteNodeRequestContext(HttpServletRequest req,
RequestContext parent, RequestContext parent,
SiteNode sn, SiteNode sn,
@ -178,6 +180,7 @@ public class SiteNodeRequestContext extends KernelRequestContext {
* JSP-based resources will be found. * JSP-based resources will be found.
* Returns with a trailing slash, e.g., * Returns with a trailing slash, e.g.,
* "/packages/package-key/www/" * "/packages/package-key/www/"
* @deprecated
*/ */
public String getPageBase() { public String getPageBase() {
return "/packages/" return "/packages/"
@ -185,6 +188,11 @@ public class SiteNodeRequestContext extends KernelRequestContext {
"/www/"; "/www/";
} }
/**
*
* @return
* @deprecated
*/
public PackageInstance getPackageInstance() { public PackageInstance getPackageInstance() {
return getSiteNode().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 * 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.sitenode.BasePresentationManager
* *
* @author Bill Schneider * @author Bill Schneider
* @version ACS 4.6 * @version ACS 4.6
* @see com.arsdigita.sitenode.SiteNodePresentationManager * @version $Id: PresentationManager.java 738 2005-09-01 12:36:52Z sskracic $
* @see com.arsdigita.sitenode.BasePresentationManager
*/ */
public interface PresentationManager { 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 * Serves a page whose content is defined by the input XML

View File

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

View File

@ -58,6 +58,14 @@ import org.apache.log4j.Category;
* @see com.arsdigita.web.ApplicationType * @see com.arsdigita.web.ApplicationType
* @author Justin Ross &lt;<a href="mailto:jross@redhat.com">jross@redhat.com</a>&gt; * @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 $ * @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 { public class ApplicationSetup {

View File

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

View File

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

View File

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