From 2d011e2f62f4eba24ee791efa3f51a4e8a814efb Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 23 Jan 2013 13:55:37 +0000 Subject: [PATCH] Removed cold application code. git-svn-id: https://svn.libreccm.org/ccm/trunk@2046 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/auth/http/HTTPLoginModule.java | 16 ++--- .../com/arsdigita/portalserver/Loader.java | 21 +++--- ...her.java => Dispatcher.java.nolongerInUse} | 0 .../portalserver/admin/PSAdminPage.java | 25 +++---- .../portalserver/admin/PSAdminServlet.java | 2 +- ...ortalCreatorDispatcher.java.nolongerInUse} | 0 ...rsonalPortalDispatcher.java.nolongerInUse} | 8 +++ .../personal/PersonalPortalServlet.java | 9 ++- .../pslogin/PSSubsiteDispatcher.java | 11 ++- .../ui/admin/PortalCreatePage.java | 47 ++++++++----- .../ui/admin/PortalTreeModelBuilder.java | 5 +- .../web/WEB-INF/web.ccm-portalserver.xml | 4 +- .../arsdigita/portalworkspace/Workspace.java | 4 +- .../simplesurvey/SimpleSurveyUtil.java | 67 +++++++++++++------ .../simplesurvey/ui/ResultsPane.java | 5 +- .../ui/SurveyProcessListener.java | 40 +++++------ .../arsdigita/simplesurvey/ui/ViewPanel.java | 4 +- 17 files changed, 156 insertions(+), 112 deletions(-) rename ccm-portalserver/src/com/arsdigita/portalserver/admin/{Dispatcher.java => Dispatcher.java.nolongerInUse} (100%) rename ccm-portalserver/src/com/arsdigita/portalserver/personal/{PersonalPortalCreatorDispatcher.java => PersonalPortalCreatorDispatcher.java.nolongerInUse} (100%) rename ccm-portalserver/src/com/arsdigita/portalserver/personal/{PersonalPortalDispatcher.java => PersonalPortalDispatcher.java.nolongerInUse} (94%) diff --git a/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java b/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java index f6347aac4..8808c1171 100755 --- a/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java +++ b/ccm-auth-http/src/com/arsdigita/auth/http/HTTPLoginModule.java @@ -17,18 +17,14 @@ package com.arsdigita.auth.http; import com.arsdigita.db.Sequences; -import com.arsdigita.kernel.KernelHelper; -import com.arsdigita.kernel.security.HTTPRequestCallback; -import com.arsdigita.kernel.security.HTTPResponseCallback; -import com.arsdigita.kernel.security.MappingLoginModule; -import com.arsdigita.kernel.security.PasswordLoginModule; -import com.arsdigita.kernel.security.UserLoginModule; -import com.arsdigita.kernel.security.Util; +import com.arsdigita.kernel.security.*; import com.arsdigita.persistence.DataOperation; import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.web.RedirectSignal; +import com.arsdigita.web.Web; + import java.math.BigDecimal; import java.net.InetAddress; import java.net.URLEncoder; @@ -38,6 +34,7 @@ import java.security.PublicKey; import java.util.Date; import java.util.Enumeration; import java.util.Map; + import javax.crypto.Cipher; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; @@ -46,7 +43,9 @@ import javax.security.auth.login.LoginException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.log4j.Logger; + import sun.misc.BASE64Decoder; /** @@ -302,7 +301,8 @@ public class HTTPLoginModule extends MappingLoginModule { throw new UncheckedWrapperException( e ); } - String returnURL = "http://" + KernelHelper.getHostName() + req.getRequestURI(); + String returnURL = "http://" + Web.getConfig().getHost().getName() + + req.getRequestURI(); if( req.getQueryString () != null ) { returnURL = returnURL + "?" + req.getQueryString (); } diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java b/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java index 9ced3c825..be62adfc3 100644 --- a/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java +++ b/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java @@ -136,18 +136,6 @@ public class Loader extends PackageLoader { */ private void loadPortalSiteApplicationType() { - /* First try: create a new style, legacy compatible application */ - - // ApplicationType type = ApplicationType.createApplicationType( - // "portalsite", - // "Portal Site", - // PortalSite.BASE_DATA_OBJECT_TYPE); - // Current code requires an apps specific dispatcher class. Has to be - // modified to be able to create a legacy free app type. - // type.setDispatcherClass - // ("com.arsdigita.portalserver.ui.PortalDispatcher"); - - // Try: new style legacy free application ApplicationType type = new ApplicationType("Portal Site", // title PortalSite.BASE_DATA_OBJECT_TYPE ); @@ -251,7 +239,14 @@ public class Loader extends PackageLoader { // FORMERLY ui.admin.Initializer /** * Creates a PortalCreator, another of the domain classes of the portalserver - * package, ApplicationType as a legacy-comp type of application type. + * package, ApplicationType as a legacy free type of 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. + * Example: "Portal Creator" will become "portal-creator". * */ private void loadPortalCreatorApplicationType() { diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java b/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse similarity index 100% rename from ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java rename to ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java.nolongerInUse diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java b/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java index 8897487fe..45ccbf97b 100644 --- a/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java +++ b/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java @@ -18,18 +18,14 @@ */ package com.arsdigita.portalserver.admin; -import com.arsdigita.web.Application; -import com.arsdigita.web.ApplicationCollection; -import com.arsdigita.bebop.table.*; import com.arsdigita.bebop.*; -import com.arsdigita.dispatcher.*; -import com.arsdigita.portalserver.*; +import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.portalserver.PortalPage; -import com.arsdigita.toolbox.ui.*; -import org.apache.log4j.Logger; - +import com.arsdigita.portalserver.PortalSite; +import com.arsdigita.web.Application; import com.arsdigita.xml.Document; import com.arsdigita.xml.Element; +import org.apache.log4j.Logger; /** * PSAdminPage @@ -38,12 +34,9 @@ import com.arsdigita.xml.Element; * * @author rhs@mit.edu * @version $Revision: #8 $ $Date: 2004/08/17 $ + * @version $ID:PSAdminPage.java, pboy $ */ class PSAdminPage extends PortalPage { - public static final String versionId = - "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/AdminPage.java#8 $" + - "$Author: dennis $" + - "$DateTime: 2004/08/17 23:19:25 $"; BoxPanel m_bpanel; @@ -51,6 +44,7 @@ class PSAdminPage extends PortalPage { (PSAdminPage.class.getName()); private RequestLocal m_children = new RequestLocal() { + @Override public Object initialValue(PageState ps) { Application app = Application.getCurrentApplication (DispatcherHelper.getRequest()); @@ -62,6 +56,7 @@ class PSAdminPage extends PortalPage { getHeader().setIdAttr("admin"); } + @Override protected void buildContextBar() { DimensionalNavbar navbar = new DimensionalNavbar(); @@ -77,7 +72,7 @@ class PSAdminPage extends PortalPage { /** * This method outputs a list of links to admin functionality. */ - + @Override protected void buildBody(Container body) { m_bpanel = new BoxPanel(); @@ -98,11 +93,11 @@ class PSAdminPage extends PortalPage { * This method is called by the generateXML() method of the parent * class, and writes a CSS style block into the output. */ - + @Override public void addStyleBlock(PageState state, Document parent) { PortalSite psite = PortalSite.getCurrentPortalSite(state.getRequest()); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("