parent
f13dd4b4ec
commit
3e6ccdb5c5
|
|
@ -30,6 +30,9 @@ public interface LoginConstants {
|
||||||
|
|
||||||
public static final String LOGIN_BUNDLE
|
public static final String LOGIN_BUNDLE
|
||||||
= "com.arsdigita.ui.login.LoginResources";
|
= "com.arsdigita.ui.login.LoginResources";
|
||||||
|
|
||||||
|
public static final String LOGIN_UI_BUNDLE
|
||||||
|
= "org.libreccm.ui.LoginBundle";
|
||||||
|
|
||||||
public static final GlobalizedMessage SUBMIT = LoginHelper.getMessage(
|
public static final GlobalizedMessage SUBMIT = LoginHelper.getMessage(
|
||||||
"login.submit");
|
"login.submit");
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import org.eclipse.krazo.ext.freemarker.DefaultConfigurationProducer;
|
||||||
import org.libreccm.theming.Themes;
|
import org.libreccm.theming.Themes;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
|
import javax.enterprise.inject.Alternative;
|
||||||
import javax.enterprise.inject.Specializes;
|
import javax.enterprise.inject.Specializes;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
|
@ -41,6 +42,8 @@ import javax.ws.rs.Produces;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
|
@Alternative
|
||||||
|
@Specializes
|
||||||
public class MvcFreemarkerConfigurationProducer
|
public class MvcFreemarkerConfigurationProducer
|
||||||
extends DefaultConfigurationProducer {
|
extends DefaultConfigurationProducer {
|
||||||
|
|
||||||
|
|
@ -52,6 +55,7 @@ public class MvcFreemarkerConfigurationProducer
|
||||||
|
|
||||||
@Produces
|
@Produces
|
||||||
@ViewEngineConfig
|
@ViewEngineConfig
|
||||||
|
@Alternative
|
||||||
@Specializes
|
@Specializes
|
||||||
@Override
|
@Override
|
||||||
public Configuration getConfiguration() {
|
public Configuration getConfiguration() {
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,7 @@ public class ThemeManifest implements Serializable {
|
||||||
@XmlElement(name = "default-template", namespace = THEMES_XML_NS)
|
@XmlElement(name = "default-template", namespace = THEMES_XML_NS)
|
||||||
private String defaultTemplate;
|
private String defaultTemplate;
|
||||||
|
|
||||||
@XmlElementWrapper(name = "mvcTemplates", namespace = THEMES_XML_NS)
|
@XmlElement(name = "mvc-templates", namespace = THEMES_XML_NS)
|
||||||
@XmlElement(name = "template", namespace = THEME_MANIFEST_XML)
|
|
||||||
private Map<String, Map<String, ThemeTemplate>> mvcTemplates;
|
private Map<String, Map<String, ThemeTemplate>> mvcTemplates;
|
||||||
|
|
||||||
public ThemeManifest() {
|
public ThemeManifest() {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public class ThemesMvc {
|
||||||
|
|
||||||
return String.format(
|
return String.format(
|
||||||
"@themes/%s/%s/%s",
|
"@themes/%s/%s/%s",
|
||||||
theme,
|
themeInfo.getName(),
|
||||||
Objects.toString(themeVersion),
|
Objects.toString(themeVersion),
|
||||||
themeTemplate.getPath()
|
themeTemplate.getPath()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class LoginMessages extends AbstractMap<String, String>{
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
private void init() {
|
private void init() {
|
||||||
messages = ResourceBundle.getBundle(
|
messages = ResourceBundle.getBundle(
|
||||||
LoginConstants.LOGIN_BUNDLE,
|
LoginConstants.LOGIN_UI_BUNDLE,
|
||||||
globalizationHelper.getNegotiatedLocale()
|
globalizationHelper.getNegotiatedLocale()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@
|
||||||
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
|
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
|
||||||
bean-discovery-mode="all">
|
bean-discovery-mode="all">
|
||||||
|
|
||||||
|
<alternatives>
|
||||||
|
<class>org.libreccm.mvc.freemarker.MvcFreemarkerConfigurationProducer</class>
|
||||||
|
</alternatives>
|
||||||
|
|
||||||
<interceptors>
|
<interceptors>
|
||||||
<class>org.libreccm.security.AuthorizationInterceptor</class>
|
<class>org.libreccm.security.AuthorizationInterceptor</class>
|
||||||
</interceptors>
|
</interceptors>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
login.submit=Login
|
||||||
|
login.primaryEmail=Email Address
|
||||||
|
login.screenname.label=User name
|
||||||
|
login.password.label=Password
|
||||||
|
login.screenname.help=Your user name
|
||||||
|
login.password.help=Your password
|
||||||
|
login.errors.failed=Login failed. Wrong username or password.
|
||||||
|
login.errors.failedToSendRecoverMessage=Failed to send password recover message.
|
||||||
|
login.title=Login
|
||||||
|
login.recover_password.title=Recover password
|
||||||
|
login.recover_password.submit=Recover password
|
||||||
|
login.password_recovered.title=Recover mail send
|
||||||
|
login.password_recovered.message=An email with instructions how to reset your password has been sent.
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
login.submit=Anmelden
|
||||||
|
login.primaryEmail=E-Mail-Addresse
|
||||||
|
login.screenname.label=Benutzername
|
||||||
|
login.password.label=Passwort
|
||||||
|
login.screenname.help=Ihr Benutzername
|
||||||
|
login.password.help=Ihr Passwort
|
||||||
|
login.errors.failed=Anmeldung fehlgeschlagen. Falscher Benutzername oder falsches Passwort.
|
||||||
|
login.errors.failedToSendRecoverMessage=Senden der Wiederherstellungsmail fehlgeschlagen.
|
||||||
|
login.title=Login
|
||||||
|
login.recover_password.title=Passwort zur\u00fccksetzen
|
||||||
|
login.recover_password.submit=Passwort zur\u00fccksetzen
|
||||||
|
login.password_recovered.title=Mail gesendet
|
||||||
|
login.password_recovered.message=Eine E-Mail mit Anweisungen zum Zur\u00fccksetzen Ihres Passworts wurde an Ihre E-Mail-Adresse geschickt.
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Category page</title>
|
||||||
|
<link rel="stylesheet" href="${getContextPath()}/theming/ccm/style.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<h1>${LoginMessages['login.title']}</h1>
|
||||||
|
<# if (loginFailed)>
|
||||||
|
<div class="alert-error">
|
||||||
|
${LoginMessages['login.errors.failed']}
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
<form action="${mvc.url('LoginController#processLogin')}"
|
||||||
|
method="post">
|
||||||
|
<label for="login">${LoginMessages['login.screenname.label']}</label>
|
||||||
|
<input id="login" name="login" required="true" type="text" />
|
||||||
|
|
||||||
|
<label for="password">
|
||||||
|
${LoginMessages['login.password.label']}
|
||||||
|
</label>
|
||||||
|
<input id="password"
|
||||||
|
name="password"
|
||||||
|
required="true"
|
||||||
|
type="password" />
|
||||||
|
|
||||||
|
<button type="submit">
|
||||||
|
${LoginMessages['login.submit']}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
<#include "footer.html.ftl">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Category page</title>
|
||||||
|
<link rel="stylesheet" href="${getContextPath()}/theming/ccm/style.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<h1>${LoginMessages['login.password_recovered.title']}</h1>
|
||||||
|
<p>${LoginMessages['login.password_recovered.message']}</p>
|
||||||
|
</main>
|
||||||
|
<#include "footer.html.ftl">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Category page</title>
|
||||||
|
<link rel="stylesheet" href="${getContextPath()}/theming/ccm/style.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<h1>${LoginMessages['login.recover_password.title']}</h1>
|
||||||
|
<# if (failedToSendRecoverMessage)>
|
||||||
|
<div class="alert-error">
|
||||||
|
${LoginMessages['login.errors.failedToSendRecoverMessage']}
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
<form action="${mvc.url('LoginController#recoverPassword')}"
|
||||||
|
method="post">
|
||||||
|
<label for="email">${LoginMessages['login.email.label']}</label>
|
||||||
|
<input id="email" name="email" required="true" type="text" />
|
||||||
|
|
||||||
|
<button type="submit">
|
||||||
|
${LoginMessages['login.recover_password.submit']}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
<#include "footer.html.ftl">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,6 +1,84 @@
|
||||||
{
|
{
|
||||||
"name": "ccm-freemarker",
|
"name": "ccm-freemarker",
|
||||||
"type": "freemarker",
|
"type": "freemarker",
|
||||||
|
|
||||||
"default-template": "category-page.html.ftl"
|
"default-template": "category-page.html.ftl",
|
||||||
|
|
||||||
|
"mvc-templates": {
|
||||||
|
"applications": {
|
||||||
|
"login-form": {
|
||||||
|
"description": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Login Form"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "Login Form",
|
||||||
|
"path": "login/login-form.html.ftl",
|
||||||
|
"title": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Login Form"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"login-recover-password": {
|
||||||
|
"description": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Recover lost passwords"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "login-recover-password",
|
||||||
|
"path": "login/login-recover-password.html.ftl",
|
||||||
|
"title": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Recover password"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"login-password-recovered": {
|
||||||
|
"description": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Password recovered"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "login-password-recovered",
|
||||||
|
"path": "login/login-password-recovered.html.ftl",
|
||||||
|
"title": {
|
||||||
|
"values": {
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"lang": "en",
|
||||||
|
"value": "Password recovered"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue