# HG changeset patch # User ymh # Date 1365376847 -7200 # Node ID 5b62100b8562a7557f78d1f7663361a37cc5c12b # Parent 554a7b55c29a28cdebcc82ff8226787862ea778a - replace simple http authentication by form auth - added nav bar in header diff -r 554a7b55c29a -r 5b62100b8562 server/pom.xml --- a/server/pom.xml Fri Apr 05 19:33:39 2013 +0200 +++ b/server/pom.xml Mon Apr 08 01:20:47 2013 +0200 @@ -4,7 +4,7 @@ 4.0.0 org.iri_research.renkan renkan - 0.6.1 + 0.6.2 war @@ -17,6 +17,7 @@ 8.1.10.v20130312 4.10 2.0.16 + 2.0.0 2.5.1 2.1.4 2.1 @@ -308,6 +309,11 @@ ${thymeleaf-version} + org.thymeleaf.extras + thymeleaf-extras-springsecurity3 + ${thymeleaf-springsecurity-version} + + net.sourceforge.nekohtml nekohtml 1.9.16 @@ -368,6 +374,16 @@ ${spring-security-version} + org.springframework.security + spring-security-acl + ${spring-security-version} + + + org.springframework.security + spring-security-taglibs + ${spring-security-version} + + de.undercouch bson4jackson 2.1.1 diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/java/org/iri_research/renkan/Constants.java --- a/server/src/main/java/org/iri_research/renkan/Constants.java Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/java/org/iri_research/renkan/Constants.java Mon Apr 08 01:20:47 2013 +0200 @@ -20,7 +20,7 @@ { add("0"); add("6"); - add("1"); + add("2"); add("final"); add("0"); } diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/java/org/iri_research/renkan/controller/AdminController.java --- a/server/src/main/java/org/iri_research/renkan/controller/AdminController.java Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/java/org/iri_research/renkan/controller/AdminController.java Mon Apr 08 01:20:47 2013 +0200 @@ -42,7 +42,6 @@ private final Logger logger = LoggerFactory.getLogger(AdminController.class); - @Autowired private SpacesRepository spacesRepository; @Autowired diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/java/org/iri_research/renkan/controller/AuthController.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/main/java/org/iri_research/renkan/controller/AuthController.java Mon Apr 08 01:20:47 2013 +0200 @@ -0,0 +1,30 @@ +package org.iri_research.renkan.controller; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +@RequestMapping("/auth") +public class AuthController { + + @SuppressWarnings("unused") + private final Logger logger = LoggerFactory.getLogger(AuthController.class); + + @RequestMapping(value="/login", method = RequestMethod.GET, produces={"text/html;charset=UTF-8"}) + public String login() { + return "auth/login"; + } + + @RequestMapping(value="/loginfailed", method = RequestMethod.GET, produces={"text/html;charset=UTF-8"}) + public String loginFailed(Model model) { + + model.addAttribute("login_error", true); + return "auth/login"; + } + + +} diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/java/org/iri_research/renkan/utils/RenkanLogger.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/main/java/org/iri_research/renkan/utils/RenkanLogger.java Mon Apr 08 01:20:47 2013 +0200 @@ -0,0 +1,15 @@ +package org.iri_research.renkan.utils; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(RUNTIME) +@Target(FIELD) +@Documented +public @interface RenkanLogger { + +} diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/java/org/iri_research/renkan/utils/RenkanLoggerInjector.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/main/java/org/iri_research/renkan/utils/RenkanLoggerInjector.java Mon Apr 08 01:20:47 2013 +0200 @@ -0,0 +1,39 @@ +package org.iri_research.renkan.utils; + +import java.lang.reflect.Field; + +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.stereotype.Component; +import org.springframework.util.ReflectionUtils; + +import static org.springframework.util.ReflectionUtils.FieldCallback; + +@Component +public class RenkanLoggerInjector implements BeanPostProcessor { + + @Override + public Object postProcessBeforeInitialization(final Object bean, + String beanName) throws BeansException { + ReflectionUtils.doWithFields(bean.getClass(), new FieldCallback() { + public void doWith(Field field) throws IllegalArgumentException, + IllegalAccessException { + // make the field accessible if defined private + ReflectionUtils.makeAccessible(field); + if (field.getAnnotation(RenkanLogger.class) != null) { + org.slf4j.Logger logger = LoggerFactory.getLogger(bean + .getClass()); + field.set(bean, logger); + } + } + }); + return bean; + } + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) + throws BeansException { + return bean; + } +} \ No newline at end of file diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/applicationContext.xml --- a/server/src/main/webapp/WEB-INF/applicationContext.xml Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/applicationContext.xml Mon Apr 08 01:20:47 2013 +0200 @@ -54,6 +54,7 @@ + + + + + WEB-INF/i18n/messages + classpath:org/springframework/security/messages + + + + + + diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/i18n/messages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/main/webapp/WEB-INF/i18n/messages.properties Mon Apr 08 01:20:47 2013 +0200 @@ -0,0 +1,82 @@ + +date.format = yyyy/MM/dd HH:mm +question.yes = yes +question.no = no + +renkanIndex.renkan_exp = Create a Renkan +renkanIndex.project_list = Renkan list +renkanIndex.project_name = Name +renkanIndex.project_creation = Creation +renkanIndex.project_updated = Updated +renkanIndex.project_edit = Edit +renkanIndex.project_copy = Copy +renkanIndex.project_delete = Delete +renkanIndex.project_render = View +renkanIndex.project_edit_link = Edit renkan +renkanIndex.project_copy_link = Copy renkan +renkanIndex.project_delete_link = Delete renkan +renkanIndex.project_render_link = View renkan +renkanIndex.project_delete_confirm = Delete renkan "<%= title %>" ? +renkanIndex.project_filter = Filter title + +renkanIndex.space_exp = Create a space +renkanIndex.renkan_spaces = Renkan Spaces +renkanIndex.renkan_space = Renkan Space +renkanIndex.space_list = Space list +renkanIndex.space_name = Name +renkanIndex.space_title = Title +renkanIndex.space_creation = Creation date +renkanIndex.space_open = Open +renkanIndex.space_open_link = Open space +renkanIndex.space_proj_count = Renkan count + + +renkanIndex.js.empty_name_error = Please enter a title + +renkanAdmin.renkan_admin = Renkan administration +renkanAdmin.site_admin = Site administration + +renkanAdmin.object = Object +renkanAdmin.object_list = {0} list + +renkanAdmin.space_objects_name = Spaces +renkanAdmin.space_object_name = Spaces + +renkanAdmin.space_add = Add space +renkanAdmin.space_edit = Edit space +renkanAdmin.space_delete = Delete space +renkanIndex.space_url = Url +renkanAdmin.space_confirm_delete = Do you want to delete the space entitled "{0}" ? + +renkanAdmin.object_name = Name +renkanAdmin.object_edit = Edit +renkanAdmin.object_delete = Delete +renkanAdmin.object_edit_link = Edit +renkanAdmin.object_delete_link = Del. + +renkanAdmin.form.title = Title +renkanAdmin.form.uri = URI +renkanAdmin.form.description = Description +renkanAdmin.form.color = Color +renkanAdmin.form.space.bin_config = Bin config +renkanAdmin.form.space.submit = Ok +renkanAdmin.form.space.cancel = Cancel +renkanAdmin.form.space.format = Format +renkanAdmin.form.space.compact = Compact + +renkan.error.title.empty = Title must not be empty or null +renkan.error.bin_config.json = bin config field must contain a valid json + +renkanAuth.log_in = Log in +renkanAuth.username_label = Username: +renkanAuth.password_label = Password: +renkanAuth.renkan_login = Renkan Authentication +renkanAdmin.site_login = Site Authentication +renkanAuth.login_error_message = Your login attempt was not successful, try again. +renkanAuth.login_error_cause = Cause: + +renkanHeader.login = login +renkanHeader.logout = logout +renkanHeader.admin = admin +renkanHeader.home = home + diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/i18n/messages_en.properties --- a/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Mon Apr 08 01:20:47 2013 +0200 @@ -66,3 +66,16 @@ renkan.error.title.empty = Title must not be empty or null renkan.error.bin_config.json = bin config field must contain a valid json + +renkanAuth.log_in = Log in +renkanAuth.username_label = Username: +renkanAuth.password_label = Password: +renkanAuth.renkan_login = Renkan Authentication +renkanAdmin.site_login = Site Authentication +renkanAuth.login_error_message = Your login attempt was not successful, try again. +renkanAuth.login_error_cause = Cause: + +renkanHeader.login = login +renkanHeader.logout = logout +renkanHeader.admin = admin +renkanHeader.home = home diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/i18n/messages_fr.properties --- a/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties Mon Apr 08 01:20:47 2013 +0200 @@ -33,6 +33,7 @@ renkanIndex.js.empty_name_error = Veuillez entrer un titre + renkanAdmin.renkan_admin = Administration Renkan renkanAdmin.site_admin = Administration site @@ -63,4 +64,17 @@ renkanAdmin.form.space.compact = Compacter renkan.error.title.empty = Le champ titre ne doit pas être vide -renkan.error.bin_config.json = le champ bin config doit contenir un json valide \ No newline at end of file +renkan.error.bin_config.json = le champ bin config doit contenir un json valide + +renkanAuth.log_in = Connection +renkanAuth.username = Identifiant : +renkanAuth.password = Mot de passe : +renkanAuth.renkan_login = Renkan Authentification +renkanAdmin.site_login = Site Authentification +renkanAuth.login_error_message = Votre tentative de connexion a échoué, veuillez recommencer. +renkanAuth.login_error_cause = Raison : + +renkanHeader.login = connexion +renkanHeader.logout = déconnexion +renkanHeader.admin = administration +renkanHeader.home = accueil diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/spring-security.xml --- a/server/src/main/webapp/WEB-INF/spring-security.xml Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/spring-security.xml Mon Apr 08 01:20:47 2013 +0200 @@ -29,10 +29,11 @@ - - - - + + + + + diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/spring-servlet.xml --- a/server/src/main/webapp/WEB-INF/spring-servlet.xml Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/spring-servlet.xml Mon Apr 08 01:20:47 2013 +0200 @@ -53,6 +53,11 @@ + + + + + @@ -63,10 +68,5 @@ - - - - - \ No newline at end of file diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/admin/adminIndex.html --- a/server/src/main/webapp/WEB-INF/templates/admin/adminIndex.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/admin/adminIndex.html Mon Apr 08 01:20:47 2013 +0200 @@ -16,8 +16,10 @@
-
-

Renkan administration

+
+

Site administration

diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/admin/spaceDeleteConfirm.html --- a/server/src/main/webapp/WEB-INF/templates/admin/spaceDeleteConfirm.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/admin/spaceDeleteConfirm.html Mon Apr 08 01:20:47 2013 +0200 @@ -17,7 +17,10 @@
-

Renkan administration

+

Spaces List / Delete space

Do you want to delete space with title
diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/admin/spaceEdit.html --- a/server/src/main/webapp/WEB-INF/templates/admin/spaceEdit.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/admin/spaceEdit.html Mon Apr 08 01:20:47 2013 +0200 @@ -21,9 +21,12 @@
-

Renkan administration

+

Spaces List / Edit space

-
+
diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/admin/spacesList.html --- a/server/src/main/webapp/WEB-INF/templates/admin/spacesList.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/admin/spacesList.html Mon Apr 08 01:20:47 2013 +0200 @@ -17,7 +17,10 @@
-

Renkan administration

+

List of objects

diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/auth/login.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/main/webapp/WEB-INF/templates/auth/login.html Mon Apr 08 01:20:47 2013 +0200 @@ -0,0 +1,50 @@ + + + + Renkan Auth Login + + + + + + + + + + + + + +
+
+ +

Site login

+
+
+
Your login attempt was not successful, try again.
+
Cause:  Cause of login error
+
+
+
+
+ + +
+
+ + +
+ +
+ +
+
+
+
© 2013 IRI - Version 0.0
+
+
+ + \ No newline at end of file diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/fragment/pageFragment.html --- a/server/src/main/webapp/WEB-INF/templates/fragment/pageFragment.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/fragment/pageFragment.html Mon Apr 08 01:20:47 2013 +0200 @@ -1,11 +1,25 @@ + xmlns:th="http://www.thymeleaf.org" + xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"> pagination fragment +
© 2013 IRI - Version 0.0a
diff -r 554a7b55c29a -r 5b62100b8562 server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html --- a/server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html Fri Apr 05 19:33:39 2013 +0200 +++ b/server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html Mon Apr 08 01:20:47 2013 +0200 @@ -1,10 +1,9 @@ - - - -Space form - + + + + Space form +