=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2012-10-23 12:20:27 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2012-10-30 11:56:01 +0000 @@ -45,7 +45,7 @@ import org.hisp.dhis.api.webdomain.user.Dashboard; import org.hisp.dhis.api.webdomain.user.Inbox; import org.hisp.dhis.api.webdomain.user.Recipients; -import org.hisp.dhis.api.webdomain.user.Settings; +import org.hisp.dhis.api.webdomain.user.UserAccount; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.dxf2.utils.JacksonUtils; import org.hisp.dhis.interpretation.Interpretation; @@ -146,8 +146,8 @@ JacksonUtils.toJson( response.getOutputStream(), dashboard ); } - @RequestMapping( value = "/settings", produces = {"application/json", "text/*"} ) - public void getSettings( HttpServletResponse response ) throws Exception + @RequestMapping( value = "/user-account", produces = {"application/json", "text/*"} ) + public void getUserAccount( HttpServletResponse response ) throws Exception { User currentUser = currentUserService.getCurrentUser(); @@ -157,19 +157,19 @@ return; } - Settings settings = new Settings(); - settings.setFirstName( currentUser.getFirstName() ); - settings.setSurname( currentUser.getSurname() ); - settings.setEmail( currentUser.getEmail() ); - settings.setPhoneNumber( currentUser.getPhoneNumber() ); + UserAccount userAccount = new UserAccount(); + userAccount.setFirstName( currentUser.getFirstName() ); + userAccount.setSurname( currentUser.getSurname() ); + userAccount.setEmail( currentUser.getEmail() ); + userAccount.setPhoneNumber( currentUser.getPhoneNumber() ); - JacksonUtils.toJson( response.getOutputStream(), settings ); + JacksonUtils.toJson( response.getOutputStream(), userAccount ); } - @RequestMapping( value = "/settings", method = RequestMethod.POST, consumes = "application/xml" ) - public void postSettingsXml( HttpServletResponse response, HttpServletRequest request ) throws Exception + @RequestMapping( value = "/user-account", method = RequestMethod.POST, consumes = "application/xml" ) + public void postUserAccountXml( HttpServletResponse response, HttpServletRequest request ) throws Exception { - Settings settings = JacksonUtils.fromXml( request.getInputStream(), Settings.class ); + UserAccount userAccount = JacksonUtils.fromXml( request.getInputStream(), UserAccount.class ); User currentUser = currentUserService.getCurrentUser(); if ( currentUser == null ) @@ -178,18 +178,18 @@ return; } - currentUser.setFirstName( settings.getFirstName() ); - currentUser.setSurname( settings.getSurname() ); - currentUser.setEmail( settings.getEmail() ); - currentUser.setPhoneNumber( settings.getPhoneNumber() ); + currentUser.setFirstName( userAccount.getFirstName() ); + currentUser.setSurname( userAccount.getSurname() ); + currentUser.setEmail( userAccount.getEmail() ); + currentUser.setPhoneNumber( userAccount.getPhoneNumber() ); userService.updateUser( currentUser ); } - @RequestMapping( value = "/settings", method = RequestMethod.POST, consumes = "application/json" ) - public void postSettingsJson( HttpServletResponse response, HttpServletRequest request ) throws Exception + @RequestMapping( value = "/user-account", method = RequestMethod.POST, consumes = "application/json" ) + public void postUserAccountJson( HttpServletResponse response, HttpServletRequest request ) throws Exception { - Settings settings = JacksonUtils.fromJson( request.getInputStream(), Settings.class ); + UserAccount userAccount = JacksonUtils.fromJson( request.getInputStream(), UserAccount.class ); User currentUser = currentUserService.getCurrentUser(); if ( currentUser == null ) @@ -198,10 +198,10 @@ return; } - currentUser.setFirstName( settings.getFirstName() ); - currentUser.setSurname( settings.getSurname() ); - currentUser.setEmail( settings.getEmail() ); - currentUser.setPhoneNumber( settings.getPhoneNumber() ); + currentUser.setFirstName( userAccount.getFirstName() ); + currentUser.setSurname( userAccount.getSurname() ); + currentUser.setEmail( userAccount.getEmail() ); + currentUser.setPhoneNumber( userAccount.getPhoneNumber() ); userService.updateUser( currentUser ); } === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/Settings.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/Settings.java 2012-09-27 09:38:59 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/Settings.java 1970-01-01 00:00:00 +0000 @@ -1,115 +0,0 @@ -package org.hisp.dhis.api.webdomain.user; - -/* - * Copyright (c) 2004-2012, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.common.Dxf2Namespace; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; - -/** - * @author Morten Olav Hansen - */ -@JacksonXmlRootElement( localName = "settings", namespace = Dxf2Namespace.NAMESPACE ) -public class Settings -{ - private String firstName; - - private String surname; - - private String email; - - private String phoneNumber; - - private String jobTitle; - - public Settings() - { - } - - @JsonProperty(required = true) - @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) - public String getFirstName() - { - return firstName; - } - - public void setFirstName( String firstName ) - { - this.firstName = firstName; - } - - @JsonProperty(required = true) - @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) - public String getSurname() - { - return surname; - } - - public void setSurname( String surname ) - { - this.surname = surname; - } - - @JsonProperty - @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) - public String getEmail() - { - return email; - } - - public void setEmail( String email ) - { - this.email = email; - } - - @JsonProperty - @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) - public String getPhoneNumber() - { - return phoneNumber; - } - - public void setPhoneNumber( String phoneNumber ) - { - this.phoneNumber = phoneNumber; - } - - @JsonProperty - @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) - public String getJobTitle() - { - return jobTitle; - } - - public void setJobTitle( String jobTitle ) - { - this.jobTitle = jobTitle; - } -} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/UserAccount.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/UserAccount.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/user/UserAccount.java 2012-10-30 11:56:01 +0000 @@ -0,0 +1,101 @@ +package org.hisp.dhis.api.webdomain.user; + +/* + * Copyright (c) 2004-2012, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.hisp.dhis.common.Dxf2Namespace; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * @author Morten Olav Hansen + */ +@JacksonXmlRootElement( localName = "settings", namespace = Dxf2Namespace.NAMESPACE ) +public class UserAccount +{ + private String firstName; + + private String surname; + + private String email; + + private String phoneNumber; + + public UserAccount() + { + } + + @JsonProperty(required = true) + @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) + public String getFirstName() + { + return firstName; + } + + public void setFirstName( String firstName ) + { + this.firstName = firstName; + } + + @JsonProperty(required = true) + @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) + public String getSurname() + { + return surname; + } + + public void setSurname( String surname ) + { + this.surname = surname; + } + + @JsonProperty + @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) + public String getEmail() + { + return email; + } + + public void setEmail( String email ) + { + this.email = email; + } + + @JsonProperty + @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE) + public String getPhoneNumber() + { + return phoneNumber; + } + + public void setPhoneNumber( String phoneNumber ) + { + this.phoneNumber = phoneNumber; + } +} === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java' --- dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2012-10-22 09:18:33 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2012-10-30 11:56:01 +0000 @@ -105,11 +105,11 @@ return "base"; } - @RequestMapping( value = "/settings" ) + @RequestMapping( value = "/user-account" ) public String settings( Model model, HttpServletRequest request ) { model.addAttribute( "baseUrl", ContextUtils.getRootPath( request ) ); - model.addAttribute( "page", "settings.vm" ); + model.addAttribute( "page", "user-account.vm" ); return "base"; } === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2012-10-30 11:40:19 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2012-10-30 11:56:01 +0000 @@ -72,10 +72,10 @@ function updateMenu() { if( onlineStatus ) { $( '#messages').removeClass('ui-disabled'); - $( '#settings').removeClass('ui-disabled'); + $( '#user-account').removeClass('ui-disabled'); } else { $( '#messages').addClass('ui-disabled'); - $( '#settings').addClass('ui-disabled'); + $( '#user-account').addClass('ui-disabled'); } } @@ -132,7 +132,7 @@