content-center-redirect.jsp ist jetzt unabhängig von einen spezifischen Namen der content section. Datei integration.properties muss angepasst werden.

Codebereinigung von UI und login package.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1547 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-03-24 23:33:02 +00:00
parent a8764bf7ad
commit cf4118ee01
18 changed files with 189 additions and 313 deletions

View File

@ -28,7 +28,7 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt
core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.root_page_url=navigation/
core.ui.pagemap.workspace_url=navigation/ core.ui.pagemap.workspace_url=navigation/
core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
; workflow configuration ; workflow configuration
waf.workflow.simple.alerts_enabled=true waf.workflow.simple.alerts_enabled=true

View File

@ -28,7 +28,7 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt
core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.root_page_url=navigation/
core.ui.pagemap.workspace_url=navigation/ core.ui.pagemap.workspace_url=navigation/
core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
; workflow configuration ; workflow configuration
waf.workflow.simple.alerts_enabled=true waf.workflow.simple.alerts_enabled=true
@ -57,6 +57,7 @@ com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatch
; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_hidden_buttons=
; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS
com.arsdigita.cms.allow_content_create_in_section_listing=false
com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.disable_item_pfs=true
com.arsdigita.cms.hide_admin_tabs=true com.arsdigita.cms.hide_admin_tabs=true

View File

@ -86,7 +86,7 @@ public class PublicPersonalProfileXmlUtil {
/*navList.addAttribute("url", String.format("%s/%s", /*navList.addAttribute("url", String.format("%s/%s",
appUrl, appUrl,
profile.getProfileUrl()));*/ profile.getProfileUrl()));*/
navList.addAttribute("url", String.format("/ccm/%s", navList.addAttribute("url", String.format("/ccm%s",
UI.getConfig().getRootPage())); UI.getConfig().getRootPage()));
@ -142,7 +142,7 @@ public class PublicPersonalProfileXmlUtil {
//homeElem.addAttribute("url", String.format("%s/%s", //homeElem.addAttribute("url", String.format("%s/%s",
// appUrl, // appUrl,
// profile.getProfileUrl())); // profile.getProfileUrl()));
homeElem.addAttribute("url", String.format("/ccm/%s", homeElem.addAttribute("url", String.format("/ccm%s",
UI.getConfig().getRootPage())); UI.getConfig().getRootPage()));
final Element profileElem = final Element profileElem =

View File

@ -152,10 +152,9 @@ public final class CMSConfig extends AbstractConfig {
* Path is relative to webapp root. * Path is relative to webapp root.
*/ */
private final Parameter m_templateRootPath = private final Parameter m_templateRootPath =
new StringParameter( new StringParameter("com.arsdigita.cms.template_root_path",
"com.arsdigita.cms.template_root_path", Parameter.REQUIRED,
Parameter.REQUIRED, "/templates/ccm-cms/content-section");
"/templates/ccm-cms/content-section");
// up to version 6.6.4 // up to version 6.6.4
// "/packages/content-section/templates"); // "/packages/content-section/templates");
@ -175,10 +174,9 @@ public final class CMSConfig extends AbstractConfig {
* specifications. Path is relative to webapp root. * specifications. Path is relative to webapp root.
*/ */
private final Parameter m_itemAdapters = private final Parameter m_itemAdapters =
new ResourceParameter( new ResourceParameter("com.arsdigita.cms.item_adapters",
"com.arsdigita.cms.item_adapters", Parameter.REQUIRED,
Parameter.REQUIRED, "/WEB-INF/resources/cms-item-adapters.xml");
"/WEB-INF/resources/cms-item-adapters.xml");
// URL resource: protocol handler removal: END // URL resource: protocol handler removal: END
/** /**
* Use streamlined content creation: upon item creation, * Use streamlined content creation: upon item creation,

View File

@ -255,8 +255,8 @@ public class ContentSection extends Application {
* it contains the static prefix (if one is configured, "ccm" by default) * it contains the static prefix (if one is configured, "ccm" by default)
* and must not be used to construct an url for internal links! * and must not be used to construct an url for internal links!
* *
* @return The URL of the site node on which the content section is mounted. * @return The URL where the content section is mounted.
* This URL includes the webapp context path. * This URL includes the webapp context path.
*/ */
public String getURL() { public String getURL() {
String sURL = null; String sURL = null;

View File

@ -96,7 +96,9 @@ public class WorkspaceServlet extends BaseApplicationServlet {
requireTrailingSlash(""); requireTrailingSlash("");
/** Set Template base path for JSP's */ /** Set Template base path for JSP's */
m_templatePath = ContentSection.getConfig().getTemplateRoot(); // ToDo: Make it configurable by an appropriate config registry entry!
// m_templatePath = CMS.getConfig().getTemplateRoot();
m_templatePath = "/templates/ccm-cms/content-center";
Assert.exists(m_templatePath, String.class); Assert.exists(m_templatePath, String.class);
Assert.isTrue(m_templatePath.startsWith("/"), Assert.isTrue(m_templatePath.startsWith("/"),
"template-path must start with '/'"); "template-path must start with '/'");
@ -139,15 +141,20 @@ public class WorkspaceServlet extends BaseApplicationServlet {
} }
// Check user access. // Check user access.
checkUserAccess(sreq, sresp); // checkUserAccess(sreq, sresp);
ResourceHandler page = getResource(url); ResourceHandler page = getResource(url);
if ( page != null ) { if ( page != null ) {
// Check user access.
checkUserAccess(sreq, sresp);
// Serve the page. // Serve the page.
page.init(); page.init();
page.dispatch(sreq, sresp, ctx); page.dispatch(sreq, sresp, ctx);
} else { } else {
// Fall back on the JSP application dispatcher. // Fall back on the JSP application dispatcher.
// NOTE: The JSP must ensure the proper authentication and
// authorisation if required!
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("NO page registered to serve the requst url."); s_log.info("NO page registered to serve the requst url.");
} }

View File

@ -199,14 +199,6 @@ public class KernelHelper {
return Kernel.getSecurityConfig().getAdminContactEmail(); return Kernel.getSecurityConfig().getAdminContactEmail();
} }
/**
* @deprecated Use
* <code>Kernel.getConfig().getPrimaryUserIdentifier()</code>
*/
public static synchronized boolean emailIsPrimaryIdentifier() {
return Kernel.getConfig().getPrimaryUserIdentifier().equals("email");
}
/** /**
* *
* *

View File

@ -495,8 +495,8 @@ public class UserAuthentication extends DomainObject {
} }
set("id", user.getID()); set("id", user.getID());
setAssociation("user", user); setAssociation("user", user);
set("primaryEmail", user.getPrimaryEmail().getEmailAddress()); set("primaryEmail", user.getPrimaryEmail().getEmailAddress());
set("screenName", user.getScreenName()); set("screenName", user.getScreenName());
m_user = user; m_user = user;
} }
@ -510,10 +510,10 @@ public class UserAuthentication extends DomainObject {
* @return The login name used for the user. * @return The login name used for the user.
**/ **/
private static String getLoginNameForUser(User user) { private static String getLoginNameForUser(User user) {
if (KernelHelper.emailIsPrimaryIdentifier()) { if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
return user.getPrimaryEmail().getEmailAddress(); return user.getPrimaryEmail().getEmailAddress();
} }
return user.getScreenName(); return user.getScreenName();
} }
} }

View File

@ -40,39 +40,14 @@ public abstract class UI {
private static final UIConfig s_config = UIConfig.getConfig(); private static final UIConfig s_config = UIConfig.getConfig();
/** (Relative) URL for systems public top level page. */ /** URL for systems public top level page (entry or start page). */
// In old LegacyInitializer ROOT_PAGE_KEY =pagemap.root= register/ | portal/
private static final String s_rootPageURL = s_config.getRootPage(); private static final String s_rootPageURL = s_config.getRootPage();
/** */ /** URL to page a user should be redirected to after login. */
private static final String s_userRedirectURL = s_config.getUserRedirect(); private static final String s_userRedirectURL = s_config.getUserRedirect();
/** (Relative) URL for workspace page. */ /** (Absolute) URL for workspace page. */
private static final String s_workspaceURL = s_config.getWorkspace(); private static final String s_workspaceURL = s_config.getWorkspace();
/** Root URL */
// This address used to be determinded by
// SiteNode.getRootSiteNode().getURL();
// It provides a sitenode without a name an without any parent, i.e. "/"
// There is no information whether the context path (in case we are not
// installed as root application (context) of the servlet(!) container).
// It does obviously NOT include the constant prefix, generated by the
// new dispatcher.
//
// Previously an variant had been used:
// SiteNode.getRootSiteNode().getURL(request);
// but according to a developers comment the latter is not save:
// "this isn't safe since you aren't neccessarily calling it from
// the root webapp - so we can't blindly prepend the context path
// from the current request."
//
// Sitenode is deprecated, web.Application should be used instead. But here
// there is no application to invoke, but we need the root part of the URL
// for a page to be prepended to its address. This depends on the
// installation, not on the request or the specific application.
//
// XXX must be generated from an installation config record.
private static final String s_rootURL = "/";
/** /**
* Provides a handle to the UI config record. * Provides a handle to the UI config record.
* *
@ -83,59 +58,119 @@ public abstract class UI {
} }
/** /**
* Provides an absolute URL (leading slash) into the system top-level page. * Provides an absolute URL (leading slash) into the system top-level page
* It is relative to document root without any constant prefix if there is * (entry page / start page). It is relative to document root without any
* one configured. * constant prefix if there is one configured.
* *
* XXX This implementation starts with a leading slash and ends with a slash. * Method is typically called by servlets and especially by JSP's.
* 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. * Currently just a wrapper script to getRootPageURL() because req is
* Since version 5.2 the context part is handled by (new) dispatcher. * currently ignored.
* Therefore the request parameter is not ignored! This variant is retained *
* for backwards compatibility only. * @param req HttpServletRequest, may be used to determin the context of
* The leading slash is API change! It's impacts have to be checked. (2011-02) * the current thread (application), currently not used and
* introduced here for backwards compatibility
* *
* @return URL for top-level page as String * @return URL for top-level page as String
*/ */
// In old LegacyInitializer ROOT_PAGE_KEY = pagemap.root = register/
// (usually modif. to portal/nav)
public static String getRootPageURL(HttpServletRequest req) { public static String getRootPageURL(HttpServletRequest req) {
if (s_log.isDebugEnabled()) { return getRootPageURL();
s_log.debug("Root is " + s_rootURL + ", url is " + s_rootPageURL);
}
if ((s_rootURL == null) || (s_rootPageURL == null)) {
return null;
}
return s_rootURL + s_rootPageURL;
} }
/** /**
* Provides an absolute URL (leading slash) into the system top-level page. * Provides an absolute URL (leading slash) into the system top-level page
* It is relative to document root without any constant prefix if there is * (entry page / start page). It is relative to document root without any
* one configured. * constant prefix if there is one configured.
* *
* XXX This implementation starts with a leading slash and ends with a slash. * Method is typically called by servlets and especially by JSP's.
* 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 tp be checked. (2011-02)
* *
* @return URL for top-level page as String * @return URL for top-level page as String
*/ */
// In old LegacyInitializer ROOT_PAGE_KEY = register/ (modif. to portal/nav)
public static String getRootPageURL() { public static String getRootPageURL() {
if (s_log.isDebugEnabled()) { return s_rootPageURL;
s_log.debug("Root is " + s_rootURL + ", url is " + s_rootPageURL);
}
if ((s_rootURL == null) || (s_rootPageURL == null)) {
return null;
}
return s_rootURL + s_rootPageURL;
// return s_rootPageURL;
} }
/**
* Provides the absolute URL of a page, which redirects an incomming request
* based on some clients property, usually whether the user is logged in,
* either to a general public page or to a user (client) specific page.
*
* It is relative to document root including leading slash but without any
* constant prefix if there is one configured.
*
* It is typically used after login to redirect to an appropriate page, by
* default to /peremissions/. A site should configure an application
* to their specific purposes. e.g ccm-cms provides a page
* content-center/redirect.jsp which redirects a user to the content-center
* if logged in.
*
* @return full URL of a user redirect page, may be null
*/
public static String getUserRedirectURL() {
return s_userRedirectURL;
}
/**
* Wrapper method for {@see getUserRedirectURL()}
* which redirects a user to the content-center if logged in.
*
* Method is specifically used by various redirect JSP's.
*
* @param req HttpServletRequest, may be used to determin the context of
* the current thread (application), currently not used and
* introduced here for backwards compatibility
* @return full URL of a user redirect page, may be null
*/
public static String getUserRedirectURL(HttpServletRequest req) {
return getUserRedirectURL();
}
/**
* Provides the absolute URL for the system workspace page. It is relative
* to document root including leading slash but without any constant prefix
* if there is one configured.
*
* It is used by the user redirection page (see above) as redirection target
* if no logged in user exists or no user specific page is configured. By
* default it is configured as "pvt/" as well. An installation usually
* defines a different page according to their specific purposes, e.g.
* portal or navigation.
*
* @return URL for workspace page as String
*/
public static String getWorkspaceURL() {
return s_workspaceURL;
}
/**
* Provides the absolute URL for the system workspace page.
* It is relative to document root including leading slash but without any
* constant prefix if there is one configured.
*
* Method is typically called by servlets and especially by JSP's.
*
* Currently just a wrapper script to getWorkspaceURL() because req is
* currently ignored.
*
* @param req HttpServletRequest, may be used to determin the context of
* the current thread (application), currently not used and
* introduced here for backwards compatibility
*
* @return URL for workspace page as String
*/
// In old LegacyInitializer
// WORKSPACE_PAGE_KEY = page.kernel.workspace=pvt/ (mod- t0 portal/nav)
public static String getWorkspaceURL(HttpServletRequest req) {
return getWorkspaceURL();
}
// ////////////////////////////////////////////////////////////////////////
// Various deprfecated methods, to be removed as soon as invoking code is
// refactored.
// ////////////////////////////////////////////////////////////////////////
/** /**
* Provides an absolute URL (leading slash) into the system login page. * Provides an absolute URL (leading slash) into the system login page.
* It is relative to document root without any constant prefix if there is * It is relative to document root without any constant prefix if there is
@ -196,168 +231,4 @@ public abstract class UI {
return LoginServlet.getLogoutPageURL(); return LoginServlet.getLogoutPageURL();
} }
/**
* Provides the absolute URL of a page, which redirects an incomming request
* based on some clients property, usually whether the user is logged in,
* either to a general public page or to a user (client) specific page.
*
* It is relative to document root including leading slash but without any
* constant prefix if there is one configured.
*
* It is used by the ccm index page (home/start page) ~/index.jsp. By default
* it is configured as "pvt/" which redirects to a user specific home page
* if the initial incomming request comes from a logged in user.
* Applications may configure a different page according to their specific
* purposes. e.g ccm-cms provides a page content/content-center-redirect.jsp
* which redirects a user to the content-center if logged in.
*
* 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.
* Previous implementation of this method signature (no parameter) returned
* an url without leading slash.
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
*
* @return full URL of a user redirect page, may be null
*/
// In old LegacyInitializer
// LOGIN_REDIRECT_PAGE_KEY =page.kernel.login.redirect=pvt/
// (usually modified to "content/content-center-redirect-page.jsp")
public static String getUserRedirectURL() {
if (s_log.isDebugEnabled()) {
s_log.debug("Root is " + s_rootURL + ", url is " + s_userRedirectURL);
}
if ((s_rootURL == null) || (s_userRedirectURL == null)) {
return null;
}
return s_rootURL + s_userRedirectURL;
}
/**
* Provides the absolute URL of a page, which redirects an incomming request
* based on some clients property, usually whether the user is logged in,
* either to a general public page or to a user (client) specific page.
*
* It is relative to document root including leading slash but without any
* constant prefix if there is one configured.
*
* It is used by the ccm index page (home/start page) ~/index.jsp. By default
* it is configured as "pvt/" which redirects to a user specific home page
* if the initial incomming request comes from a logged in user.
* Applications may configure a different page according to their specific
* purposes. e.g ccm-cms provides a page content/content-center-redirect.jsp
* which redirects a user to the content-center if logged in.
*
* 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.
* Previous implementation of this method signature (HTTPServletRequest)
* returned an url to a registration redirect page either starting with a
* slash for root context or the context path part. HTTPServletRequest is
* no longer significant here and method signature retained here for
* backwards compatibility only.
*
* @param req HttpServletRequest, may be used to determin the context of
* the current thread (application), currently not used and
* introduced here for backwards compatibility
* @return full URL of a user redirect page, may be null
*/
// see comment at top about getRootURL(req) for details!
// In old LegacyInitializer
// LOGIN_REDIRECT_PAGE_KEY =page.kernel.login.redirect=pvt/
// (usually modified to "content/content-center-redirect-page.jsp")
public static String getUserRedirectURL(HttpServletRequest req) {
if (s_log.isDebugEnabled()) {
s_log.debug("Root is " + s_rootURL + ", url is " + s_userRedirectURL);
}
if ((s_rootURL == null) || (s_userRedirectURL == null)) {
return null;
}
return s_rootURL + s_userRedirectURL;
}
/**
* Provides the absolute URL for the system workspace page. It is relative
* to document root including leading slash but without any constant prefix
* if there is one configured.
*
* It is used by the user redirection page (see above) as redirection target
* if no logged in user exists or no user specific page is configured. By
* default it is configured as "pvt/" as well. An installation usually
* defines a different page according to their specific purposes, e.g.
* portal or navigation.
*
* 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.
* Previous implementation of this method signature (no parameter) returned
* an url without leading slash.
* The leading slash it API change! It's impacts have tp be checked. (2011-02)
*
* @return URL for workspace page as String
*/
// In old LegacyInitializer
// WORKSPACE_PAGE_KEY = page.kernel.workspace=pvt/ (mod- t0 portal/nav)
public static String getWorkspaceURL() {
if (s_log.isDebugEnabled()) {
s_log.debug("Root is " + s_rootURL + ", url is " + s_workspaceURL);
}
if ((s_rootURL == null) || (s_workspaceURL == null)) {
return null;
}
return s_rootURL + s_workspaceURL;
}
/**
* Provides the absolute URL for the system workspace page.
* It is relative to document root including leading slash but without any
* constant prefix if there is one configured.
*
* It is used by the user redirection page (see above) as redirection target
* if no logged in user exists or no user specific page is configured. By
* default it is configured as "pvt/" as well. An installation usually
* defines a different page according to their specific purposes, e.g.
* portal or navigation.
*
* 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.
* Previous implementation of this method signature (HTTPServletRequest)
* returned an url to a workspace page either starting with a
* slash for root context or the context path part. HTTPServletRequest is
* no longer significant here and method signature retained here for
* backwards compatibility only.
*
*
* @param req HttpServletRequest, may be used to determin the context of
* the current thread (application), currently not used and
* introduced here for backwards compatibility
* @return URL for workspace page as String
*/
// In old LegacyInitializer
// WORKSPACE_PAGE_KEY = page.kernel.workspace=pvt/ (mod- t0 portal/nav)
public static String getWorkspaceURL(HttpServletRequest req) {
if (s_log.isDebugEnabled()) {
s_log.debug("Root is " + s_rootURL + ", url is " + s_workspaceURL);
}
if ((s_rootURL == null) || (s_workspaceURL == null)) {
return null;
}
return s_rootURL + s_workspaceURL;
}
// In old LegacyInitializer
// PERMISSION_PAGE_KEY = page.kernel.permission = permissions/
// In old LegacyInitializer
// PERM_SINGLE_PAGE_KEY = page.kernel.perm-single = permissions/one/
} }

View File

@ -20,8 +20,6 @@
package com.arsdigita.ui; package com.arsdigita.ui;
import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.ui.login.Login;
import com.arsdigita.ui.login.LoginServlet;
import com.arsdigita.util.StringUtils; import com.arsdigita.util.StringUtils;
import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.StringParameter;
import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringArrayParameter;
@ -140,21 +138,23 @@ public class UIConfig extends AbstractConfig {
); );
/** String containing the relative URL for the top level page /** String containing the relative URL for the top level page
* (or entry page / home page) of the site, Without leading slash but with * (or entry page / home page) of the site, Without leading slash but
* trailing slash in case of a directory. * with trailing slash in case of a directory.
* By default it is the login page, but usually the root page of the main * By default it is the login page, but usually the root page of the
* presentation application, e.g. portal, navigation, forum, etc. */ * main presentation application, e.g. portal, navigation, forum, etc. */
// Old initializer: waf.pagemap.root private final Parameter m_rootPageURL =
private final Parameter m_rootPageURL = new StringParameter new StringParameter("core.ui.pagemap.root_page_url",
("core.ui.pagemap.root_page_url", Parameter.REQUIRED, "register/"); Parameter.REQUIRED, "/register/");
/** String containing the URL for a page which may perform a user specific /** String containing the URL of a page, a servlet or a jsp, to which a
* redirect if logged in or to a general public page if not. */ * user after login will be redirected to.
// Used to be LOGIN_REDIRECT_PAGE_KEY in old kernel/security/initializer * In case of a jsp or servlet it may contain user specific logic to
// parameter waf.pagemap.login_redirect = pvt/ * redirect to a page specific for the user or a group of users.
// XXX url pvt seems not to exist anymore! (pboy 2011-02-03) * By default it is the /permissions/ page, but usually it is an
private final Parameter m_userRedirectURL = new StringParameter * application like personal-portal or content-center. */
("core.ui.pagemap.user_redirect_url", Parameter.REQUIRED, "pvt/"); private final Parameter m_userRedirectURL =
new StringParameter("core.ui.pagemap.user_redirect_url",
Parameter.REQUIRED, "/permissions/");
/** String containing the URL for the workspace of the site. */ /** String containing the URL for the workspace of the site. */
// Old initializer: waf.pagemap.workspace // Old initializer: waf.pagemap.workspace
@ -237,16 +237,27 @@ public class UIConfig extends AbstractConfig {
* @return root page url * @return root page url
*/ */
public String getRootPage() { public String getRootPage() {
return (String)get(m_rootPageURL) ; String rootPageURL = (String)get(m_rootPageURL) ;
// Previous configurations required NO leading slash. Just in case an
// old configuration is in place we have to translate.
return ( rootPageURL.startsWith("/") ?
rootPageURL : "/"+rootPageURL );
} }
/** /**
* Retrieve systems user login redirect page url. * Retrieve systems user login redirect page url, that is the page, a
* servlet oder a JSP ti which a user is redirected to after login.
* By default it is the /permissions/ page, but usually it is an application
* like personal-portal or content-center.
* *
* @return user login redirect page url * @return user login redirect page url
*/ */
public String getUserRedirect() { public String getUserRedirect() {
return (String)get(m_userRedirectURL) ; String userRedirectURL = (String)get(m_userRedirectURL);
// Previous configurations required NO leading slash. Just in case an
// old configuration is in place we have to translate.
return ( userRedirectURL.startsWith("/") ?
userRedirectURL : "/"+userRedirectURL );
} }
/** /**
@ -255,7 +266,11 @@ public class UIConfig extends AbstractConfig {
* @return workspace page url * @return workspace page url
*/ */
public String getWorkspace() { public String getWorkspace() {
return (String)get(m_workspaceURL) ; String workspaceURL = (String)get(m_workspaceURL);
// Previous configurations required NO leading slash. Just in case an
// old configuration is in place we have to translate.
return ( workspaceURL.startsWith("/") ?
workspaceURL : "/"+workspaceURL );
} }
} }

View File

@ -111,12 +111,6 @@ public class LoginServlet extends BebopApplicationServlet {
// define // define
final static String s_loginURL = Login.LOGIN_PAGE_URL; final static String s_loginURL = Login.LOGIN_PAGE_URL;
// final static String s_loginURL = (Login.getLoginPageURL().endsWith("/") ?
// Login.getLoginPageURL()
// .substring(0,
// Login.getLoginPageURL()
// .length()-1) :
// Login.getLoginPageURL() );
/** /**
* User extension point used to create the pages to server and setup a * User extension point used to create the pages to server and setup a
@ -127,9 +121,6 @@ public class LoginServlet extends BebopApplicationServlet {
@Override @Override
public void doInit() throws ServletException { public void doInit() throws ServletException {
// Should be handled elsewhere, we have to check for it.
// put("/",UI.getRootPageURL());
// Allow world caching for pages without authentication, // Allow world caching for pages without authentication,
// ie, /register, /register/explain-persistent-cookies, // ie, /register, /register/explain-persistent-cookies,
// /register/login-expired, /register/recover-password // /register/login-expired, /register/recover-password

View File

@ -39,7 +39,7 @@ import com.arsdigita.bebop.parameters.StringLengthValidationListener;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.parameters.URLParameter; import com.arsdigita.bebop.parameters.URLParameter;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.KernelHelper; import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.PersonName; import com.arsdigita.kernel.PersonName;
import com.arsdigita.kernel.User; import com.arsdigita.kernel.User;
import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.DataQuery;
@ -356,7 +356,7 @@ public abstract class UserForm extends Form
// If this query returns with any rows we have a duplicate // If this query returns with any rows we have a duplicate
// screen name, email address, or both. Check the results and // screen name, email address, or both. Check the results and
// produce appropriate error messages. // produce appropriate error messages.
boolean checkPrimaryEmail = KernelHelper.emailIsPrimaryIdentifier(); boolean checkPrimaryEmail = Kernel.getConfig().emailIsPrimaryIdentifier();
Filter filter = null; Filter filter = null;
if (checkPrimaryEmail) { if (checkPrimaryEmail) {

View File

@ -43,11 +43,9 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.parameters.URLParameter; import com.arsdigita.bebop.parameters.URLParameter;
import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelHelper;
import com.arsdigita.kernel.security.AccountNotFoundException; import com.arsdigita.kernel.security.AccountNotFoundException;
import com.arsdigita.kernel.security.Credential; import com.arsdigita.kernel.security.Credential;
import com.arsdigita.kernel.security.CredentialException; import com.arsdigita.kernel.security.CredentialException;
// import com.arsdigita.kernel.security.LegacyInitializer;
import com.arsdigita.kernel.security.SecurityConfig; import com.arsdigita.kernel.security.SecurityConfig;
import com.arsdigita.kernel.security.UserContext; import com.arsdigita.kernel.security.UserContext;
import com.arsdigita.ui.UI; import com.arsdigita.ui.UI;
@ -183,7 +181,7 @@ public class UserLoginForm extends Form
LoginServlet.SUBSITE_NS_URI); LoginServlet.SUBSITE_NS_URI);
if (KernelHelper.emailIsPrimaryIdentifier()) { if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
loginMessage.setClassAttr("email"); loginMessage.setClassAttr("email");
} else { } else {
loginMessage.setClassAttr("screenName"); loginMessage.setClassAttr("screenName");
@ -191,7 +189,7 @@ public class UserLoginForm extends Form
add(loginMessage); add(loginMessage);
if (KernelHelper.emailIsPrimaryIdentifier()) { if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
add(new Label(LoginHelper.getMessage( add(new Label(LoginHelper.getMessage(
"login.userRegistrationForm.email"))); "login.userRegistrationForm.email")));
m_loginName = new TextField(new EmailParameter(FORM_LOGIN)); m_loginName = new TextField(new EmailParameter(FORM_LOGIN));
@ -297,7 +295,7 @@ public class UserLoginForm extends Form
try { try {
UserContext ctx = Web.getUserContext(); UserContext ctx = Web.getUserContext();
String username = null; String username = null;
if (KernelHelper.emailIsPrimaryIdentifier()) { if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
username = ((InternetAddress) m_loginName.getValue(state)). username = ((InternetAddress) m_loginName.getValue(state)).
getAddress(); getAddress();
} else { } else {
@ -406,24 +404,23 @@ public class UserLoginForm extends Form
Object persistentLoginValue = m_isPersistent.getValue(state); Object persistentLoginValue = m_isPersistent.getValue(state);
String[] values; String value ;
String value;
if (persistentLoginValue == null) { if (persistentLoginValue == null) {
return defaultValue; return defaultValue;
} }
if (persistentLoginValue instanceof String[]) { if (persistentLoginValue instanceof String[]) {
values = (String[]) persistentLoginValue; value = ((String[])persistentLoginValue)[0];
return "1".equals(values[0]);
} }
else if (persistentLoginValue instanceof String) {
if (persistentLoginValue instanceof String) {
value = (String) persistentLoginValue; value = (String) persistentLoginValue;
return "1".equals(value); }
else {
value = "0";
} }
return defaultValue; return "1".equals(value);
} }
/** /**

View File

@ -38,7 +38,6 @@ import com.arsdigita.web.ReturnSignal;
import com.arsdigita.kernel.EmailAddress; import com.arsdigita.kernel.EmailAddress;
import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.kernel.KernelHelper;
import com.arsdigita.kernel.User; import com.arsdigita.kernel.User;
import com.arsdigita.kernel.UserAuthentication; import com.arsdigita.kernel.UserAuthentication;
import com.arsdigita.kernel.permissions.PermissionDescriptor; import com.arsdigita.kernel.permissions.PermissionDescriptor;
@ -123,7 +122,7 @@ public class UserNewForm extends UserForm
m_confirm.setValue(state, ""); m_confirm.setValue(state, "");
String loginName = (String)m_loginName.getValue(state); String loginName = (String)m_loginName.getValue(state);
if (loginName != null) { if (loginName != null) {
if (KernelHelper.emailIsPrimaryIdentifier()) { if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
m_email.setValue(state, loginName); m_email.setValue(state, loginName);
} else { } else {
m_screenName.setValue(state, loginName); m_screenName.setValue(state, loginName);
@ -146,7 +145,7 @@ public class UserNewForm extends UserForm
final String firstName = (String)m_firstName.getValue(state); final String firstName = (String)m_firstName.getValue(state);
final String lastName = (String)m_lastName.getValue(state); final String lastName = (String)m_lastName.getValue(state);
String sn = null; String sn = null;
if (!KernelHelper.emailIsPrimaryIdentifier()) { if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
sn = (String)m_screenName.getValue(state); sn = (String)m_screenName.getValue(state);
} }
final String screenName = sn; final String screenName = sn;
@ -167,7 +166,7 @@ public class UserNewForm extends UserForm
user.getPersonName().setGivenName(firstName); user.getPersonName().setGivenName(firstName);
user.getPersonName().setFamilyName(lastName); user.getPersonName().setFamilyName(lastName);
user.setPrimaryEmail(new EmailAddress(email)); user.setPrimaryEmail(new EmailAddress(email));
if (!KernelHelper.emailIsPrimaryIdentifier()) { if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
user.setScreenName(screenName); user.setScreenName(screenName);
} }
user.setURI(urlFinal); user.setURI(urlFinal);
@ -203,7 +202,7 @@ public class UserNewForm extends UserForm
// finally log the user in (sets the // finally log the user in (sets the
// appropriate session or permanent cookie) // appropriate session or permanent cookie)
String loginName = email; String loginName = email;
if (!KernelHelper.emailIsPrimaryIdentifier()) { if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
loginName = screenName; loginName = screenName;
} }
Web.getUserContext().login Web.getUserContext().login

View File

@ -156,6 +156,10 @@ public class URL {
public static final String THEMES_DIR = "/themes"; public static final String THEMES_DIR = "/themes";
/** Base direcotry for template files provided by packages. Each package
* has to place files into a subdirectory with its name */
public static final String TEMPLATE_DIR = "/templates";
/** /**
* The standard location for servlets. * The standard location for servlets.
*/ */

View File

@ -28,7 +28,8 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/scientificCMS-stylesheet-path
core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.root_page_url=navigation/
core.ui.pagemap.workspace_url=navigation/ core.ui.pagemap.workspace_url=navigation/
core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp # core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp
core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
; workflow configuration ; workflow configuration
waf.workflow.simple.alerts_enabled=true waf.workflow.simple.alerts_enabled=true

View File

@ -28,7 +28,7 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/scientificCMS-stylesheet-path
core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.root_page_url=navigation/
core.ui.pagemap.workspace_url=navigation/ core.ui.pagemap.workspace_url=navigation/
core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp core.ui.pagemap.user_redirect_url=content-center/redirect.jsp
; workflow configuration ; workflow configuration
waf.workflow.simple.alerts_enabled=true waf.workflow.simple.alerts_enabled=true