Nachführen von Änderungen aus ccm-core (security initializer undd populate) in anderen Modulen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@723 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
490519c5a8
commit
0d1bf1f042
|
|
@ -428,10 +428,11 @@ public final class CMSConfig extends AbstractConfig {
|
||||||
// to SectionInitializer. However, it still may be useful to
|
// to SectionInitializer. However, it still may be useful to
|
||||||
// keep these for the default values.
|
// keep these for the default values.
|
||||||
// ///////////////////////////////////////////
|
// ///////////////////////////////////////////
|
||||||
private final Parameter m_defaultItemResolverClass = new SpecificClassParameter("com.arsdigita.cms.default_item_resolver_class",
|
private final Parameter m_defaultItemResolverClass = new SpecificClassParameter
|
||||||
Parameter.REQUIRED,
|
("com.arsdigita.cms.default_item_resolver_class",
|
||||||
MultilingualItemResolver.class,
|
Parameter.REQUIRED,
|
||||||
ItemResolver.class);
|
MultilingualItemResolver.class,
|
||||||
|
ItemResolver.class);
|
||||||
private final Parameter m_defaultTemplateResolverClass = new SpecificClassParameter("com.arsdigita.cms.default_template_resolver_class",
|
private final Parameter m_defaultTemplateResolverClass = new SpecificClassParameter("com.arsdigita.cms.default_template_resolver_class",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
DefaultTemplateResolver.class,
|
DefaultTemplateResolver.class,
|
||||||
|
|
|
||||||
|
|
@ -500,9 +500,9 @@ public class SecurityManager implements Security, SecurityConstants {
|
||||||
throws IOException, ServletException {
|
throws IOException, ServletException {
|
||||||
|
|
||||||
if (KernelHelper.getCurrentUser(request) != null) { return; }
|
if (KernelHelper.getCurrentUser(request) != null) { return; }
|
||||||
String url = com.arsdigita.kernel.security.Initializer
|
String url = com.arsdigita.kernel.security.Util
|
||||||
.getSecurityHelper().getLoginURL(request)
|
.getSecurityHelper().getLoginURL(request)
|
||||||
+ "?" + UserContext.RETURN_URL_PARAM_NAME
|
+ "?" + LoginHelper.RETURN_URL_PARAM_NAME
|
||||||
+ "=" + UserContext.encodeReturnURL(request);
|
+ "=" + UserContext.encodeReturnURL(request);
|
||||||
|
|
||||||
LoginHelper.sendRedirect(request, response, url);
|
LoginHelper.sendRedirect(request, response, url);
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,13 @@
|
||||||
package com.arsdigita.cms.dispatcher;
|
package com.arsdigita.cms.dispatcher;
|
||||||
|
|
||||||
import com.arsdigita.cms.WorkspaceSetup;
|
import com.arsdigita.cms.WorkspaceSetup;
|
||||||
import com.arsdigita.cms.util.PageClassConfigHandler;
|
// import com.arsdigita.cms.util.PageClassConfigHandler;
|
||||||
import com.arsdigita.developersupport.DeveloperSupport;
|
import com.arsdigita.developersupport.DeveloperSupport;
|
||||||
import com.arsdigita.dispatcher.Dispatcher;
|
import com.arsdigita.dispatcher.Dispatcher;
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import com.arsdigita.dispatcher.JSPApplicationDispatcher;
|
import com.arsdigita.dispatcher.JSPApplicationDispatcher;
|
||||||
import com.arsdigita.dispatcher.RequestContext;
|
import com.arsdigita.dispatcher.RequestContext;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.Util;
|
||||||
import com.arsdigita.kernel.security.UserContext;
|
import com.arsdigita.kernel.security.UserContext;
|
||||||
import com.arsdigita.ui.login.LoginHelper;
|
import com.arsdigita.ui.login.LoginHelper;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
|
@ -284,10 +284,10 @@ public class ContentCenterDispatcher extends LockableImpl
|
||||||
protected void redirectToLoginPage(HttpServletRequest req,
|
protected void redirectToLoginPage(HttpServletRequest req,
|
||||||
HttpServletResponse resp)
|
HttpServletResponse resp)
|
||||||
throws ServletException {
|
throws ServletException {
|
||||||
String url = Initializer.getSecurityHelper()
|
String url = Util.getSecurityHelper()
|
||||||
.getLoginURL(req)
|
.getLoginURL(req)
|
||||||
+"?"+UserContext.RETURN_URL_PARAM_NAME
|
+"?"+LoginHelper.RETURN_URL_PARAM_NAME
|
||||||
+"="+UserContext.encodeReturnURL(req);
|
+"="+UserContext.encodeReturnURL(req);
|
||||||
try {
|
try {
|
||||||
LoginHelper.sendRedirect(req, resp, url);
|
LoginHelper.sendRedirect(req, resp, url);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ public class Initializer extends com.arsdigita.runtime.GenericInitializer {
|
||||||
* A delay value of 0 inhibits start of processing.
|
* A delay value of 0 inhibits start of processing.
|
||||||
* @param evt The context init event.
|
* @param evt The context init event.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(ContextInitEvent evt) {
|
public void init(ContextInitEvent evt) {
|
||||||
s_log.debug("lifecycle background startup beginn.");
|
s_log.debug("lifecycle background startup beginn.");
|
||||||
|
|
||||||
|
|
@ -83,6 +84,7 @@ public class Initializer extends com.arsdigita.runtime.GenericInitializer {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void close(ContextCloseEvent evt) {
|
public void close(ContextCloseEvent evt) {
|
||||||
Scheduler.stopTimer();
|
Scheduler.stopTimer();
|
||||||
s_log.debug("lifecycle background processing stopped");
|
s_log.debug("lifecycle background processing stopped");
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,7 +45,7 @@ public class ContentSectionNavbar extends CMSContainer {
|
||||||
setClassAttr("section");
|
setClassAttr("section");
|
||||||
|
|
||||||
String wsUrl =
|
String wsUrl =
|
||||||
"/" + Initializer.getURL(Initializer.WORKSPACE_PAGE_KEY);
|
"/" + LegacyInitializer.getURL(LegacyInitializer.WORKSPACE_PAGE_KEY);
|
||||||
String csUrl = Utilities.getWorkspaceURL();
|
String csUrl = Utilities.getWorkspaceURL();
|
||||||
|
|
||||||
m_navbar = new DimensionalNavbar();
|
m_navbar = new DimensionalNavbar();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.DimensionalNavbar;
|
||||||
import com.arsdigita.bebop.Link;
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delimited dimensional navbar.
|
* Delimited dimensional navbar.
|
||||||
|
|
@ -40,7 +40,7 @@ public class GlobalNavbar extends DimensionalNavbar {
|
||||||
// add(new Link("Help", "help"));
|
// add(new Link("Help", "help"));
|
||||||
|
|
||||||
String signOutURL = Utilities.getWebappContext() + "/" +
|
String signOutURL = Utilities.getWebappContext() + "/" +
|
||||||
Initializer.getURL(Initializer.LOGOUT_PAGE_KEY);
|
LegacyInitializer.getURL(LegacyInitializer.LOGOUT_PAGE_KEY);
|
||||||
|
|
||||||
add(new Link((String) globalize("cms.ui.sign_out").localize(),
|
add(new Link((String) globalize("cms.ui.sign_out").localize(),
|
||||||
signOutURL));
|
signOutURL));
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SimpleComponent;
|
import com.arsdigita.bebop.SimpleComponent;
|
||||||
import com.arsdigita.cms.CMS;
|
import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
import com.arsdigita.web.URL;
|
import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -47,8 +47,8 @@ class GlobalNavigation extends SimpleComponent {
|
||||||
|
|
||||||
GlobalNavigation() {
|
GlobalNavigation() {
|
||||||
m_centerPath = Utilities.getWorkspaceURL();
|
m_centerPath = Utilities.getWorkspaceURL();
|
||||||
m_wspcPath = path(Initializer.WORKSPACE_PAGE_KEY);
|
m_wspcPath = path(LegacyInitializer.WORKSPACE_PAGE_KEY);
|
||||||
m_signOutPath = path(Initializer.LOGOUT_PAGE_KEY);
|
m_signOutPath = path(LegacyInitializer.LOGOUT_PAGE_KEY);
|
||||||
m_helpPath = "/nowhere"; // We don't have this yet XXX.
|
m_helpPath = "/nowhere"; // We don't have this yet XXX.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ class GlobalNavigation extends SimpleComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String path(final String key) {
|
private static String path(final String key) {
|
||||||
return "/" + Initializer.getURL(key);
|
return "/" + LegacyInitializer.getURL(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Element link(final HttpServletRequest sreq,
|
private static Element link(final HttpServletRequest sreq,
|
||||||
|
|
|
||||||
|
|
@ -60,12 +60,14 @@ public class PageClassConfigHandler extends DefaultHandler {
|
||||||
m_buffer = new StringBuffer();
|
m_buffer = new StringBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void characters(char[] ch, int start, int len) {
|
public void characters(char[] ch, int start, int len) {
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
m_buffer.append(ch[start + i]);
|
m_buffer.append(ch[start + i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void endElement(String uri, String localName, String qn) {
|
public void endElement(String uri, String localName, String qn) {
|
||||||
if ( qn.equals("url") ) {
|
if ( qn.equals("url") ) {
|
||||||
m_url = m_buffer.toString().trim();
|
m_url = m_buffer.toString().trim();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
|
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
|
||||||
|
|
||||||
<jsp:directive.page import="com.arsdigita.kernel.security.Initializer"/>
|
<jsp:directive.page import="com.arsdigita.kernel.security.LegacyInitializer"/>
|
||||||
<jsp:directive.page import="com.arsdigita.web.URL"/>
|
<jsp:directive.page import="com.arsdigita.web.URL"/>
|
||||||
<jsp:directive.page import="com.arsdigita.web.RedirectSignal"/>
|
<jsp:directive.page import="com.arsdigita.web.RedirectSignal"/>
|
||||||
<jsp:directive.page import="com.arsdigita.cms.ContentSection"/>
|
<jsp:directive.page import="com.arsdigita.cms.ContentSection"/>
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
if (hasAccess) {
|
if (hasAccess) {
|
||||||
url = Utilities.getWorkspaceURL();
|
url = Utilities.getWorkspaceURL();
|
||||||
} else {
|
} else {
|
||||||
url = Initializer.getFullURL(Initializer.WORKSPACE_PAGE_KEY, request);
|
url = LegacyInitializer.getFullURL(LegacyInitializer.WORKSPACE_PAGE_KEY, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RedirectSignal(URL.there(request, url), false);
|
throw new RedirectSignal(URL.there(request, url), false);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,17 @@ import com.arsdigita.populate.apps.PopulateApp;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.web.ApplicationType;
|
import com.arsdigita.web.ApplicationType;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Class is not used anywhere in the source tree, obviously even not in the
|
||||||
|
// test code tree.
|
||||||
|
// No Documentation how to use available.
|
||||||
|
//
|
||||||
|
// Retained temporarily for easy reference until the refactoring of the
|
||||||
|
// test cases is completed.
|
||||||
|
//
|
||||||
|
// (pboy 2011-01-30)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bche
|
* @author bche
|
||||||
*/
|
*/
|
||||||
|
|
@ -9,7 +9,7 @@ import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.KernelExcursion;
|
import com.arsdigita.kernel.KernelExcursion;
|
||||||
import com.arsdigita.kernel.Party;
|
import com.arsdigita.kernel.Party;
|
||||||
import com.arsdigita.kernel.User;
|
import com.arsdigita.kernel.User;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
import com.arsdigita.london.portal.Workspace;
|
import com.arsdigita.london.portal.Workspace;
|
||||||
import com.arsdigita.london.portal.util.GlobalizationUtil;
|
import com.arsdigita.london.portal.util.GlobalizationUtil;
|
||||||
import com.arsdigita.web.Application;
|
import com.arsdigita.web.Application;
|
||||||
|
|
@ -56,7 +56,7 @@ public class PersonalPortalPage extends Page {
|
||||||
Party party = Kernel.getContext().getParty();
|
Party party = Kernel.getContext().getParty();
|
||||||
|
|
||||||
if (party == null) {
|
if (party == null) {
|
||||||
sUrl = Initializer.getURL(Initializer.LOGIN_PAGE_KEY);
|
sUrl = LegacyInitializer.getURL(LegacyInitializer.LOGIN_PAGE_KEY);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
user = User.retrieve(party.getOID());
|
user = User.retrieve(party.getOID());
|
||||||
|
|
@ -97,7 +97,7 @@ public class PersonalPortalPage extends Page {
|
||||||
sUrl = personalWorkspace.getPath();
|
sUrl = personalWorkspace.getPath();
|
||||||
|
|
||||||
} catch (DataObjectNotFoundException donfe) {
|
} catch (DataObjectNotFoundException donfe) {
|
||||||
sUrl = Initializer.getURL(Initializer.LOGIN_PAGE_KEY);
|
sUrl = LegacyInitializer.getURL(LegacyInitializer.LOGIN_PAGE_KEY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
import com.arsdigita.kernel.permissions.UniversalPermissionDescriptor;
|
import com.arsdigita.kernel.permissions.UniversalPermissionDescriptor;
|
||||||
import com.arsdigita.kernel.security.Credential;
|
import com.arsdigita.kernel.security.Credential;
|
||||||
import com.arsdigita.kernel.security.CredentialEncodingException;
|
import com.arsdigita.kernel.security.CredentialEncodingException;
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
import com.arsdigita.london.portal.portlet.LoginPortlet;
|
import com.arsdigita.london.portal.portlet.LoginPortlet;
|
||||||
import com.arsdigita.london.portal.ui.PortalConstants;
|
import com.arsdigita.london.portal.ui.PortalConstants;
|
||||||
import com.arsdigita.persistence.DataQuery;
|
import com.arsdigita.persistence.DataQuery;
|
||||||
|
|
@ -68,8 +68,8 @@ public class LoginPortletRenderer extends AbstractPortletRenderer {
|
||||||
|
|
||||||
Element content = login.newChildElement("portlet:loginform",
|
Element content = login.newChildElement("portlet:loginform",
|
||||||
PortalConstants.PORTLET_XML_NS);
|
PortalConstants.PORTLET_XML_NS);
|
||||||
content.addAttribute("url", Initializer
|
content.addAttribute("url", LegacyInitializer
|
||||||
.getURL(Initializer.LOGIN_PAGE_KEY));
|
.getURL(LegacyInitializer.LOGIN_PAGE_KEY));
|
||||||
content.addAttribute("timestamp", timestamp);
|
content.addAttribute("timestamp", timestamp);
|
||||||
} else {
|
} else {
|
||||||
User user = (User) party;
|
User user = (User) party;
|
||||||
|
|
@ -82,15 +82,15 @@ public class LoginPortletRenderer extends AbstractPortletRenderer {
|
||||||
.getFamilyName());
|
.getFamilyName());
|
||||||
|
|
||||||
Link editProfile = new Link("Edit profile", "/"
|
Link editProfile = new Link("Edit profile", "/"
|
||||||
+ Initializer.getURL(Initializer.EDIT_PAGE_KEY));
|
+ LegacyInitializer.getURL(LegacyInitializer.EDIT_PAGE_KEY));
|
||||||
editProfile.generateXML(state, content);
|
editProfile.generateXML(state, content);
|
||||||
|
|
||||||
Link changePassword = new Link("Change password", "/"
|
Link changePassword = new Link("Change password", "/"
|
||||||
+ Initializer.getURL(Initializer.CHANGE_PAGE_KEY));
|
+ LegacyInitializer.getURL(LegacyInitializer.CHANGE_PAGE_KEY));
|
||||||
changePassword.generateXML(state, content);
|
changePassword.generateXML(state, content);
|
||||||
|
|
||||||
Link logout = new Link("Logout", "/"
|
Link logout = new Link("Logout", "/"
|
||||||
+ Initializer.getURL(Initializer.LOGOUT_PAGE_KEY));
|
+ LegacyInitializer.getURL(LegacyInitializer.LOGOUT_PAGE_KEY));
|
||||||
logout.generateXML(state, content);
|
logout.generateXML(state, content);
|
||||||
|
|
||||||
// Test whether the user can do anything in any content section
|
// Test whether the user can do anything in any content section
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ import com.arsdigita.bebop.Label;
|
||||||
|
|
||||||
import com.arsdigita.simplesurvey.ui.SimpleSurveyPanel;
|
import com.arsdigita.simplesurvey.ui.SimpleSurveyPanel;
|
||||||
|
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -59,7 +59,7 @@ public class ConfirmationPanel extends SimpleSurveyPanel {
|
||||||
protected void addComponentsToPage() {
|
protected void addComponentsToPage() {
|
||||||
|
|
||||||
String workspaceURL =
|
String workspaceURL =
|
||||||
Initializer.getURL(Initializer.WORKSPACE_PAGE_KEY);
|
LegacyInitializer.getURL(LegacyInitializer.WORKSPACE_PAGE_KEY);
|
||||||
|
|
||||||
Label bodyText = new Label("Your survey response has been submitted. " +
|
Label bodyText = new Label("Your survey response has been submitted. " +
|
||||||
"You may return to your <a href=\"/" + workspaceURL +
|
"You may return to your <a href=\"/" + workspaceURL +
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import com.arsdigita.kernel.SiteNode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.kernel.security.Initializer;
|
import com.arsdigita.kernel.security.LegacyInitializer;
|
||||||
|
|
||||||
import com.arsdigita.bebop.BoxPanel;
|
import com.arsdigita.bebop.BoxPanel;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
@ -115,7 +115,7 @@ public abstract class SimpleSurveyPanel extends SimpleContainer {
|
||||||
|
|
||||||
// Link to the workspace of the site
|
// Link to the workspace of the site
|
||||||
m_navBar.add(new Link("Workspace",
|
m_navBar.add(new Link("Workspace",
|
||||||
"/" + Initializer.getURL(Initializer.WORKSPACE_PAGE_KEY)));
|
"/" + LegacyInitializer.getURL(LegacyInitializer.WORKSPACE_PAGE_KEY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void addComponentsToPage();
|
protected abstract void addComponentsToPage();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue