diff --git a/ccm-bundle/bundles/demo/cfg/web-sci.xml b/ccm-bundle/bundles/demo/cfg/web-sci.xml index 0c392f38d..8601ae4d6 100644 --- a/ccm-bundle/bundles/demo/cfg/web-sci.xml +++ b/ccm-bundle/bundles/demo/cfg/web-sci.xml @@ -87,27 +87,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -133,11 +136,6 @@ com.arsdigita.ui.admin.AdminServlet - - webadmin-sitemap - com.arsdigita.ui.sitemap.SiteMapServlet - - webadmin-permissions com.arsdigita.ui.permissions.PermissionsServlet @@ -448,12 +446,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/* @@ -479,11 +477,6 @@ /admin/* - - webadmin-sitemap - /admin-sitemap/* - - webadmin-permissions /admin-permissions/* diff --git a/ccm-bundle/bundles/devel/cfg/web-sci.xml b/ccm-bundle/bundles/devel/cfg/web-sci.xml index afd835db9..d2654ed50 100644 --- a/ccm-bundle/bundles/devel/cfg/web-sci.xml +++ b/ccm-bundle/bundles/devel/cfg/web-sci.xml @@ -87,27 +87,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -133,11 +136,6 @@ com.arsdigita.ui.admin.AdminServlet - - webadmin-sitemap - com.arsdigita.ui.sitemap.SiteMapServlet - - webadmin-permissions com.arsdigita.ui.permissions.PermissionsServlet @@ -448,12 +446,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/* @@ -479,11 +477,6 @@ /admin/* - - webadmin-sitemap - /admin-sitemap/* - - webadmin-permissions /admin-permissions/* diff --git a/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java b/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java index a1cb41552..b8ed2950c 100755 --- a/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java +++ b/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java @@ -18,23 +18,24 @@ */ package com.arsdigita.sitenode; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.PersonName; import com.arsdigita.logging.ErrorReport; import com.arsdigita.util.Exceptions; import com.arsdigita.util.ExceptionUnwrapper; -import java.util.ArrayList; -import java.util.TreeSet; -import java.text.Collator; -import java.util.Enumeration; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.PersonName; +import java.util.ArrayList; +import java.util.TreeSet; +import java.text.Collator; +import java.util.Enumeration; + import org.apache.log4j.Logger; /** diff --git a/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java b/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java rename to ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/ui/login/Login.java b/ccm-core/src/com/arsdigita/ui/login/Login.java index acfe8c1cc..33ae046ed 100644 --- a/ccm-core/src/com/arsdigita/ui/login/Login.java +++ b/ccm-core/src/com/arsdigita/ui/login/Login.java @@ -23,13 +23,16 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; import com.arsdigita.web.Application; -import com.arsdigita.web.ApplicationCollection; -import com.arsdigita.web.ApplicationType; import org.apache.log4j.Logger; /** * Application domain class for the Login application. + * + * Serves as the main entry point into Login application. Because there are no + * instance specific functions (there is only a single instance to be installed) + * it provides mainly required configuration information and service methods + * for client classes. * * @author pb * @version $Id: Login.java $ @@ -82,26 +85,42 @@ public class Login extends Application { } /** - * Provides an absolute URL (leading slash) into the system login page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have to be checked. (2011-02) + * Service method provides an (absolute) URL into the system login page as + * servletPath() (leading slash) according servlet API. It is relative to + * document root without any constant prefix if there is one configured. * + * It is used by other classes to determine the login page. + * * @return URL for login page as String */ - // In old LegacyInitializer - // LOGIN_PAGE_KEY = page.kernel.login = register/ public static String getLoginPageURL() { return LOGIN_PAGE_URL; } /** + * Returns the path name of the location of the applications servlet/JSP. + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended) you may use a + * standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * + * login + * com.arsdigita.ui.login.LoginServlet + * + * + * + * login + * /login/* + * + * + * The appended "/*" ensures BaseServlet will find additional JSP's. * + * @return path name to the applications servlet/JSP */ @Override public String getServletPath() { diff --git a/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java b/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java index bdf642e39..dd5c865e7 100644 --- a/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java +++ b/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java @@ -33,24 +33,15 @@ import com.arsdigita.dispatcher.DispatcherConfig; import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.kernel.Kernel; import com.arsdigita.ui.UI; - import com.arsdigita.web.ReturnSignal; import com.arsdigita.web.URL; -import javax.servlet.http.HttpServletResponse; + import javax.servlet.http.HttpServletRequest; import javax.servlet.ServletException; import org.apache.log4j.Logger; -// WORK IN PROGRESS -// -// (a) Funktionen von SubsiteDispatcher übertragen -// Noch zu machen: preProcess für Handling caching -// (b) Konfiguration in web.xml etc. *DONE* -// (c) Einbau in core Load *DONE* -// (d) Testen - /** * Login Application Servlet class, central entry point to create and process @@ -59,6 +50,11 @@ import org.apache.log4j.Logger; * It manages user registration page, new user page, user workspace, logout, * and permissions admin pages. * + * It just defines a mapping URL <-> various pages and uses the super class + * to actually server the pages. Additionally is provides service methods + * to expose various properties, especially the URL's of public subpages + * (e.g. logout) and initializes the creation of the UI. + * * @author Peter Boy * @version $Id: LoginServlet.java 2161 2012-03-15 00:16:13Z pboy $ */ @@ -67,8 +63,10 @@ public class LoginServlet extends BebopApplicationServlet { /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(LoginServlet.class); - public static final String APPLICATION_NAME = "login"; + // //////////////////////////////////////////////////////////////////////// + // Define various URLs to subpages of Login to manage administrative tasks. + // //////////////////////////////////////////////////////////////////////// /** PathInfo into the Login application to access the (optional) newUser * page. Ends with "/" because it is a servlet/directory @@ -106,11 +104,16 @@ public class LoginServlet extends BebopApplicationServlet { */ public static final String LOGOUT_PATH_INFO = "/logout/"; + + + /** Base URL of the Login application for internal use, fetched from + * Login domain class. */ + private final static String s_loginURL = Login.LOGIN_PAGE_URL; + // define namespace URI final static String SUBSITE_NS_URI = "http://www.arsdigita.com/subsite/1.0"; - // define - final static String s_loginURL = Login.LOGIN_PAGE_URL; + public static final String APPLICATION_NAME = "login"; /** * User extension point used to create the pages to server and setup a @@ -298,7 +301,7 @@ public class LoginServlet extends BebopApplicationServlet { /** - * Provides an absolute URL (leading slash) to a user profile editig page. + * Provides an (absolute) URL to a user profile editig page. * It is relative to document root without any constant prefix if there is * one configured. * @@ -310,32 +313,23 @@ public class LoginServlet extends BebopApplicationServlet { * * @return url to EditUserProfile page as String */ - // In old LegacyInitializer - // EDIT_PAGE_KEY = page.kernel.edit = register/edit-profile/ public static String getEditUserProfilePageURL() { return s_loginURL + EDIT_USER_PROFILE_PATH_INFO; } /** - * Provides an absolute URL (leading slash) to an optional new user - * registration page (accessible only if activated). It is relative to - * document root without any constant prefix if there is one configured. + * Provides an (absolute URL) to an optional new user registration page + * (accessible only if activated). It is relative to document root + * without any constant prefix if there is one configured. * * XXX This implementation starts with a leading slash and ends with a slash. * In previous configurations String urls began without a slash in order * to be able to provide a full URL which also contains the context part. * Since version 5.2 the context part is handled by (new) dispatcher. * The leading slash it API change! It's impacts have to be checked. (2011-02) - * - * XXX In violation of the Servlet API the string does NOT start with a "/" - * because currently the UI.getLoginPageURL() method provides a trailing - * slash because it still follows the old application convention. Should - * be reworked soon. * * @return url to new user registration page as String */ - // In old LegacyInitializer - // NEWUSER_PAGE_KEY = page.kernel.newuser = register/new-user/ public static String getNewUserPageURL() { return s_loginURL + NEW_USER_PATH_INFO; } diff --git a/ccm-core/src/com/arsdigita/web/ApplicationSetup.java b/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/web/ApplicationSetup.java rename to ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/web/ApplicationType.java b/ccm-core/src/com/arsdigita/web/ApplicationType.java index 950701615..ec751f7a3 100755 --- a/ccm-core/src/com/arsdigita/web/ApplicationType.java +++ b/ccm-core/src/com/arsdigita/web/ApplicationType.java @@ -278,10 +278,10 @@ public class ApplicationType extends ResourceType { */ public static ApplicationType createApplicationType(String key, String title, String applicationObjectType) { - + return ApplicationType.createApplicationType( key, title, applicationObjectType, false); - + } /** diff --git a/ccm-core/src/com/arsdigita/web/BaseDispatcher.java b/ccm-core/src/com/arsdigita/web/BaseDispatcher.java index 9acd6e0f0..8e064c19e 100755 --- a/ccm-core/src/com/arsdigita/web/BaseDispatcher.java +++ b/ccm-core/src/com/arsdigita/web/BaseDispatcher.java @@ -29,6 +29,7 @@ import com.arsdigita.util.StringUtils; import java.io.IOException; import java.math.BigDecimal; + import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -306,10 +307,12 @@ class BaseDispatcher { return s1.equals(s2); } + @Override public int hashCode() { return toString().hashCode(); } + @Override public String toString() { final String sep = ", "; StringBuffer sb = new StringBuffer(); diff --git a/ccm-core/src/com/arsdigita/web/DispatcherServlet.java b/ccm-core/src/com/arsdigita/web/DispatcherServlet.java index 077fca1ca..f9ee47b1a 100755 --- a/ccm-core/src/com/arsdigita/web/DispatcherServlet.java +++ b/ccm-core/src/com/arsdigita/web/DispatcherServlet.java @@ -97,6 +97,7 @@ public class DispatcherServlet extends BaseServlet { @Override public void doInit() throws ServletException { +/* m_fallbackName = getServletConfig().getInitParameter(FALLBACK_SERVLET_PARAMETER); @@ -104,12 +105,13 @@ public class DispatcherServlet extends BaseServlet { Assert.exists(getServletConfig().getServletContext().getNamedDispatcher (m_fallbackName), RequestDispatcher.class); +*/ } @Override protected void doService(final HttpServletRequest sreq, final HttpServletResponse sresp) - throws ServletException, IOException { + throws ServletException, IOException { DeveloperSupport.requestStart(new RequestEvent( sreq, sresp, null, true, false)); @@ -129,7 +131,7 @@ public class DispatcherServlet extends BaseServlet { } else { s_log.debug("Could not dispatch this request to an " + "application; using the fallback servlet"); - +/* sreq.setAttribute(FALLING_BACK_ATTRIBUTE, Boolean.TRUE); DeveloperSupport.startStage("BaseDispatcher.forward"); @@ -141,6 +143,7 @@ public class DispatcherServlet extends BaseServlet { m_dispatcher.forward(fallbackDispatcher, sreq, sresp); DeveloperSupport.endStage("BaseDispatcher.forward"); +*/ } } diff --git a/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java b/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java rename to ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/web/Web.java b/ccm-core/src/com/arsdigita/web/Web.java index 782d843bc..7da73f768 100755 --- a/ccm-core/src/com/arsdigita/web/Web.java +++ b/ccm-core/src/com/arsdigita/web/Web.java @@ -119,7 +119,7 @@ public class Web { * @return The current ServletContext; it can be null * */ - public static final ServletContext getServletContext() { + public static ServletContext getServletContext() { return (ServletContext) s_servletContext.get(); } @@ -134,7 +134,7 @@ public class Web { * @param uri the context URI * @return the servlet context matching uri, or null */ - public static final ServletContext getServletContext(String uri) { + public static ServletContext getServletContext(String uri) { Assert.isTrue(uri.startsWith("/"), "uri must start with /"); Assert.isTrue(uri.endsWith("/"), "uri must end with /"); return (ServletContext)s_contexts.get(uri); diff --git a/ccm-core/src/overview.html b/ccm-core/src/overview.html index ede675532..4242f0b1e 100755 --- a/ccm-core/src/overview.html +++ b/ccm-core/src/overview.html @@ -1,3 +1,4 @@ + + reg com.arsdigita.web.ContextRegistrationServlet @@ -47,27 +48,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -160,12 +164,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/* diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml index ac278f165..def7007bb 100755 --- a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml @@ -142,7 +142,6 @@ - @@ -152,13 +151,26 @@ - - + + + + + + + + + + + + + + + + - - + diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/web.xml b/ccm-ldn-aplaws/bundles/devel/cfg/web.xml index d9f251e6e..212ab4c10 100755 --- a/ccm-ldn-aplaws/bundles/devel/cfg/web.xml +++ b/ccm-ldn-aplaws/bundles/devel/cfg/web.xml @@ -87,27 +87,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -459,12 +462,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/* diff --git a/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml b/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml index 32b544baa..88529ccfc 100644 --- a/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml +++ b/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml @@ -87,27 +87,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -133,11 +136,6 @@ com.arsdigita.ui.admin.AdminServlet - - webadmin-sitemap - com.arsdigita.ui.sitemap.SiteMapServlet - - webadmin-permissions com.arsdigita.ui.permissions.PermissionsServlet @@ -448,12 +446,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/* @@ -479,11 +477,6 @@ /admin/* - - webadmin-sitemap - /admin-sitemap/* - - webadmin-permissions /admin-permissions/* diff --git a/ccm-sci-bundle/bundles/devel/cfg/project.xml b/ccm-sci-bundle/bundles/devel/cfg/project.xml index b9ba5766e..460562401 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/project.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/project.xml @@ -8,7 +8,7 @@ ccmVersion="6.1" name="ScientificCMS" prettyName="Scientific CMS" - version="1-1-6" + version="2-0-0" release="devel" webxml="web-sci.xml" webapp="ROOT" @@ -62,6 +62,7 @@ + @@ -134,6 +135,45 @@ --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -144,29 +184,6 @@ --> - - - - - - - - - - - - - - - - - - @@ -181,12 +198,6 @@ - - - @@ -199,6 +210,10 @@ --> + + diff --git a/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml b/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml index 2eb5ffbc1..88529ccfc 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml @@ -87,27 +87,30 @@ 1 + ccm-dispatcher com.arsdigita.web.DispatcherServlet + 2 - + cache-manager com.arsdigita.caching.CacheServlet @@ -443,12 +446,12 @@ ccm-dispatcher /ccm/* - + cache-manager /expireCache/*