=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java' --- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2013-03-19 14:50:43 +0000 +++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2013-03-20 04:29:27 +0000 @@ -275,7 +275,7 @@ return object; } - + @Override @SuppressWarnings("unchecked") public final T load( int id ) @@ -310,7 +310,7 @@ { return getObject( Restrictions.eq( "uid", uid ) ); } - + @Override @Deprecated public final T getByName( String name ) @@ -904,8 +904,8 @@ protected boolean sharingEnabled() { - return SharingUtils.isSupported( clazz ) && !( currentUserService.getCurrentUser() == null || - currentUserService.getCurrentUser().getUserCredentials().getAllAuthorities().contains( SharingUtils.SHARING_OVERRIDE_AUTHORITY ) ); + return SharingUtils.isSupported( clazz ) && !(currentUserService.getCurrentUser() == null || + currentUserService.getCurrentUser().getUserCredentials().getAllAuthorities().contains( SharingUtils.SHARING_OVERRIDE_AUTHORITY )); } protected boolean isReadAllowed( T object ) === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java 2012-02-28 18:56:37 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ExceptionInterceptor.java 2013-03-20 04:29:27 +0000 @@ -27,26 +27,25 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import static org.apache.commons.lang.StringUtils.defaultIfEmpty; +import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.interceptor.Interceptor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.InsufficientAuthenticationException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.authentication.InsufficientAuthenticationException; - -import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.interceptor.Interceptor; +import static org.apache.commons.lang.StringUtils.defaultIfEmpty; /** * This interceptor will intercept exceptions and redirect to appropriate - * exception results / pages defined in the global-results section in the XWork + * exception results / pages defined in the global-results section in the XWork * configuration. - * + * * @author Torgeir Lorange Ostby * @version $Id: WebWorkExceptionInterceptor.java 6335 2008-11-20 11:11:26Z larshelg $ */ @@ -58,7 +57,7 @@ public static final String EXCEPTION_RESULT_KEY = "onExceptionReturn"; public static final String EXCEPTION_RESULT_DEFAULT = "exceptionDefault"; public static final String EXCEPTION_RESULT_PLAIN_TEXT = "plainTextError"; - public static final String EXCEPTION_RESULT_ACCESS_DENIED = "accessDenied"; + public static final String EXCEPTION_RESULT_ACCESS_DENIED = "accessDenied"; public static final String EXCEPTION_RESULT_JSON_ACCESS_DENIED = "jsonAccessDenied"; public static final String TEMPLATE_KEY_EXCEPTION = "exception"; public static final String TEMPLATE_KEY_SHOW_STACK_TRACE = "showStackTrace"; @@ -73,7 +72,7 @@ { this.showStackTrace = showStackTrace; } - + private List ignoredExceptions = new ArrayList(); public void setIgnoredExceptions( List ignoredExceptions ) @@ -116,14 +115,14 @@ Map params = actionInvocation.getProxy().getConfig().getParams(); String exceptionResultName = (String) params.get( EXCEPTION_RESULT_KEY ); - + if ( e instanceof AccessDeniedException || e instanceof InsufficientAuthenticationException ) { if ( EXCEPTION_RESULT_PLAIN_TEXT.equals( exceptionResultName ) ) - { + { return EXCEPTION_RESULT_JSON_ACCESS_DENIED; // Access denied as JSON } - + return EXCEPTION_RESULT_ACCESS_DENIED; // Access denied as nice page } @@ -132,18 +131,19 @@ // ----------------------------------------------------------------- Throwable t = e; - + boolean ignore = false; - - checkIgnore : do + + checkIgnore: + do { if ( ignoredExceptions.contains( t.getClass().getName() ) ) { ignore = true; break checkIgnore; } - } - while ( ( t = t.getCause() ) != null ); + } + while ( (t = t.getCause()) != null ); // ----------------------------------------------------------------- // Log exception @@ -159,7 +159,7 @@ } exceptionResultName = defaultIfEmpty( exceptionResultName, EXCEPTION_RESULT_DEFAULT ); - + return ignore ? EXCEPTION_RESULT_PLAIN_TEXT : exceptionResultName; } } === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2013-02-22 11:39:14 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2013-03-20 04:29:27 +0000 @@ -12,7 +12,8 @@ - + dhis-web-maintenance-dataadmin @@ -43,7 +44,8 @@ - + page @@ -60,7 +62,8 @@ - + @@ -80,13 +83,15 @@ - + - + @@ -98,7 +103,8 @@ - + @@ -107,7 +113,8 @@ - + @@ -142,7 +149,8 @@ - @@ -155,7 +163,8 @@ - @@ -168,7 +177,8 @@ - @@ -217,7 +227,8 @@ - @@ -234,7 +245,8 @@ - @@ -248,7 +260,7 @@ - + @@ -257,7 +269,7 @@ - + @@ -278,16 +290,17 @@ + scope="prototype" /> - + - + @@ -317,7 +330,8 @@ scope="prototype"> - + @@ -340,7 +354,8 @@ - @@ -447,27 +462,32 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + @@ -524,7 +544,7 @@ - + @@ -532,14 +552,14 @@ - - + + - + @@ -552,22 +572,24 @@ - - - + scope="prototype" /> + + + + scope="prototype" /> - + + class="org.hisp.dhis.settings.user.action.GetGeneralSettingsAction" + scope="prototype"> @@ -576,8 +598,8 @@ + class="org.hisp.dhis.settings.user.action.SetGeneralSettingsAction" + scope="prototype"> === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2013-03-14 19:05:13 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2013-03-20 04:29:27 +0000 @@ -1,7 +1,7 @@ + "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" + "http://struts.apache.org/dtds/struts-2.0.dtd"> @@ -39,7 +39,7 @@ - + @@ -82,12 +82,12 @@ - + - + @@ -105,7 +105,7 @@ - + @@ -118,21 +118,21 @@ /dhis-web-commons/useraccount/account.vm login.action - + /dhis-web-commons/useraccount/recovery.vm login.action - + /dhis-web-commons/useraccount/restore.vm login.action - + - + - + @@ -311,13 +311,14 @@ - /dhis-web-commons/i18n/jsonTranslations.vm + /dhis-web-commons/i18n/jsonTranslations.vm + plainTextError /dhis-web-commons/i18n/i18n.vm - + @@ -462,20 +463,20 @@ - + - /dhis-web-commons/ajax/htmlNotifications.vm + /dhis-web-commons/ajax/htmlNotifications.vm plainTextError - + /dhis-web-commons/ajax/htmlUser.vm plainTextError - + @@ -484,7 +485,7 @@ - /dhis-web-commons/ajax/jsonNotifications.vm + /dhis-web-commons/ajax/jsonNotifications.vm plainTextError @@ -914,13 +915,14 @@ - /dhis-web-commons/ajax/jsonResponseSuccess.vm - plainTextError - - - - ${redirectUrl} - - + /dhis-web-commons/ajax/jsonResponseSuccess.vm + + plainTextError + + + + ${redirectUrl} + + === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2013-03-19 15:44:35 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2013-03-20 04:29:27 +0000 @@ -24,6 +24,8 @@ + + /dhis-web-light/main.vm