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-94f89814c4dfmaster
parent
a8764bf7ad
commit
cf4118ee01
|
|
@ -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.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
|
||||
waf.workflow.simple.alerts_enabled=true
|
||||
|
|
|
|||
|
|
@ -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.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
|
||||
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_plugins=TableOperations,CSS
|
||||
|
||||
com.arsdigita.cms.allow_content_create_in_section_listing=false
|
||||
com.arsdigita.cms.disable_item_pfs=true
|
||||
|
||||
com.arsdigita.cms.hide_admin_tabs=true
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class PublicPersonalProfileXmlUtil {
|
|||
/*navList.addAttribute("url", String.format("%s/%s",
|
||||
appUrl,
|
||||
profile.getProfileUrl()));*/
|
||||
navList.addAttribute("url", String.format("/ccm/%s",
|
||||
navList.addAttribute("url", String.format("/ccm%s",
|
||||
UI.getConfig().getRootPage()));
|
||||
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ public class PublicPersonalProfileXmlUtil {
|
|||
//homeElem.addAttribute("url", String.format("%s/%s",
|
||||
// appUrl,
|
||||
// profile.getProfileUrl()));
|
||||
homeElem.addAttribute("url", String.format("/ccm/%s",
|
||||
homeElem.addAttribute("url", String.format("/ccm%s",
|
||||
UI.getConfig().getRootPage()));
|
||||
|
||||
final Element profileElem =
|
||||
|
|
|
|||
|
|
@ -152,8 +152,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
* Path is relative to webapp root.
|
||||
*/
|
||||
private final Parameter m_templateRootPath =
|
||||
new StringParameter(
|
||||
"com.arsdigita.cms.template_root_path",
|
||||
new StringParameter("com.arsdigita.cms.template_root_path",
|
||||
Parameter.REQUIRED,
|
||||
"/templates/ccm-cms/content-section");
|
||||
// up to version 6.6.4
|
||||
|
|
@ -175,8 +174,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
* specifications. Path is relative to webapp root.
|
||||
*/
|
||||
private final Parameter m_itemAdapters =
|
||||
new ResourceParameter(
|
||||
"com.arsdigita.cms.item_adapters",
|
||||
new ResourceParameter("com.arsdigita.cms.item_adapters",
|
||||
Parameter.REQUIRED,
|
||||
"/WEB-INF/resources/cms-item-adapters.xml");
|
||||
// URL resource: protocol handler removal: END
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public class ContentSection extends Application {
|
|||
* it contains the static prefix (if one is configured, "ccm" by default)
|
||||
* 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.
|
||||
*/
|
||||
public String getURL() {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,9 @@ public class WorkspaceServlet extends BaseApplicationServlet {
|
|||
requireTrailingSlash("");
|
||||
|
||||
/** 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.isTrue(m_templatePath.startsWith("/"),
|
||||
"template-path must start with '/'");
|
||||
|
|
@ -139,15 +141,20 @@ public class WorkspaceServlet extends BaseApplicationServlet {
|
|||
}
|
||||
|
||||
// Check user access.
|
||||
checkUserAccess(sreq, sresp);
|
||||
// checkUserAccess(sreq, sresp);
|
||||
|
||||
ResourceHandler page = getResource(url);
|
||||
if ( page != null ) {
|
||||
|
||||
// Check user access.
|
||||
checkUserAccess(sreq, sresp);
|
||||
// Serve the page.
|
||||
page.init();
|
||||
page.dispatch(sreq, sresp, ctx);
|
||||
} else {
|
||||
// Fall back on the JSP application dispatcher.
|
||||
// NOTE: The JSP must ensure the proper authentication and
|
||||
// authorisation if required!
|
||||
if (s_log.isInfoEnabled()) {
|
||||
s_log.info("NO page registered to serve the requst url.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,14 +199,6 @@ public class KernelHelper {
|
|||
return Kernel.getSecurityConfig().getAdminContactEmail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use
|
||||
* <code>Kernel.getConfig().getPrimaryUserIdentifier()</code>
|
||||
*/
|
||||
public static synchronized boolean emailIsPrimaryIdentifier() {
|
||||
return Kernel.getConfig().getPrimaryUserIdentifier().equals("email");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ public class UserAuthentication extends DomainObject {
|
|||
* @return The login name used for the user.
|
||||
**/
|
||||
private static String getLoginNameForUser(User user) {
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
return user.getPrimaryEmail().getEmailAddress();
|
||||
}
|
||||
return user.getScreenName();
|
||||
|
|
|
|||
|
|
@ -40,39 +40,14 @@ public abstract class UI {
|
|||
|
||||
private static final UIConfig s_config = UIConfig.getConfig();
|
||||
|
||||
/** (Relative) URL for systems public top level page. */
|
||||
// In old LegacyInitializer ROOT_PAGE_KEY =pagemap.root= register/ | portal/
|
||||
/** URL for systems public top level page (entry or start page). */
|
||||
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();
|
||||
/** (Relative) URL for workspace page. */
|
||||
/** (Absolute) URL for workspace page. */
|
||||
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.
|
||||
*
|
||||
|
|
@ -83,59 +58,119 @@ public abstract class UI {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* one configured.
|
||||
* Provides an absolute URL (leading slash) into the system top-level page
|
||||
* (entry page / start 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.
|
||||
* Therefore the request parameter is not ignored! This variant is retained
|
||||
* for backwards compatibility only.
|
||||
* The leading slash is API change! It's impacts have to be checked. (2011-02)
|
||||
* Method is typically called by servlets and especially by JSP's.
|
||||
*
|
||||
* Currently just a wrapper script to getRootPageURL() 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 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) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
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 getRootPageURL();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* one configured.
|
||||
* Provides an absolute URL (leading slash) into the system top-level page
|
||||
* (entry page / start 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 tp be checked. (2011-02)
|
||||
* Method is typically called by servlets and especially by JSP's.
|
||||
*
|
||||
* @return URL for top-level page as String
|
||||
*/
|
||||
// In old LegacyInitializer ROOT_PAGE_KEY = register/ (modif. to portal/nav)
|
||||
public static String getRootPageURL() {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Root is " + s_rootURL + ", url is " + s_rootPageURL);
|
||||
return s_rootPageURL;
|
||||
}
|
||||
|
||||
if ((s_rootURL == null) || (s_rootPageURL == null)) {
|
||||
return null;
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
return s_rootURL + s_rootPageURL;
|
||||
// return s_rootPageURL;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* It is relative to document root without any constant prefix if there is
|
||||
|
|
@ -196,168 +231,4 @@ public abstract class UI {
|
|||
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/
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
package com.arsdigita.ui;
|
||||
|
||||
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.parameter.StringParameter;
|
||||
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
|
||||
* (or entry page / home page) of the site, Without leading slash but with
|
||||
* trailing slash in case of a directory.
|
||||
* By default it is the login page, but usually the root page of the main
|
||||
* presentation application, e.g. portal, navigation, forum, etc. */
|
||||
// Old initializer: waf.pagemap.root
|
||||
private final Parameter m_rootPageURL = new StringParameter
|
||||
("core.ui.pagemap.root_page_url", Parameter.REQUIRED, "register/");
|
||||
* (or entry page / home page) of the site, Without leading slash but
|
||||
* with trailing slash in case of a directory.
|
||||
* By default it is the login page, but usually the root page of the
|
||||
* main presentation application, e.g. portal, navigation, forum, etc. */
|
||||
private final Parameter m_rootPageURL =
|
||||
new StringParameter("core.ui.pagemap.root_page_url",
|
||||
Parameter.REQUIRED, "/register/");
|
||||
|
||||
/** String containing the URL for a page which may perform a user specific
|
||||
* redirect if logged in or to a general public page if not. */
|
||||
// Used to be LOGIN_REDIRECT_PAGE_KEY in old kernel/security/initializer
|
||||
// parameter waf.pagemap.login_redirect = pvt/
|
||||
// XXX url pvt seems not to exist anymore! (pboy 2011-02-03)
|
||||
private final Parameter m_userRedirectURL = new StringParameter
|
||||
("core.ui.pagemap.user_redirect_url", Parameter.REQUIRED, "pvt/");
|
||||
/** String containing the URL of a page, a servlet or a jsp, to which a
|
||||
* user after login will be redirected to.
|
||||
* In case of a jsp or servlet it may contain user specific logic to
|
||||
* redirect to a page specific for the user or a group of users.
|
||||
* By default it is the /permissions/ page, but usually it is an
|
||||
* application like personal-portal or content-center. */
|
||||
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. */
|
||||
// Old initializer: waf.pagemap.workspace
|
||||
|
|
@ -237,16 +237,27 @@ public class UIConfig extends AbstractConfig {
|
|||
* @return root page url
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,12 +111,6 @@ public class LoginServlet extends BebopApplicationServlet {
|
|||
|
||||
// define
|
||||
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
|
||||
|
|
@ -127,9 +121,6 @@ public class LoginServlet extends BebopApplicationServlet {
|
|||
@Override
|
||||
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,
|
||||
// ie, /register, /register/explain-persistent-cookies,
|
||||
// /register/login-expired, /register/recover-password
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
|||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.bebop.parameters.URLParameter;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.kernel.KernelHelper;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.PersonName;
|
||||
import com.arsdigita.kernel.User;
|
||||
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
|
||||
// screen name, email address, or both. Check the results and
|
||||
// produce appropriate error messages.
|
||||
boolean checkPrimaryEmail = KernelHelper.emailIsPrimaryIdentifier();
|
||||
boolean checkPrimaryEmail = Kernel.getConfig().emailIsPrimaryIdentifier();
|
||||
|
||||
Filter filter = null;
|
||||
if (checkPrimaryEmail) {
|
||||
|
|
|
|||
|
|
@ -43,11 +43,9 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
|||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.bebop.parameters.URLParameter;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelHelper;
|
||||
import com.arsdigita.kernel.security.AccountNotFoundException;
|
||||
import com.arsdigita.kernel.security.Credential;
|
||||
import com.arsdigita.kernel.security.CredentialException;
|
||||
// import com.arsdigita.kernel.security.LegacyInitializer;
|
||||
import com.arsdigita.kernel.security.SecurityConfig;
|
||||
import com.arsdigita.kernel.security.UserContext;
|
||||
import com.arsdigita.ui.UI;
|
||||
|
|
@ -183,7 +181,7 @@ public class UserLoginForm extends Form
|
|||
LoginServlet.SUBSITE_NS_URI);
|
||||
|
||||
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
loginMessage.setClassAttr("email");
|
||||
} else {
|
||||
loginMessage.setClassAttr("screenName");
|
||||
|
|
@ -191,7 +189,7 @@ public class UserLoginForm extends Form
|
|||
|
||||
add(loginMessage);
|
||||
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
add(new Label(LoginHelper.getMessage(
|
||||
"login.userRegistrationForm.email")));
|
||||
m_loginName = new TextField(new EmailParameter(FORM_LOGIN));
|
||||
|
|
@ -297,7 +295,7 @@ public class UserLoginForm extends Form
|
|||
try {
|
||||
UserContext ctx = Web.getUserContext();
|
||||
String username = null;
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
username = ((InternetAddress) m_loginName.getValue(state)).
|
||||
getAddress();
|
||||
} else {
|
||||
|
|
@ -406,24 +404,23 @@ public class UserLoginForm extends Form
|
|||
|
||||
Object persistentLoginValue = m_isPersistent.getValue(state);
|
||||
|
||||
String[] values;
|
||||
String value;
|
||||
String value ;
|
||||
|
||||
if (persistentLoginValue == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
if (persistentLoginValue instanceof String[]) {
|
||||
values = (String[]) persistentLoginValue;
|
||||
return "1".equals(values[0]);
|
||||
value = ((String[])persistentLoginValue)[0];
|
||||
}
|
||||
|
||||
if (persistentLoginValue instanceof String) {
|
||||
else if (persistentLoginValue instanceof String) {
|
||||
value = (String) persistentLoginValue;
|
||||
return "1".equals(value);
|
||||
}
|
||||
else {
|
||||
value = "0";
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
return "1".equals(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import com.arsdigita.web.ReturnSignal;
|
|||
import com.arsdigita.kernel.EmailAddress;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.kernel.KernelHelper;
|
||||
import com.arsdigita.kernel.User;
|
||||
import com.arsdigita.kernel.UserAuthentication;
|
||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
|
|
@ -123,7 +122,7 @@ public class UserNewForm extends UserForm
|
|||
m_confirm.setValue(state, "");
|
||||
String loginName = (String)m_loginName.getValue(state);
|
||||
if (loginName != null) {
|
||||
if (KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
m_email.setValue(state, loginName);
|
||||
} else {
|
||||
m_screenName.setValue(state, loginName);
|
||||
|
|
@ -146,7 +145,7 @@ public class UserNewForm extends UserForm
|
|||
final String firstName = (String)m_firstName.getValue(state);
|
||||
final String lastName = (String)m_lastName.getValue(state);
|
||||
String sn = null;
|
||||
if (!KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
sn = (String)m_screenName.getValue(state);
|
||||
}
|
||||
final String screenName = sn;
|
||||
|
|
@ -167,7 +166,7 @@ public class UserNewForm extends UserForm
|
|||
user.getPersonName().setGivenName(firstName);
|
||||
user.getPersonName().setFamilyName(lastName);
|
||||
user.setPrimaryEmail(new EmailAddress(email));
|
||||
if (!KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
user.setScreenName(screenName);
|
||||
}
|
||||
user.setURI(urlFinal);
|
||||
|
|
@ -203,7 +202,7 @@ public class UserNewForm extends UserForm
|
|||
// finally log the user in (sets the
|
||||
// appropriate session or permanent cookie)
|
||||
String loginName = email;
|
||||
if (!KernelHelper.emailIsPrimaryIdentifier()) {
|
||||
if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||
loginName = screenName;
|
||||
}
|
||||
Web.getUserContext().login
|
||||
|
|
|
|||
|
|
@ -156,6 +156,10 @@ public class URL {
|
|||
|
||||
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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/scientificCMS-stylesheet-path
|
|||
|
||||
core.ui.pagemap.root_page_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
|
||||
waf.workflow.simple.alerts_enabled=true
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ waf.templating.stylesheet_paths=/WEB-INF/resources/scientificCMS-stylesheet-path
|
|||
|
||||
core.ui.pagemap.root_page_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
|
||||
waf.workflow.simple.alerts_enabled=true
|
||||
|
|
|
|||
Loading…
Reference in New Issue