[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15643: Fixed bug - Under the tracked Instance dashboard, the messages button doesnt load for viewing sen...
revno: 15643 committer: Tran Chau branch nick: dhis2 timestamp: Thu 2014-06-12 15:02:29 +0800 message: Fixed bug - Under the tracked Instance dashboard, the messages button doesnt load for viewing sent messages and sending messages; the Reports dont load for viewing and download. modified: dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm 2014-02-07 20:25:49 + +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm 2014-06-12 07:02:29 + @@ -8,7 +8,7 @@ - $i18n.getString( "date" ) + $i18n.getString( "date" ) $i18n.getString( "program_stage" ) $i18n.getString( "sender" ) $i18n.getString( "type" ) @@ -117,7 +117,8 @@ var i18n_confirmation_delete_message = '$encoder.jsEscape( $i18n.getString( "confirmation_delete_message" ) , "'" )'; var i18n_deleting = '$encoder.jsEscape( $i18n.getString( "deleting" ) , "'" )'; commentDivToggle(true); - tableSorter( 'messageList' ); - var sorting = [[0,1]]; - $("#messageList").trigger("sorton", [sorting]); + $("#messageList").tablesorter({ + sortList: [[0,1]] + }); + \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-05-29 15:19:07 + +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-06-12 07:02:29 + @@ -184,17 +184,17 @@ $('#tabs').tabs(); - $( "#tabs" ).bind( "tabsselect", function(event, ui) { - if( ui.tab.hash == '#tab-3' ){ + $("#tabs").tabs().on('tabsactivate', function (event, ui) { + if( ui.newPanel.selector == '#tab-3' ){ getVisitSchedule(getFieldValue('programInstanceId')); } - else if( ui.tab.hash == '#tab-5' ){ + else if( ui.newPanel.selector == '#tab-5' ){ programReports(getFieldValue('programInstanceUid')); } - else if( ui.tab.hash == '#tab-4' ){ + else if( ui.newPanel.selector == '#tab-4' ){ getEventMessages(getFieldValue('programInstanceId')); } - }); + }); showById('toogleRiskStatusTD'); jQuery('#tb_$!programInstance.id').css('margin-top',-25); ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Exporting and Importing Individual Records program Meta data
Hi Prosper, That’s right. No meta data export for programs (yet). Hope this will change soon. Regards, Busoye On 12 Jun 2014, at 07:27, Prosper BT wrote: > Hi Team, > > I have designed a multiple stage program with registration but seems I can > only export and import data elements only not attributes and the program > itself. > > Is this right or am missing something. > > Regards > > -- > Prosper Behumbiize, MPH > Phone:+256 414 320076 > Cell: +256 772 139037 > +256 752 751776 > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Bug in Messages and Reports on the Tracked Instance Dashboard
Hi Prosper, This bug is fixed in revision 15142. Please take a look at it. Thank you for reporting this bug. Best regards, Châu Thu Trân HISP Viet Nam Email: tran.hispviet...@gmail.com On Sun, May 25, 2014 at 4:51 PM, Prosper BT wrote: > Dear Abyot and Development Team, > > With 2.15 build 15072 > > Under the tracked Instance dashboard, the messages button doesnt load for > viewing sent messages and sending messages. > > Also the Reports dont load for viewing and download > > Regards > > -- > Prosper Behumbiize, MPH > Phone:+256 414 320076 > Cell: +256 772 139037 > +256 752 751776 > > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Exporting and Importing Individual Records program Meta data
Import/export of tracker metadata is coming to 2.16 On Jun 12, 2014 9:13 AM, "Adebusoye Anifalaje" wrote: > Hi Prosper, > > That’s right. No meta data export for programs (yet). > > Hope this will change soon. > > Regards, > > Busoye > > > On 12 Jun 2014, at 07:27, Prosper BT wrote: > > > Hi Team, > > > > I have designed a multiple stage program with registration but seems I > can only export and import data elements only not attributes and the > program itself. > > > > Is this right or am missing something. > > > > Regards > > > > -- > > Prosper Behumbiize, MPH > > Phone:+256 414 320076 > > Cell: +256 772 139037 > > +256 752 751776 > > > > ___ > > Mailing list: https://launchpad.net/~dhis2-devs > > Post to : dhis2-devs@lists.launchpad.net > > Unsubscribe : https://launchpad.net/~dhis2-devs > > More help : https://help.launchpad.net/ListHelp > > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] Importing OrgUnit data via API using curl
Hi Team, I am importing org unit data via the api using curl, on running the script, this is the error I am getting. Anyone who has done this before and has an idea what could be wrong ? I am doing this on DHIS 2.13 -- Apache Tomcat/7.0.42 - Error report HTTP Status 500 - com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' (code 49) in prolog; expected '<'type Exception reportmessage com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' (code 49) in prolog; expected '<'description The server encountered an internal error that prevented it from fulfilling this request.exception java.io.IOException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' (code 49) in prolog; expected '<' at [row,col {unknown-source}]: [1,46] com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwXmlAsIOException(StaxUtil.java:24) com.fasterxml.jackson.dataformat.xml.XmlFactory._createJsonParser(XmlFactory.java:360) com.fasterxml.jackson.dataformat.xml.XmlFactory._createJsonParser(XmlFactory.java:27) com.fasterxml.jackson.core.JsonFactory.createJsonParser(JsonFactory.java:558) com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856) org.hisp.dhis.dxf2.utils.JacksonUtils.fromXml(JacksonUtils.java:202) org.hisp.dhis.api.controller.MetaDataController.importXml(MetaDataController.java:228) org.hisp.dhis.api.controller.MetaDataController$$FastClassByCGLIB$$6089c6af.invoke() org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) org.hisp.dhis.api.controller.MetaDataController$$EnhancerByCGLIB$$c31baab2.importXml( ) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:647) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) org.springframework.sec
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15644: (Translations) Seeding Bengali locale for translations server.
revno: 15644 committer: Jason Pickering branch nick: dhis2 timestamp: Thu 2014-06-12 03:37:57 -0400 message: (Translations) Seeding Bengali locale for translations server. added: dhis-2/dhis-services/dhis-service-i18n/src/main/resources/i18n_global_bn.properties -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === added file 'dhis-2/dhis-services/dhis-service-i18n/src/main/resources/i18n_global_bn.properties' --- dhis-2/dhis-services/dhis-service-i18n/src/main/resources/i18n_global_bn.properties 1970-01-01 00:00:00 + +++ dhis-2/dhis-services/dhis-service-i18n/src/main/resources/i18n_global_bn.properties 2014-06-12 07:37:57 + @@ -0,0 +1,4 @@ +#-- Application name ---# + +district_health_information_software=District Health Information Software 2 +dhis2=DHIS 2 ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Importing OrgUnit data via API using curl
Did you set the content-type header? it's either that, or something is wrong with your data -- Morten On Thu, Jun 12, 2014 at 9:37 AM, David Muturi wrote: > Hi Team, > I am importing org unit data via the api using curl, on running the > script, this is the error I am getting. Anyone who has done this before and > has an idea what could be wrong ? I am doing this on DHIS 2.13 > > -- > Apache Tomcat/7.0.42 - Error > report > HTTP Status 500 - > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' > (code 49) in prolog; expected '<' noshade="noshade">type Exception reportmessage > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' > (code 49) in prolog; expected '<'description The > server encountered an internal error that prevented it from fulfilling this > request.exception java.io.IOException: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' > (code 49) in prolog; expected '<' > at [row,col {unknown-source}]: [1,46] > > com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwXmlAsIOException(StaxUtil.java:24) > > com.fasterxml.jackson.dataformat.xml.XmlFactory._createJsonParser(XmlFactory.java:360) > > com.fasterxml.jackson.dataformat.xml.XmlFactory._createJsonParser(XmlFactory.java:27) > > com.fasterxml.jackson.core.JsonFactory.createJsonParser(JsonFactory.java:558) > > com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856) > > org.hisp.dhis.dxf2.utils.JacksonUtils.fromXml(JacksonUtils.java:202) > > org.hisp.dhis.api.controller.MetaDataController.importXml(MetaDataController.java:228) > > org.hisp.dhis.api.controller.MetaDataController$$FastClassByCGLIB$$6089c6af.invoke() > > org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) > > org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) > > org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) > > org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) > > org.hisp.dhis.api.controller.MetaDataController$$EnhancerByCGLIB$$c31baab2.importXml( ) > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > java.lang.reflect.Method.invoke(Method.java:606) > > org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) > > org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) > > org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) > > org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) > > org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) > > org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) > > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) > > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) > > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) > > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) > javax.servlet.http.HttpServlet.service(HttpServlet.java:647) > > org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) > javax.servlet.http.HttpServlet.service(HttpServlet.java:728) > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > > org.springframework.security.web.access.in
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15645: minor update of jsonpath (0.9.0 => 0.9.1)
revno: 15645 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 09:52:53 +0200 message: minor update of jsonpath (0.9.0 => 0.9.1) modified: dhis-2/pom.xml -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/pom.xml' --- dhis-2/pom.xml 2014-05-22 13:51:07 + +++ dhis-2/pom.xml 2014-06-12 07:52:53 + @@ -973,7 +973,7 @@ com.jayway.jsonpath json-path -0.9.0 +0.9.1 test ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] Need to pass credentials from external site
Dear All, I have several DHIS application from different server. I have developed a page which contains all the credential information about those applications. I want the DHIS application logged on after clicking the link. But it always redirect me to login page of DHIS. My code snippet is: $(document).ready(function () { $("#link1").click(function () { $.post("http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, { j_username: "admin", j_password: "district" }); window.open("http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action";); }); }); please help. Md Monjur Rahman Senior Computer Programmer, Center for Equity & Health System, icdd,b, Mohakhali, Dhaka, Bangladesh. ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Need to pass credentials from external site
Hi, i test this on our demo server (http://apps.dhis2.org/dev) and this works fine: $.post('/dev/dhis-web-commons-security/login.action?authOnly=true', { j_username: "admin", j_password: "district" }) Is the request coming from the same server? remember that x-domain auth is not supported by default -- Morten On Thu, Jun 12, 2014 at 10:22 AM, Md. Monjur Rahman wrote: > Dear All, > I have several DHIS application from different server. I have developed a > page which contains all the credential information about those applications. > I want the DHIS application logged on after clicking the link. But it > always redirect me to login page of DHIS. My code snippet is: > > $(document).ready(function () { > $("#link1").click(function () { > $.post(" > http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, > { j_username: "admin", j_password: "district" }); > window.open(" > http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action > "); > }); > }); > > please help. > > Md Monjur Rahman > Senior Computer Programmer, > Center for Equity & Health System, > icdd,b, Mohakhali, Dhaka, Bangladesh. > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] Issues importing ProgramStageSection
Hello All, We were trying to create "Program", "Program Stage" and "Program Stage Section" using "/metadata" api. We are facing issues creating "Program Stage Section". *Status : 409 Conflict* When we tried debugging the issue, we got some ClassCastExceptions for "List to Set" and "Set to List" in "extractProgramStageDataElements" and "saveProgramStageDataElements" methods in "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". We tried fixing it, and we got some more exceptions (Constraint Violation Exception) *Input to the api "/metadata"*: { "programStageSections": [ { "name": "SomeName", "programStageDataElements": [ { "allowDateInFuture": false, "allowProvidedElsewhere": false, "compulsory": false, "dataElement": { "id": "DataElementId", "name": "DataElementName" }, "displayInReports": false } ], "sortOrder": 1 } ] } Can you please have a look onto this and fix it if needed. -- Thanks, Mansi Singhal ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
Hi, The tracker metadata web-api should still be considered wip (it's new for 2.16). I haven't tested with programStageSections at all. I will have a look at it. -- Morten On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal wrote: > Hello All, > > We were trying to create "Program", "Program Stage" and "Program Stage > Section" using "/metadata" api. > > We are facing issues creating "Program Stage Section". > *Status : 409 Conflict* > > When we tried debugging the issue, we got some ClassCastExceptions for > "List to Set" and "Set to List" in "extractProgramStageDataElements" and > "saveProgramStageDataElements" methods in > "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". > > We tried fixing it, and we got some more exceptions (Constraint Violation > Exception) > > *Input to the api "/metadata"*: > > { > "programStageSections": [ > { > "name": "SomeName", > "programStageDataElements": [ > { > "allowDateInFuture": false, > "allowProvidedElsewhere": false, > "compulsory": false, > "dataElement": { > "id": "DataElementId", > "name": "DataElementName" > }, > "displayInReports": false > } > ], > "sortOrder": 1 > } > ] > } > > Can you please have a look onto this and fix it if needed. > > > > -- > Thanks, > Mansi Singhal > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15646: minor fix, change to List for programStageDataElements
revno: 15646 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 11:11:27 +0200 message: minor fix, change to List for programStageDataElements modified: dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java dhis-2/pom.xml -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-05-31 07:39:57 + +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-06-12 09:11:27 + @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.apache.commons.logging.Log; @@ -124,7 +125,7 @@ @Autowired private SchemaService schemaService; -@Autowired( required = false ) +@Autowired(required = false) private List> objectHandlers; //--- @@ -154,12 +155,12 @@ private Expression leftSide; private Expression rightSide; +private DataEntryForm dataEntryForm; + private Set compulsoryDataElementOperands = Sets.newHashSet(); private Set greyedFields = Sets.newHashSet(); -private DataEntryForm dataEntryForm; - -private Set programStageDataElements = Sets.newHashSet(); +private List programStageDataElements = Lists.newArrayList(); private Set programTrackedEntityAttributes = Sets.newHashSet(); public void extract( T object ) @@ -450,9 +451,9 @@ ReflectionUtils.invokeSetterMethod( "programTrackedEntityAttributes", object, programTrackedEntityAttributes ); } -private Set extractProgramStageDataElements( T object ) +private List extractProgramStageDataElements( T object ) { -Set programStageDataElements = Sets.newHashSet(); +List programStageDataElements = Lists.newArrayList(); if ( ReflectionUtils.findGetterMethod( "programStageDataElements", object ) != null ) { @@ -474,7 +475,7 @@ return programStageDataElements; } -private void saveProgramStageDataElements( T object, Set programStageDataElements ) +private void saveProgramStageDataElements( T object, List programStageDataElements ) { for ( ProgramStageDataElement programStageDataElement : programStageDataElements ) { === modified file 'dhis-2/pom.xml' --- dhis-2/pom.xml 2014-06-12 07:52:53 + +++ dhis-2/pom.xml 2014-06-12 09:11:27 + @@ -976,6 +976,7 @@ 0.9.1 test + org.hamcrest hamcrest-library ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
Hey Morten, Thanks for that. I just wanted a clarification on one more thing: We created a Program say "Program1" and then "Program Stage" under it. This stage has approximately 20 "ProgramStageDataElements". On "Event Capture screen", after selecting relevant fields ("Program1" as program and "orgUnit" as organization Unit), on clicking "Register Event", I am able to see only few "ProgramStageDataElements" (around 10) and not all of them. Is it the expected behavior or its a bug? On Thu, Jun 12, 2014 at 2:28 PM, Morten Olav Hansen wrote: > Hi, > > The tracker metadata web-api should still be considered wip (it's new for > 2.16). I haven't tested with programStageSections at all. > > I will have a look at it. > > -- > Morten > > > On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal > wrote: > >> Hello All, >> >> We were trying to create "Program", "Program Stage" and "Program Stage >> Section" using "/metadata" api. >> >> We are facing issues creating "Program Stage Section". >> *Status : 409 Conflict* >> >> When we tried debugging the issue, we got some ClassCastExceptions for >> "List to Set" and "Set to List" in "extractProgramStageDataElements" and >> "saveProgramStageDataElements" methods in >> "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". >> >> We tried fixing it, and we got some more exceptions (Constraint Violation >> Exception) >> >> *Input to the api "/metadata"*: >> >> { >> "programStageSections": [ >> { >> "name": "SomeName", >> "programStageDataElements": [ >> { >> "allowDateInFuture": false, >> "allowProvidedElsewhere": false, >> "compulsory": false, >> "dataElement": { >> "id": "DataElementId", >> "name": "DataElementName" >> }, >> "displayInReports": false >> } >> ], >> "sortOrder": 1 >> } >> ] >> } >> >> Can you please have a look onto this and fix it if needed. >> >> >> >> -- >> Thanks, >> Mansi Singhal >> > > -- Regards, Mansi Singhal ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
That sounds weird. Abyor or Tran, could you have a look at it? -- Morten On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal wrote: > Hey Morten, > > Thanks for that. > > I just wanted a clarification on one more thing: > > We created a Program say "Program1" and then "Program Stage" under it. > This stage has approximately 20 "ProgramStageDataElements". > > On "Event Capture screen", after selecting relevant fields ("Program1" as > program and "orgUnit" as organization Unit), on clicking "Register Event", > I am able to see only few "ProgramStageDataElements" (around 10) and not > all of them. > > Is it the expected behavior or its a bug? > > > > On Thu, Jun 12, 2014 at 2:28 PM, Morten Olav Hansen > wrote: > >> Hi, >> >> The tracker metadata web-api should still be considered wip (it's new for >> 2.16). I haven't tested with programStageSections at all. >> >> I will have a look at it. >> >> -- >> Morten >> >> >> On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal < >> msing...@thoughtworks.com> wrote: >> >>> Hello All, >>> >>> We were trying to create "Program", "Program Stage" and "Program Stage >>> Section" using "/metadata" api. >>> >>> We are facing issues creating "Program Stage Section". >>> *Status : 409 Conflict* >>> >>> When we tried debugging the issue, we got some ClassCastExceptions for >>> "List to Set" and "Set to List" in "extractProgramStageDataElements" and >>> "saveProgramStageDataElements" methods in >>> "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". >>> >>> We tried fixing it, and we got some more exceptions (Constraint >>> Violation Exception) >>> >>> *Input to the api "/metadata"*: >>> >>> { >>> "programStageSections": [ >>> { >>> "name": "SomeName", >>> "programStageDataElements": [ >>> { >>> "allowDateInFuture": false, >>> "allowProvidedElsewhere": false, >>> "compulsory": false, >>> "dataElement": { >>> "id": "DataElementId", >>> "name": "DataElementName" >>> }, >>> "displayInReports": false >>> } >>> ], >>> "sortOrder": 1 >>> } >>> ] >>> } >>> >>> Can you please have a look onto this and fix it if needed. >>> >>> >>> >>> -- >>> Thanks, >>> Mansi Singhal >>> >> >> > > > -- > Regards, > Mansi Singhal > > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Need to pass credentials from external site
Thanks Morten, Is this the right section in the manual? http://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s03.html Knut On Thu, Jun 12, 2014 at 10:38 AM, Morten Olav Hansen wrote: > Hi, > > i test this on our demo server (http://apps.dhis2.org/dev) and this works > fine: > $.post('/dev/dhis-web-commons-security/login.action?authOnly=true', { > j_username: "admin", j_password: "district" }) > > Is the request coming from the same server? remember that x-domain auth is > not supported by default > > -- > Morten > > > On Thu, Jun 12, 2014 at 10:22 AM, Md. Monjur Rahman > wrote: > >> Dear All, >> I have several DHIS application from different server. I have developed >> a page which contains all the credential information about those >> applications. >> I want the DHIS application logged on after clicking the link. But it >> always redirect me to login page of DHIS. My code snippet is: >> >> $(document).ready(function () { >> $("#link1").click(function () { >> $.post(" >> http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, >> { j_username: "admin", j_password: "district" }); >> window.open(" >> http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action >> "); >> }); >> }); >> >> please help. >> >> Md Monjur Rahman >> Senior Computer Programmer, >> Center for Equity & Health System, >> icdd,b, Mohakhali, Dhaka, Bangladesh. >> ___ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp >> > > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15647: various fixes to ProgramStage, ProgramStageSection, adds link from programStageSection => program...
revno: 15647 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 11:41:31 +0200 message: various fixes to ProgramStage, ProgramStageSection, adds link from programStageSection => programStage modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageSection.hbm.xml dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/CrudControllerAdvice.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-05-26 11:54:16 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-06-12 09:41:31 + @@ -37,6 +37,7 @@ import org.hisp.dhis.common.BaseIdentifiableObject; import org.hisp.dhis.common.DxfNamespaces; import org.hisp.dhis.common.IdentifiableObject; +import org.hisp.dhis.common.annotation.Scanned; import org.hisp.dhis.common.view.DetailedView; import org.hisp.dhis.common.view.ExportView; import org.hisp.dhis.dataentryform.DataEntryForm; @@ -73,6 +74,7 @@ private Set programStageDataElements = new HashSet(); +@Scanned private Set programStageSections = new HashSet(); private DataEntryForm dataEntryForm; === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java 2014-05-26 13:53:11 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java 2014-06-12 09:41:31 + @@ -30,6 +30,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; @@ -45,12 +46,14 @@ /** * @author Chau Thu Tran */ -@JacksonXmlRootElement( localName = "programStageSection", namespace = DxfNamespaces.DXF_2_0 ) +@JacksonXmlRootElement(localName = "programStageSection", namespace = DxfNamespaces.DXF_2_0) public class ProgramStageSection extends BaseIdentifiableObject { private static final long serialVersionUID = 3141607927546197116L; +private ProgramStage programStage; + private List programStageDataElements = new ArrayList(); private Integer sortOrder; @@ -78,17 +81,21 @@ } // - -// Constructors +// Getters and setters // - -public Integer getSortOrder() +@JsonProperty +@JsonSerialize( as = BaseIdentifiableObject.class ) +@JsonView( { DetailedView.class, ExportView.class } ) +@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) +public ProgramStage getProgramStage() { -return sortOrder; +return programStage; } -public void setSortOrder( Integer sortOrder ) +public void setProgramStage( ProgramStage programStage ) { -this.sortOrder = sortOrder; +this.programStage = programStage; } @JsonProperty @@ -105,6 +112,19 @@ this.programStageDataElements = programStageDataElements; } +@JsonProperty +@JsonView( { DetailedView.class, ExportView.class } ) +@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) +public Integer getSortOrder() +{ +return sortOrder; +} + +public void setSortOrder( Integer sortOrder ) +{ +this.sortOrder = sortOrder; +} + @Override public void mergeWith( IdentifiableObject other ) { @@ -114,6 +134,9 @@ { ProgramStageSection programStageSection = (ProgramStageSection) other; +programStage = programStageSection.getProgramStage(); +sortOrder = programStageSection.getSortOrder(); + programStageDataElements.clear(); programStageDataElements.addAll( programStageSection.getProgramStageDataElements() ); }
Re: [Dhis2-devs] Need to pass credentials from external site
That depends on what you want to do. That approach uses a apache/nginx authenticating proxy, and not JS. It is possible to get around x-domain issues in JS using CORS [1] also (but not available in all browsers/versions). Without knowing more of the setup, its hard to decide what is the best approach. [1] http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -- Morten On Thu, Jun 12, 2014 at 11:38 AM, Knut Staring wrote: > Thanks Morten, > Is this the right section in the manual? > http://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s03.html > > Knut > > > On Thu, Jun 12, 2014 at 10:38 AM, Morten Olav Hansen > wrote: > >> Hi, >> >> i test this on our demo server (http://apps.dhis2.org/dev) and this >> works fine: >> $.post('/dev/dhis-web-commons-security/login.action?authOnly=true', { >> j_username: "admin", j_password: "district" }) >> >> Is the request coming from the same server? remember that x-domain auth >> is not supported by default >> >> -- >> Morten >> >> >> On Thu, Jun 12, 2014 at 10:22 AM, Md. Monjur Rahman >> wrote: >> >>> Dear All, >>> I have several DHIS application from different server. I have developed >>> a page which contains all the credential information about those >>> applications. >>> I want the DHIS application logged on after clicking the link. But it >>> always redirect me to login page of DHIS. My code snippet is: >>> >>> $(document).ready(function () { >>> $("#link1").click(function () { >>> $.post(" >>> http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, >>> { j_username: "admin", j_password: "district" }); >>> window.open(" >>> http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action >>> "); >>> }); >>> }); >>> >>> please help. >>> >>> Md Monjur Rahman >>> Senior Computer Programmer, >>> Center for Equity & Health System, >>> icdd,b, Mohakhali, Dhaka, Bangladesh. >>> ___ >>> Mailing list: https://launchpad.net/~dhis2-devs >>> Post to : dhis2-devs@lists.launchpad.net >>> Unsubscribe : https://launchpad.net/~dhis2-devs >>> More help : https://help.launchpad.net/ListHelp >>> >> >> >> ___ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp >> >> > > > -- > Knut Staring > Dept. of Informatics, University of Oslo > +4791880522 > http://dhis2.org > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Need to pass credentials from external site
I think the point is that it is not the same server (it is several different servers) On 12 Jun 2014 15:38, "Knut Staring" wrote: > Thanks Morten, > Is this the right section in the manual? > http://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s03.html > > Knut > > > On Thu, Jun 12, 2014 at 10:38 AM, Morten Olav Hansen > wrote: > >> Hi, >> >> i test this on our demo server (http://apps.dhis2.org/dev) and this >> works fine: >> $.post('/dev/dhis-web-commons-security/login.action?authOnly=true', { >> j_username: "admin", j_password: "district" }) >> >> Is the request coming from the same server? remember that x-domain auth >> is not supported by default >> >> -- >> Morten >> >> >> On Thu, Jun 12, 2014 at 10:22 AM, Md. Monjur Rahman >> wrote: >> >>> Dear All, >>> I have several DHIS application from different server. I have developed >>> a page which contains all the credential information about those >>> applications. >>> I want the DHIS application logged on after clicking the link. But it >>> always redirect me to login page of DHIS. My code snippet is: >>> >>> $(document).ready(function () { >>> $("#link1").click(function () { >>> $.post(" >>> http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, >>> { j_username: "admin", j_password: "district" }); >>> window.open(" >>> http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action >>> "); >>> }); >>> }); >>> >>> please help. >>> >>> Md Monjur Rahman >>> Senior Computer Programmer, >>> Center for Equity & Health System, >>> icdd,b, Mohakhali, Dhaka, Bangladesh. >>> ___ >>> Mailing list: https://launchpad.net/~dhis2-devs >>> Post to : dhis2-devs@lists.launchpad.net >>> Unsubscribe : https://launchpad.net/~dhis2-devs >>> More help : https://help.launchpad.net/ListHelp >>> >> >> >> ___ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp >> >> > > > -- > Knut Staring > Dept. of Informatics, University of Oslo > +4791880522 > http://dhis2.org > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15648: minor fixes to ProgramStageDataElement
revno: 15648 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 11:53:18 +0200 message: minor fixes to ProgramStageDataElement modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-05-30 08:45:46 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-06-12 09:53:18 + @@ -81,6 +81,10 @@ // Constructors // - +public ProgramStageDataElement() +{ +} + public ProgramStageDataElement( ProgramStage programStage, DataElement dataElement, boolean compulsory ) { this.programStage = programStage; @@ -97,10 +101,10 @@ this.sortOrder = sortOrder; } -public ProgramStageDataElement() -{ -} - +@JsonProperty +@JsonSerialize( as = BaseIdentifiableObject.class ) +@JsonView( { DetailedView.class, ExportView.class } ) +@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) public ProgramStage getProgramStage() { return programStage; === modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml' --- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2013-09-16 17:07:25 + +++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2014-06-12 09:53:18 + @@ -14,14 +14,14 @@ - - - - - - - - + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java 2014-03-18 08:10:10 + +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java 2014-06-12 09:53:18 + @@ -28,11 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - +import com.opensymphony.xwork2.Action; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.program.ProgramStage; @@ -41,11 +37,13 @@ import org.hisp.dhis.program.ProgramStageSection; import org.hisp.dhis.program.ProgramStageService; -import com.opensymphony.xwork2.Action; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * @author Chau Thu Tran - * * @version AddProgramStageSectionAction.java 11:29:40 AM Aug 22, 2012 $ */ public class AddProgramStageSectionAction @@ -136,10 +134,12 @@ // - Set sections = programStage.getProgramStageSections(); + if ( sections == null ) { sections = new HashSet(); } + sections.add( section ); programStage.setProgramStageSections( sections ); ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Need to pass credentials from external site
Ok, so one should probably delegate one server to be the "proxy" server, and this one will have different endpoint to the differents servers, and these will all be authenticating using the Authorization header. (Are you still with John? he has a nginx setup for something similar) -- Morten On Thu, Jun 12, 2014 at 11:53 AM, Knut Staring wrote: > I think the point is that it is not the same server (it is several > different servers) > On 12 Jun 2014 15:38, "Knut Staring" wrote: > >> Thanks Morten, >> Is this the right section in the manual? >> http://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s03.html >> >> Knut >> >> >> On Thu, Jun 12, 2014 at 10:38 AM, Morten Olav Hansen >> wrote: >> >>> Hi, >>> >>> i test this on our demo server (http://apps.dhis2.org/dev) and this >>> works fine: >>> $.post('/dev/dhis-web-commons-security/login.action?authOnly=true', { >>> j_username: "admin", j_password: "district" }) >>> >>> Is the request coming from the same server? remember that x-domain auth >>> is not supported by default >>> >>> -- >>> Morten >>> >>> >>> On Thu, Jun 12, 2014 at 10:22 AM, Md. Monjur Rahman >>> wrote: >>> Dear All, I have several DHIS application from different server. I have developed a page which contains all the credential information about those applications. I want the DHIS application logged on after clicking the link. But it always redirect me to login page of DHIS. My code snippet is: $(document).ready(function () { $("#link1").click(function () { $.post(" http://localhost:8191/dhis215/dhis-web-commons-security/login.action?authOnly=true";, { j_username: "admin", j_password: "district" }); window.open(" http://localhost:8191/dhis215/dhis-web-dashboard-integration/index.action "); }); }); please help. Md Monjur Rahman Senior Computer Programmer, Center for Equity & Health System, icdd,b, Mohakhali, Dhaka, Bangladesh. ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp >>> >>> >>> ___ >>> Mailing list: https://launchpad.net/~dhis2-devs >>> Post to : dhis2-devs@lists.launchpad.net >>> Unsubscribe : https://launchpad.net/~dhis2-devs >>> More help : https://help.launchpad.net/ListHelp >>> >>> >> >> >> -- >> Knut Staring >> Dept. of Informatics, University of Oslo >> +4791880522 >> http://dhis2.org >> > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
Hi There was a few missing pieces to the programStageSection and programDataElements classes. Please try again, but remember that the format has changed, so I would create a new section in dhis and export it.. to look at the format. Also remember that programStage is the "owning" side of that relationship, so to attach it, you would also send a programStage update in the same metadata body. -- Morten On Thu, Jun 12, 2014 at 11:34 AM, Morten Olav Hansen wrote: > That sounds weird. Abyor or Tran, could you have a look at it? > > -- > Morten > > > On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal > wrote: > >> Hey Morten, >> >> Thanks for that. >> >> I just wanted a clarification on one more thing: >> >> We created a Program say "Program1" and then "Program Stage" under it. >> This stage has approximately 20 "ProgramStageDataElements". >> >> On "Event Capture screen", after selecting relevant fields ("Program1" as >> program and "orgUnit" as organization Unit), on clicking "Register Event", >> I am able to see only few "ProgramStageDataElements" (around 10) and not >> all of them. >> >> Is it the expected behavior or its a bug? >> >> >> >> On Thu, Jun 12, 2014 at 2:28 PM, Morten Olav Hansen >> wrote: >> >>> Hi, >>> >>> The tracker metadata web-api should still be considered wip (it's new >>> for 2.16). I haven't tested with programStageSections at all. >>> >>> I will have a look at it. >>> >>> -- >>> Morten >>> >>> >>> On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal < >>> msing...@thoughtworks.com> wrote: >>> Hello All, We were trying to create "Program", "Program Stage" and "Program Stage Section" using "/metadata" api. We are facing issues creating "Program Stage Section". *Status : 409 Conflict* When we tried debugging the issue, we got some ClassCastExceptions for "List to Set" and "Set to List" in "extractProgramStageDataElements" and "saveProgramStageDataElements" methods in "DefaultIdentifiableObjectImporter" class under "dhis-services-dxf2". We tried fixing it, and we got some more exceptions (Constraint Violation Exception) *Input to the api "/metadata"*: { "programStageSections": [ { "name": "SomeName", "programStageDataElements": [ { "allowDateInFuture": false, "allowProvidedElsewhere": false, "compulsory": false, "dataElement": { "id": "DataElementId", "name": "DataElementName" }, "displayInReports": false } ], "sortOrder": 1 } ] } Can you please have a look onto this and fix it if needed. -- Thanks, Mansi Singhal >>> >>> >> >> >> -- >> Regards, >> Mansi Singhal >> >> > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15649: various collection fixes in idObjectImporter
revno: 15649 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 12:39:43 +0200 message: various collection fixes in idObjectImporter modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-06-12 09:41:31 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-06-12 10:39:43 + @@ -72,10 +72,10 @@ private Program program; -private Set programStageDataElements = new HashSet(); +private Set programStageDataElements = new HashSet<>(); @Scanned -private Set programStageSections = new HashSet(); +private Set programStageSections = new HashSet<>(); private DataEntryForm dataEntryForm; @@ -83,7 +83,7 @@ private String reportDateDescription; -private Set reminders = new HashSet(); +private Set reminders = new HashSet<>(); private Boolean autoGenerateEvent = true; === modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-06-12 09:41:31 + +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-06-12 10:39:43 + @@ -73,6 +73,7 @@ import org.springframework.beans.factory.annotation.Autowired; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.util.Collection; import java.util.List; import java.util.Map; @@ -160,7 +161,7 @@ private Set compulsoryDataElementOperands = Sets.newHashSet(); private Set greyedFields = Sets.newHashSet(); -private List programStageDataElements = Lists.newArrayList(); +private Collection programStageDataElements = Lists.newArrayList(); private Set programTrackedEntityAttributes = Sets.newHashSet(); public void extract( T object ) @@ -451,13 +452,13 @@ ReflectionUtils.invokeSetterMethod( "programTrackedEntityAttributes", object, programTrackedEntityAttributes ); } -private List extractProgramStageDataElements( T object ) +private Collection extractProgramStageDataElements( T object ) { -List programStageDataElements = Lists.newArrayList(); +Method method = ReflectionUtils.findGetterMethod( "programStageDataElements", object ); -if ( ReflectionUtils.findGetterMethod( "programStageDataElements", object ) != null ) +if ( method != null ) { -programStageDataElements = ReflectionUtils.invokeGetterMethod( "programStageDataElements", object ); +Collection programStageDataElements = ReflectionUtils.invokeGetterMethod( "programStageDataElements", object ); for ( ProgramStageDataElement programStageDataElement : programStageDataElements ) { @@ -468,15 +469,23 @@ } sessionFactory.getCurrentSession().flush(); -ReflectionUtils.invokeSetterMethod( "programStageDataElements", object, Lists.newArrayList() ); +ReflectionUtils.invokeSetterMethod( "programStageDataElements", object, +ReflectionUtils.newCollectionInstance( method.getReturnType() ) ); sessionFactory.getCurrentSession().flush(); + +return programStageDataElements; } -return programStageDataElements; +return null; } -private void saveProgramStageDataElements( T object, List programStageDataElements ) +private void saveProgramStageDataElements( T object, Collection programStageDataElements ) { +if ( programStageDataElements == null ) +{ +return; +} + for ( ProgramStageDataElement programStageDataElement : programStageDataElements ) { Map identifiableObjects = detachFields( programStageDataElement ); ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
Hello Morten, Program creation is fine. But ProgramStage and ProgramStageSection creation is failing. See details below. *"Program Stage":* *Input:* { "programStages": [{ "programStageDataElements": [{ "displayInReports": true, "dataElement": { "id": "034dcb18fe3", "name": "Age" }, "allowProvidedElsewhere": false, "compulsory": false, "allowDateInFuture": false }], "description": "Desc", "program": { "id": "625b2495e79", "name": "Prog1" }, "id": "b17f8e7729b", "name": "Stage1" }] } *Error:* Problem accessing /api/metadata. Reason: java.util.HashSet cannot be cast to java.util.List Caused by: java.lang.ClassCastException: java.util.HashSet cannot be cast to java.util.List at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extractProgramStageDataElements(DefaultIdentifiableObjectImporter.java:460) at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extract(DefaultIdentifiableObjectImporter.java:174) at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.newObject(DefaultIdentifiableObjectImporter.java:570) at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter.java:830) at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectImporter.java:785) at org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjects(DefaultIdentifiableObjectImporter.java:743) at org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:261) at org.hisp.dhis.dxf2.metadata.DefaultImportService.importMetaData(DefaultImportService.java:178) at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) *"Program Stage Section":* Program stage for this JSON was created using DHIS UI. *Input:* { "programStageSections": [{ "programStageDataElements": [{ "displayInReports": false, "dataElement": { "id": "034dcb18fe3", "name": "Age" }, "allowProvidedElsewhere": false, "compulsory": false, "allowDateInFuture": false }], "name": "name", "sortOrder": 1, "programStage": { "id": "UGl8auROT9M", "name": "Single-Event Stage1" } }] } *Error:* Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "PROGRAMSTAGEID"; SQL statement: insert into programstage_dataelements (compulsory, allowprovidedelsewhere, sort_order, displayInReports, allowDateInFuture, programstageid, dataelementid) values (?, ?, ?, ?, ?, ?, ?) [23502-173] On Thu, Jun 12, 2014 at 3:28 PM, Morten Olav Hansen wrote: > Hi > > There was a few missing pieces to the programStageSection and > programDataElements classes. Please try again, but remember that the format > has changed, so I would create a new section in dhis and export it.. to > look at the format. > > Also remember that programStage is the "owning" side of that relationship, > so to attach it, you would also send a programStage update in the same > metadata body. > > -- > Morten > > > On Thu, Jun 12, 2014 at 11:34 AM, Morten Olav Hansen > wrote: > >> That sounds weird. Abyor or Tran, could you have a look at it? >> >> -- >> Morten >> >> >> On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal < >> msing...@thoughtworks.com> wrote: >> >>> Hey Morten, >>> >>> Thanks for that. >>> >>> I just wanted a clarification on one more thing: >>> >>> We created a Program say "Program1" and then "Program Stage" under it. >>> This stage has approximately 20 "ProgramStageDataElements". >>> >>> On "Event Capture screen", after selecting relevant fields ("Program1" >>> as program and "orgUnit" as organization Unit), on clicking "Register >>> Event", I am able to see only few "ProgramStageDataElements" (around 10) >>> and not all of them. >>> >>> Is it the expected behavior or its a bug? >>> >>> >>> >>> On Thu, Jun 12, 2014 at 2:28 PM, Morten Olav Hansen >>> wrote: >>> Hi, The tracker metadata web-api should still be considered wip (it's new for 2.16). I haven't tested with programStageSections at all. I will have a look at it. -- Morten On Thu, Jun 12, 2014 at 10:49 AM, Mansi Singhal < msing...@thoughtworks.com> wrote: > Hello All, > > We
Re: [Dhis2-devs] Issues importing ProgramStageSection
Yes, I'm looking into this now, seems like we are using a Set for programStageDataElements some places, and a List other places.. Btw, you are not allowed to have numbers in the start of an ID. -- Morten On Thu, Jun 12, 2014 at 12:59 PM, Mansi Singhal wrote: > Hello Morten, > > Program creation is fine. > But ProgramStage and ProgramStageSection creation is failing. See details > below. > > *"Program Stage":* > > *Input:* > > { > "programStages": [{ > "programStageDataElements": [{ > "displayInReports": true, > "dataElement": { > "id": "034dcb18fe3", > "name": "Age" > }, > "allowProvidedElsewhere": false, > "compulsory": false, > "allowDateInFuture": false > }], > "description": "Desc", > "program": { > "id": "625b2495e79", > "name": "Prog1" > }, > "id": "b17f8e7729b", > "name": "Stage1" > }] > } > > *Error:* > > Problem accessing /api/metadata. Reason: > > java.util.HashSet cannot be cast to java.util.List > > Caused by: > > java.lang.ClassCastException: java.util.HashSet cannot be cast to > java.util.List > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extractProgramStageDataElements(DefaultIdentifiableObjectImporter.java:460) > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extract(DefaultIdentifiableObjectImporter.java:174) > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.newObject(DefaultIdentifiableObjectImporter.java:570) > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter.java:830) > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectImporter.java:785) > at > org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjects(DefaultIdentifiableObjectImporter.java:743) > at > org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:261) > at > org.hisp.dhis.dxf2.metadata.DefaultImportService.importMetaData(DefaultImportService.java:178) > at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > > > > > *"Program Stage Section":* > > Program stage for this JSON was created using DHIS UI. > > *Input:* > { > "programStageSections": [{ > "programStageDataElements": [{ > "displayInReports": false, > "dataElement": { > "id": "034dcb18fe3", > "name": "Age" > }, > "allowProvidedElsewhere": false, > "compulsory": false, > "allowDateInFuture": false > }], > "name": "name", > "sortOrder": 1, > "programStage": { > "id": "UGl8auROT9M", > "name": "Single-Event Stage1" > } > }] > } > > > *Error:* > > > Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column > "PROGRAMSTAGEID"; SQL statement: > insert into programstage_dataelements (compulsory, allowprovidedelsewhere, > sort_order, displayInReports, allowDateInFuture, programstageid, > dataelementid) values (?, ?, ?, ?, ?, ?, ?) [23502-173] > > > > On Thu, Jun 12, 2014 at 3:28 PM, Morten Olav Hansen > wrote: > >> Hi >> >> There was a few missing pieces to the programStageSection and >> programDataElements classes. Please try again, but remember that the format >> has changed, so I would create a new section in dhis and export it.. to >> look at the format. >> >> Also remember that programStage is the "owning" side of that >> relationship, so to attach it, you would also send a programStage update in >> the same metadata body. >> >> -- >> Morten >> >> >> On Thu, Jun 12, 2014 at 11:34 AM, Morten Olav Hansen >> wrote: >> >>> That sounds weird. Abyor or Tran, could you have a look at it? >>> >>> -- >>> Morten >>> >>> >>> On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal < >>> msing...@thoughtworks.com> wrote: >>> Hey Morten, Thanks for that. I just wanted a clarification on one more thing: We created a Program say "Program1" and then "Program Stage" under it. This stage has approximately 20 "ProgramStageDataElements". On "Event Capture screen", after selecting relevant fields ("Program1" as program and "orgUnit" as organization Unit), on clicking "Register Event", I am able to see only few "ProgramStageDataElements" (around 10) and not all of them. Is
[Dhis2-devs] Restriction of the analytics process to certain time periods
This may have been brought up before, but we get some data sometimes, submitted in faraway time periods (like 1-1-0001). No clue really how this gets in there, but it exposes a weakness in the analytics, in that if data exists from these ancient (or far in the future time periods), many thousands of tables will be created (since a table will be created for each year, based on the minimum and maximum period). I would like to suggest that we implement a mechanism (perhaps a system setting) to restrict the analytics to certain time ranges, namely 1) Ignore data for the analytics before... 2) Igonore data for the analytics after Regards, Jason ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Restriction of the analytics process to certain time periods
Hi Jason, I see the problem. Analytics after 2.14 should remove all empty analytics tables though so you should not have all those empty tables between 0 and now. Unless someone plans to use DHIS for archaeological research / studies of the ancient Greeks we could maybe hard code some sensible limits to protect from those extreme cases. Lars On Thu, Jun 12, 2014 at 1:45 PM, Jason Pickering < jason.p.picker...@gmail.com> wrote: > This may have been brought up before, but we get some data sometimes, > submitted in faraway time periods (like 1-1-0001). No clue really how this > gets in there, but it exposes a weakness in the analytics, in that if data > exists from these ancient (or far in the future time periods), many > thousands of tables will be created (since a table will be created for each > year, based on the minimum and maximum period). > > I would like to suggest that we implement a mechanism (perhaps a system > setting) to restrict the analytics to certain time ranges, namely > > 1) Ignore data for the analytics before... > 2) Igonore data for the analytics after > > Regards, > Jason > > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Issues importing ProgramStageSection
Hi Mansi Could you try out rev 15650 and see if it works for you? -- Morten On Thu, Jun 12, 2014 at 1:06 PM, Morten Olav Hansen wrote: > Yes, I'm looking into this now, seems like we are using a Set for > programStageDataElements some places, and a List other places.. > > Btw, you are not allowed to have numbers in the start of an ID. > > -- > Morten > > > On Thu, Jun 12, 2014 at 12:59 PM, Mansi Singhal > wrote: > >> Hello Morten, >> >> Program creation is fine. >> But ProgramStage and ProgramStageSection creation is failing. See details >> below. >> >> *"Program Stage":* >> >> *Input:* >> >> { >> "programStages": [{ >> "programStageDataElements": [{ >> "displayInReports": true, >> "dataElement": { >> "id": "034dcb18fe3", >> "name": "Age" >> }, >> "allowProvidedElsewhere": false, >> "compulsory": false, >> "allowDateInFuture": false >> }], >> "description": "Desc", >> "program": { >> "id": "625b2495e79", >> "name": "Prog1" >> }, >> "id": "b17f8e7729b", >> "name": "Stage1" >> }] >> } >> >> *Error:* >> >> Problem accessing /api/metadata. Reason: >> >> java.util.HashSet cannot be cast to java.util.List >> >> Caused by: >> >> java.lang.ClassCastException: java.util.HashSet cannot be cast to >> java.util.List >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extractProgramStageDataElements(DefaultIdentifiableObjectImporter.java:460) >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter$NonIdentifiableObjects.extract(DefaultIdentifiableObjectImporter.java:174) >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.newObject(DefaultIdentifiableObjectImporter.java:570) >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter.java:830) >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectImporter.java:785) >> at >> org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjects(DefaultIdentifiableObjectImporter.java:743) >> at >> org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:261) >> at >> org.hisp.dhis.dxf2.metadata.DefaultImportService.importMetaData(DefaultImportService.java:178) >> at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:606) >> >> >> >> >> *"Program Stage Section":* >> >> Program stage for this JSON was created using DHIS UI. >> >> *Input:* >> { >> "programStageSections": [{ >> "programStageDataElements": [{ >> "displayInReports": false, >> "dataElement": { >> "id": "034dcb18fe3", >> "name": "Age" >> }, >> "allowProvidedElsewhere": false, >> "compulsory": false, >> "allowDateInFuture": false >> }], >> "name": "name", >> "sortOrder": 1, >> "programStage": { >> "id": "UGl8auROT9M", >> "name": "Single-Event Stage1" >> } >> }] >> } >> >> >> *Error:* >> >> >> Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column >> "PROGRAMSTAGEID"; SQL statement: >> insert into programstage_dataelements (compulsory, allowprovidedelsewhere, >> sort_order, displayInReports, allowDateInFuture, programstageid, >> dataelementid) values (?, ?, ?, ?, ?, ?, ?) [23502-173] >> >> >> >> On Thu, Jun 12, 2014 at 3:28 PM, Morten Olav Hansen >> wrote: >> >>> Hi >>> >>> There was a few missing pieces to the programStageSection and >>> programDataElements classes. Please try again, but remember that the format >>> has changed, so I would create a new section in dhis and export it.. to >>> look at the format. >>> >>> Also remember that programStage is the "owning" side of that >>> relationship, so to attach it, you would also send a programStage update in >>> the same metadata body. >>> >>> -- >>> Morten >>> >>> >>> On Thu, Jun 12, 2014 at 11:34 AM, Morten Olav Hansen >> > wrote: >>> That sounds weird. Abyor or Tran, could you have a look at it? -- Morten On Thu, Jun 12, 2014 at 11:26 AM, Mansi Singhal < msing...@thoughtworks.com> wrote: > Hey Morten, > > Thanks for that. > > I just wanted a clarification on one more thing: > > We created a Program say "Program1" and then "Program Stage" under it. > This stage has approximately 20 "ProgramSt
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15650: fixes to ProgramStage/ProgramStageDataElement import
revno: 15650 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 15:35:43 +0200 message: fixes to ProgramStage/ProgramStageDataElement import modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSectionSchemaDescriptor.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-06-12 09:53:18 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-06-12 13:35:43 + @@ -155,6 +155,9 @@ this.compulsory = compulsory; } +@JsonProperty +@JsonView( { DetailedView.class, ExportView.class } ) +@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) public Integer getSortOrder() { return sortOrder; === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSectionSchemaDescriptor.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSectionSchemaDescriptor.java 2014-05-31 13:18:51 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/ProgramStageSectionSchemaDescriptor.java 2014-06-12 13:35:43 + @@ -105,7 +105,7 @@ public Schema getSchema() { Schema schema = new Schema( ProgramStageSection.class, SINGULAR, PLURAL ); -schema.setOrder( 1470 ); +schema.setOrder( 1511 ); return schema; } === modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-06-12 10:39:43 + +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-06-12 13:35:43 + @@ -126,7 +126,7 @@ @Autowired private SchemaService schemaService; -@Autowired(required = false) +@Autowired( required = false ) private List> objectHandlers; //--- @@ -486,6 +486,9 @@ return; } +Collection programStageDataElementCollection = +ReflectionUtils.newCollectionInstance( programStageDataElements.getClass() ); + for ( ProgramStageDataElement programStageDataElement : programStageDataElements ) { Map identifiableObjects = detachFields( programStageDataElement ); @@ -496,10 +499,19 @@ programStageDataElement.setProgramStage( (ProgramStage) object ); } -programStageDataElementService.addProgramStageDataElement( programStageDataElement ); +ProgramStageDataElement persisted = programStageDataElementService.get( programStageDataElement.getProgramStage(), programStageDataElement.getDataElement() ); + +if ( persisted == null ) +{ +programStageDataElementService.addProgramStageDataElement( programStageDataElement ); +} +else +{ +programStageDataElementCollection.add( persisted ); +} } -ReflectionUtils.invokeSetterMethod( "programStageDataElements", object, programStageDataElements ); +ReflectionUtils.invokeSetterMethod( "programStageDataElements", object, programStageDataElementCollection ); } private void deleteProgramStageDataElements( T object ) @@ -598,7 +610,7 @@ reattachFields( object, fields ); -log.warn( "Trying to save new object => " + ImportUtils.getDisplayName( object ) + " (" + object.getClass().getSimpleName() + ")" ); +log.debug( "Trying to save new object => " + ImportUtils.getDisplayName( object ) + " (" + object.getClass().getSimpleName() + ")" ); objectBridge.saveObject( object ); updatePeriodTypes( object ); ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] Restriction of the analytics process to certain time periods
Yeah, this is really sort of an issue with the submission of mobile data from phones who have not set their clocks correctly, and the fact that DHIS2 does not really barf at recording things for periods from the ancient past. Although we try to instruct people this is necessary, just one submission at Jan 1, , will increase the time which it takes to do the analytics. I think some reasonable, as you say, limits would be good. Those who want to use DHIS2 for archeaological purposes, could always change these hard-coded limits. I would suggest 1900-2100, which should be more than generous enough for the vast majority of use cases. We are looking really just to restrict these extreme cases. Regards, Jason On Thu, Jun 12, 2014 at 2:40 PM, Lars Helge Øverland wrote: > Hi Jason, > > I see the problem. Analytics after 2.14 should remove all empty analytics > tables though so you should not have all those empty tables between 0 and > now. > > Unless someone plans to use DHIS for archaeological research / studies of > the ancient Greeks we could maybe hard code some sensible limits to protect > from those extreme cases. > > Lars > > > > On Thu, Jun 12, 2014 at 1:45 PM, Jason Pickering < > jason.p.picker...@gmail.com> wrote: > >> This may have been brought up before, but we get some data sometimes, >> submitted in faraway time periods (like 1-1-0001). No clue really how this >> gets in there, but it exposes a weakness in the analytics, in that if data >> exists from these ancient (or far in the future time periods), many >> thousands of tables will be created (since a table will be created for each >> year, based on the minimum and maximum period). >> >> I would like to suggest that we implement a mechanism (perhaps a system >> setting) to restrict the analytics to certain time ranges, namely >> >> 1) Ignore data for the analytics before... >> 2) Igonore data for the analytics after >> >> Regards, >> Jason >> >> >> ___ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp >> >> > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15651: throw exception for any write action on idObjectController
revno: 15651 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 16:32:29 +0200 message: throw exception for any write action on idObjectController modified: dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java 2014-06-11 19:54:06 + +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java 2014-06-12 14:32:29 + @@ -32,15 +32,20 @@ import com.google.common.collect.Lists; import org.hisp.dhis.common.IdentifiableObject; import org.springframework.stereotype.Controller; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; import java.util.List; /** * @author Lars Helge Overland */ @Controller -@RequestMapping( value = IdentifiableObjectController.RESOURCE_PATH ) +@RequestMapping(value = IdentifiableObjectController.RESOURCE_PATH) public class IdentifiableObjectController extends AbstractCrudController { @@ -59,4 +64,28 @@ return identifiableObjects; } + +@Override +public void postXmlObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception +{ +throw new HttpRequestMethodNotSupportedException( "POST" ); +} + +@Override +public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception +{ +throw new HttpRequestMethodNotSupportedException( "POST" ); +} + +@Override +public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception +{ +throw new HttpRequestMethodNotSupportedException( "PUT" ); +} + +@Override +public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid ) throws Exception +{ +throw new HttpRequestMethodNotSupportedException( "PUT" ); +} } ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15652: removed /api/optionSets/ID/options and /version, now supported generically through AbstractCrudCo...
revno: 15652 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 16:34:04 +0200 message: removed /api/optionSets/ID/options and /version, now supported generically through AbstractCrudController (slighly different format) modified: dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java 2014-05-27 13:18:27 + +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java 2014-06-12 14:34:04 + @@ -28,22 +28,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.hisp.dhis.dxf2.utils.JacksonUtils; -import org.hisp.dhis.option.OptionService; import org.hisp.dhis.option.OptionSet; import org.hisp.dhis.schema.descriptors.OptionSetSchemaDescriptor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * @author Morten Olav Hansen @@ -53,29 +41,4 @@ public class OptionSetController extends AbstractCrudController { -@Autowired -private OptionService optionService; - -@RequestMapping( value = "/{uid}/version", method = RequestMethod.GET ) -public void getVersion( @PathVariable( "uid" ) String uid, @RequestParam Map parameters, -HttpServletResponse response ) throws IOException -{ -OptionSet optionSet = manager.get( OptionSet.class, uid ); - -Map versionMap = new HashMap(); -versionMap.put( "version", optionSet.getVersion() ); - -JacksonUtils.toJson( response.getOutputStream(), versionMap ); -} - -@RequestMapping( value = "/{uid}/options", method = RequestMethod.GET ) -public void getOptions( @PathVariable( "uid" ) String uid, -@RequestParam( required = false ) String key, -@RequestParam( required = false ) Integer max, -HttpServletResponse response ) throws IOException -{ -List options = optionService.getOptions( uid, key, max ); - -JacksonUtils.toJson( response.getOutputStream(), options ); -} } ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15653: allow deep path on /api/type/id/property, /api/type/id/a/b/c works as alias for /api/type/id?fiel...
revno: 15653 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 17:01:50 +0200 message: allow deep path on /api/type/id/property, /api/type/id/a/b/c works as alias for /api/type/id?fields=a[b[c]] modified: dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2014-06-11 20:34:56 + +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2014-06-12 15:01:50 + @@ -68,6 +68,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.servlet.HandlerMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -192,12 +193,32 @@ return rootNode; } -@RequestMapping( value = "/{uid}/{property}", method = RequestMethod.GET ) +@RequestMapping( value = "/{uid}/**", method = RequestMethod.GET ) public @ResponseBody RootNode getObjectProperty( @PathVariable( "uid" ) String uid, -@PathVariable( "property" ) String propertyName, @RequestParam Map parameters, -HttpServletRequest request, HttpServletResponse response ) throws Exception +@RequestParam Map parameters, HttpServletRequest request, HttpServletResponse response ) throws Exception { -return getObjectInternal( uid, parameters, Lists.newArrayList(), Lists.newArrayList( propertyName ) ); +String requestUrl = (String) request.getAttribute( HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE ); +String[] fields = requestUrl.split( "/" ); + +String field = ""; +String postfix = ""; + +for ( int i = 3; i < fields.length; i++ ) +{ +if ( i > 3 ) +{ +field += "[" + fields[i]; +postfix += "]"; +} +else +{ +field = fields[i]; +} +} + +field += postfix; + +return getObjectInternal( uid, parameters, Lists.newArrayList(), Lists.newArrayList( field ) ); } @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15654: removed /api/type/id/members (/q/) from API, have already been replaced by fields= in appropriate...
revno: 15654 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 17:36:36 +0200 message: removed /api/type/id/members (/q/) from API, have already been replaced by fields= in appropriate places modified: dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementGroupController.java dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/indicator/IndicatorGroupController.java dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitGroupController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementGroupController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementGroupController.java 2014-06-11 20:27:54 + +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementGroupController.java 2014-06-12 15:36:36 + @@ -32,15 +32,14 @@ import org.hisp.dhis.common.Pager; import org.hisp.dhis.common.PagerUtils; import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.DataElementGroup; import org.hisp.dhis.dataelement.DataElementOperand; import org.hisp.dhis.schema.descriptors.DataElementGroupSchemaDescriptor; import org.hisp.dhis.webapi.controller.AbstractCrudController; +import org.hisp.dhis.webapi.utils.ContextUtils; import org.hisp.dhis.webapi.webdomain.WebMetaData; import org.hisp.dhis.webapi.webdomain.WebOptions; -import org.hisp.dhis.webapi.utils.ContextUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -52,7 +51,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -68,90 +66,6 @@ @Autowired private DataElementCategoryService dataElementCategoryService; -@RequestMapping( value = "/{uid}/members", method = RequestMethod.GET ) -public String getMembers( @PathVariable( "uid" ) String uid, @RequestParam Map parameters, -Model model, HttpServletRequest request, HttpServletResponse response ) throws Exception -{ -WebOptions options = new WebOptions( parameters ); -List dataElementGroups = getEntity( uid ); - -if ( dataElementGroups.isEmpty() ) -{ -ContextUtils.notFoundResponse( response, "DataElementGroup not found for uid: " + uid ); -return null; -} - -WebMetaData metaData = new WebMetaData(); -List dataElements = new ArrayList( dataElementGroups.get( 0 ).getMembers() ); -Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE ); - -if ( options.hasPaging() ) -{ -Pager pager = new Pager( options.getPage(), dataElements.size(), options.getPageSize() ); -metaData.setPager( pager ); -dataElements = PagerUtils.pageCollection( dataElements, pager ); -} - -metaData.setDataElements( dataElements ); - -if ( options.hasLinks() ) -{ -linkService.generateLinks( metaData ); -} - -model.addAttribute( "model", metaData ); -model.addAttribute( "viewClass", options.getViewClass( "basic" ) ); - -return StringUtils.uncapitalize( getEntitySimpleName() ); -} - -@RequestMapping( value = "/{uid}/members/query/{q}", method = RequestMethod.GET ) -public String getMembersByQuery( @PathVariable( "uid" ) String uid, @PathVariable( "q" ) String q, -@RequestParam Map parameters, Model model, HttpServletRequest request, -HttpServletResponse response ) throws Exception -{ -WebOptions options = new WebOptions( parameters ); -List dataElementGroups = getEntity( uid ); - -if ( dataElementGroups.isEmpty() ) -{ -ContextUtils.notFoundResponse( response, "DataElementGroup not found for uid: " + uid ); -return null; -} - -WebMetaData metaData = new WebMetaData(); -List dataElements = new ArrayList(); -List members = new ArrayList( dataElementGroups.get( 0 ).getMembers() ); -Collections.sort( members, IdentifiableObjectNameComparator.INSTANCE ); - -for ( DataElement dataElement : members ) -{ -
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15655: Add uid property in the last property in the details area for objects in Data Elements and Indica...
revno: 15655 committer: Tran Chau branch nick: dhis2 timestamp: Fri 2014-06-13 00:08:03 +0800 message: Add uid property in the last property in the details area for objects in Data Elements and Indicators function. modified: dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryCombo.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElement.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategory.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroup.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroupSet.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicator.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicatorGroup.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicatorGroupSet.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicatorType.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/categoryOptionGroup.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/categoryOptionGroupSet.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataDictionary.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroupSet.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroup.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorGroupSet.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorType.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOptionGroup.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOptionGroupSet.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/jsonDataDictionary.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/category.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multi
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15656: Removed new methods for querying TEIs. All TEI queries should go through the existing getTrackedE...
revno: 15656 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 18:30:25 +0200 message: Removed new methods for querying TEIs. All TEI queries should go through the existing getTrackedEntityInstances method. modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetService.java dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/AddUserGroupAction.java dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/usergroup/action/UpdateUserGroupAction.java dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2014-06-11 13:14:42 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2014-06-12 16:30:25 + @@ -38,7 +38,6 @@ import org.hisp.dhis.common.OrganisationUnitSelectionMode; import org.hisp.dhis.event.EventStatus; import org.hisp.dhis.i18n.I18nFormat; -import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramStatus; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue; @@ -246,30 +245,4 @@ * @return ValidationCriteria object which is violated */ ValidationCriteria validateEnrollment( TrackedEntityInstance entityInstance, Program program, I18nFormat format ); - -/** - * Search tracked entity instances by a certain attribute- value - * - * @param orgunit OrganisationUnit - * @param attributeValue Attribute value - * @param program Program - * @param min First result - * @param max Maximum results - * - * @return TrackedEntityInstance list - */ - Collection searchTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program, Integer min , Integer max); - - /** - * Get the number of tracked entity instances who has a certain attribute-value - * - * @param orgunit OrganisationUnit - * @param attributeValue Attribute value - * @param program Program - * @param min First result - * @param max Maximum results - * - * @return The number of TEIs - */ - int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java 2014-06-11 13:14:42 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java 2014-06-12 16:30:25 + @@ -28,12 +28,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.Collection; import java.util.List; import java.util.Map; import org.hisp.dhis.common.GenericIdentifiableObjectStore; -import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.program.Program; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue; @@ -61,19 +59,4 @@ * @return */ String validate( TrackedEntityInstance instance, TrackedEntityAttributeValue attributeValue, Program program ); - -/** - * Search tracked entity instances by a certain attribute- value - * - * @param orgunit OrganisationUnit - * @param attributeValue Attribute value - * @param min First result - * @param max Maximum results - * - * @return TrackedEntityInstance list - */ -Collection searchTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program, -Integer min, Integer max ); - -int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program ); }
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15657: Minor
revno: 15657 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 18:38:27 +0200 message: Minor modified: dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategory.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroupSet.vm -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategory.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategory.vm 2014-06-12 16:08:03 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategory.vm 2014-06-12 16:38:27 + @@ -1,7 +1,7 @@ { "dataElementCategory": { -"id": "${dataElementCategory.id}" , -"uid": "${dataElementCategory.uid}" , +"id": "${dataElementCategory.id}", +"uid": "${dataElementCategory.uid}", "name": "$!encoder.jsonEncode( ${dataElementCategory.name} )", "categoryOptionCount": "${dataElementCategory.categoryOptions.size()}" } === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm 2014-06-12 16:08:03 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm 2014-06-12 16:38:27 + @@ -1,7 +1,7 @@ { "dataElementCategoryOption": { -"id": "${dataElementCategoryOption.id}" , -"uid": "${dataElementCategoryOption.uid}" , +"id": "${dataElementCategoryOption.id}", +"uid": "${dataElementCategoryOption.uid}", "name": "$!encoder.jsonEncode( ${dataElementCategoryOption.name} )", "startDate": "$!format.formatDate( ${dataElementCategoryOption.startDate} )", "endDate": "$!format.formatDate( ${dataElementCategoryOption.endDate} )", === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroupSet.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroupSet.vm 2014-06-12 16:08:03 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementGroupSet.vm 2014-06-12 16:38:27 + @@ -1,7 +1,7 @@ { "dataElementGroupSet": { -"id": "${dataElementGroupSet.id}" , -"uid": "${dataElementGroupSet.uid}" , +"id": "${dataElementGroupSet.id}", +"uid": "${dataElementGroupSet.uid}", "name": "$!encoder.jsonEncode( ${dataElementGroupSet.displayName} )", "memberCount": "$dataElementGroupSet.members.size()" } ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15658: Fixed typos
revno: 15658 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 18:43:46 +0200 message: Fixed typos modified: dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml 2014-06-10 20:46:05 + +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml 2014-06-12 16:43:46 + @@ -21,11 +21,11 @@ - + - + +foreign-key="fk_categoryoption_organisationunits_organisationunitid" /> ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15659: support pr rootNode serialiation configuration, only pretty print is supported right now (and onl...
revno: 15659 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Thu 2014-06-12 20:05:28 +0200 message: support pr rootNode serialiation configuration, only pretty print is supported right now (and only supported in Jackson2JsonNodeSerializer) added: dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/SerializationFeature.java modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/serializers/Jackson2JsonNodeSerializer.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/types/RootNode.java dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === added directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config' === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java 1970-01-01 00:00:00 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java 2014-06-12 18:05:28 + @@ -0,0 +1,66 @@ +package org.hisp.dhis.node.config; + +/* + * Copyright (c) 2004-2014, 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 com.google.common.collect.ForwardingMap; +import com.google.common.collect.Maps; + +import java.util.Map; + +/** + * @author Morten Olav Hansen + */ +public class Configuration extends ForwardingMap +{ +@Override +protected Map delegate() +{ +return Maps.newHashMap(); +} + +public void enable( Feature feature ) +{ +delegate().put( feature, true ); +} + +public void disable( Feature feature ) +{ +delegate().put( feature, false ); +} + +public boolean isEnabled( Feature feature ) +{ +if ( delegate().containsKey( feature ) ) +{ +return delegate().get( feature ); +} + +return feature.defaultState(); +} +} === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java 1970-01-01 00:00:00 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java 2014-06-12 18:05:28 + @@ -0,0 +1,37 @@ +package org.hisp.dhis.node.config; + +/* + * Copyright (c) 2004-2014, 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 p
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15660: Data value, including attribute option combo in equals/hashcode.
revno: 15660 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 20:37:50 +0200 message: Data value, including attribute option combo in equals/hashcode. modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2014-03-18 08:10:10 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2014-06-12 18:37:50 + @@ -200,15 +200,19 @@ return false; } -if ( !(o instanceof DataValue) ) +if ( !getClass().isAssignableFrom( o.getClass() ) ) { return false; } final DataValue other = (DataValue) o; -return dataElement.equals( other.getDataElement() ) && categoryOptionCombo.equals( other.getCategoryOptionCombo() ) -&& period.equals( other.getPeriod() ) && source.equals( other.getSource() ); +return +dataElement.equals( other.getDataElement() ) && +period.equals( other.getPeriod() ) && +source.equals( other.getSource() ) && +categoryOptionCombo.equals( other.getCategoryOptionCombo() ) && +attributeOptionCombo.equals( other.getAttributeOptionCombo() ); } @Override @@ -217,10 +221,11 @@ final int prime = 31; int result = 1; -result = result * prime + categoryOptionCombo.hashCode(); +result = result * prime + dataElement.hashCode(); result = result * prime + period.hashCode(); -result = result * prime + dataElement.hashCode(); result = result * prime + source.hashCode(); +result = result * prime + categoryOptionCombo.hashCode(); +result = result * prime + attributeOptionCombo.hashCode(); return result; } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2014-06-12 16:30:25 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2014-06-12 18:37:50 + @@ -94,13 +94,13 @@ { String ID = TrackedEntityInstanceService.class.getName(); -public static final int ERROR_NONE = 0; - -public static final int ERROR_DUPLICATE_IDENTIFIER = 1; - -public static final int ERROR_ENROLLMENT = 2; - -public static final String SEPARATOR = "_"; +final int ERROR_NONE = 0; +final int ERROR_DUPLICATE_IDENTIFIER = 1; +final int ERROR_ENROLLMENT = 2; + +final String SEPARATOR = "_"; + +final String F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS = "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS"; /** * Returns a grid with tracked entity instance values based on the given @@ -140,6 +140,14 @@ Date eventStartDate, Date eventEndDate, boolean skipMeta, Integer page, Integer pageSize ); /** + * Decides whether current user is authorized to perform the given query. + * IllegalQueryException is thrown if not. + * + * @param params the TrackedEntityInstanceQueryParams. + */ +void decideAccess( TrackedEntityInstanceQueryParams params ); + +/** * Validates the given TrackedEntityInstanceQueryParams. The params is * considered valid if no exception are thrown and the method returns * normally. === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java 2014-03-18 08:10:10 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java 2014-06-12 18:37:50 + @@ -64,4 +64,9 @@ * in user is logged out. */ void clearCurrentUser(); + +/** + * Indicates whether the current user has been granted the given authority. + */ +boolean currenUserIsAuthorized( String auth ); } ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15661: Impl check for authority for searching across all org units
revno: 15661 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 20:38:24 +0200 message: Impl check for authority for searching across all org units modified: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java 2014-05-12 16:37:39 + +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java 2014-06-12 18:38:24 + @@ -91,4 +91,11 @@ return userCredentials.isSuper(); } + +public boolean currenUserIsAuthorized( String auth ) +{ +User user = getCurrentUser(); + +return user != null && user.getUserCredentials().isAuthorized( auth ); +} } === modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java' --- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-06-12 16:30:25 + +++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-06-12 18:38:24 + @@ -68,6 +68,7 @@ import org.hisp.dhis.system.grid.ListGrid; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService; +import org.hisp.dhis.user.CurrentUserService; import org.hisp.dhis.validation.ValidationCriteria; import org.springframework.transaction.annotation.Transactional; @@ -139,6 +140,13 @@ { this.organisationUnitService = organisationUnitService; } + +private CurrentUserService currentUserService; + +public void setCurrentUserService( CurrentUserService currentUserService ) +{ +this.currentUserService = currentUserService; +} // - // Implementation methods @@ -149,6 +157,8 @@ @Override public Grid getTrackedEntityInstances( TrackedEntityInstanceQueryParams params ) { +decideAccess( params ); + validate( params ); // - @@ -265,6 +275,15 @@ return grid; } +public void decideAccess( TrackedEntityInstanceQueryParams params ) +{ +if ( params.isOrganisationUnitMode( OrganisationUnitSelectionMode.ALL ) && +!currentUserService.currenUserIsAuthorized( F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS ) ) +{ +throw new IllegalQueryException( "Current user is not authorized to query across all organisation units" ); +} +} + @Override public void validate( TrackedEntityInstanceQueryParams params ) throws IllegalQueryException @@ -495,8 +514,7 @@ } } -updateTrackedEntityInstance( instance ); // Save instance to update - // associations +updateTrackedEntityInstance( instance ); // Update associations return id; } @@ -616,18 +634,14 @@ public ValidationCriteria validateEnrollment( TrackedEntityInstance instance, Program program, I18nFormat format ) { for ( ValidationCriteria criteria : program.getValidationCriteria() ) -{ -String value = ""; - +{ for ( TrackedEntityAttributeValue attributeValue : instance.getAttributeValues() ) { if ( attributeValue.getAttribute().getUid().equals( criteria.getProperty() ) ) { -value = attributeValue.getValue(); - +String value = attributeValue.getValue(); String type = attributeValue.getAttribute().getValueType(); -// For integer type if ( type.equals( TrackedEntityAttribute.TYPE_NUMBER ) ) { int value1 = Integer.parseInt( value ); @@ -640,7 +654,6 @@ return criteria; }
Re: [Dhis2-devs] Can I get the User Orgunit through the Web API?
Hi, if what you need is current user org unit you can use this too: http://apps.dhis2.org/dev/api/me.json Lars On Wed, Jun 11, 2014 at 8:04 AM, Knut Staring wrote: > Great, thanks. Please also see my other question about getting the Root > (or Roots, of course...) > > > On Wed, Jun 11, 2014 at 8:02 AM, Jan Henrik Øverland < > janhenrik.overl...@gmail.com> wrote: > >> organisationUnits.json?userOnly=true >> On Jun 11, 2014 7:50 AM, "Knut Staring" wrote: >> >>> I can access usersettings here: >>> http://www.dhis2.org/doc/snapshot/en/user/html/ch30s28.html >>> >>> But can I also access the usermembership table? >>> >>> -- >>> Knut Staring >>> Dept. of Informatics, University of Oslo >>> +4791880522 >>> http://dhis2.org >>> >>> ___ >>> Mailing list: https://launchpad.net/~dhis2-devs >>> Post to : dhis2-devs@lists.launchpad.net >>> Unsubscribe : https://launchpad.net/~dhis2-devs >>> More help : https://help.launchpad.net/ListHelp >>> >>> > > > -- > Knut Staring > Dept. of Informatics, University of Oslo > +4791880522 > http://dhis2.org > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15662: Minor
revno: 15662 committer: Lars Helge Overland branch nick: dhis2 timestamp: Thu 2014-06-12 21:51:51 +0200 message: Minor modified: dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java' --- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java 2014-04-28 12:39:27 + +++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java 2014-06-12 19:51:51 + @@ -91,4 +91,10 @@ { currentUser = null; } + +@Override +public boolean currenUserIsAuthorized( String auth ) +{ +return true; +} } ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15664: IE 8 fix merge
Merge authors: Mark Polak (markpo) revno: 15664 [merge] committer: Mark Polak branch nick: dhis2 timestamp: Fri 2014-06-13 02:11:31 +0200 message: IE 8 fix merge modified: dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.translate.js -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js 2014-06-11 20:02:19 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js 2014-06-13 00:10:19 + @@ -38,7 +38,15 @@ } }, getBaseUrl = (function () { -var href = window.location.origin; +var href; + +//Add window.location.origin for IE8 +if (!window.location.origin) { +window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); +} + +href = window.location.origin; + return function () { var urlParts = href.split("/"), baseUrl; === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js 2014-06-12 23:12:59 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js 2014-06-13 00:10:19 + @@ -35,7 +35,15 @@ templates = {}, cssDefaults = {}, getBaseUrl = (function () { -var href = window.location.origin; +var href; + +//Add window.location.origin for IE8 +if (!window.location.origin) { +window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); +} + +href = window.location.origin; + return function () { var urlParts = href.split("/"), baseUrl; === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.translate.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.translate.js 2014-05-12 08:02:12 + +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.translate.js 2014-06-13 00:10:19 + @@ -44,7 +44,15 @@ } }, getBaseUrl = (function () { -var href = window.location.origin; +var href; + +//Add window.location.origin for IE8 +if (!window.location.origin) { +window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); +} + +href = window.location.origin; + return function () { var urlParts = href.split("/"), baseUrl; ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] [Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 1102: Add menu in custom app section to apps chapter
Merge authors: Mark Polak (markpo) revno: 1102 [merge] committer: Mark Polak branch nick: dhis2-docbook-docs timestamp: Fri 2014-06-13 03:40:21 +0200 message: Add menu in custom app section to apps chapter added: src/docbkx/en/resources/images/apps/profileMenu.png modified: src/docbkx/en/dhis2_user_man_apps.xml -- lp:~dhis2-documenters/dhis2/dhis2-docbook-docs https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription === modified file 'src/docbkx/en/dhis2_user_man_apps.xml' --- src/docbkx/en/dhis2_user_man_apps.xml 2014-05-21 12:57:24 + +++ src/docbkx/en/dhis2_user_man_apps.xml 2014-06-13 01:37:11 + @@ -144,4 +144,124 @@ Force reload of installed apps (useful if you added a file manually in the file-system):curl -X PUT -u user:pass http://server/api/apps + +Adding the DHIS menu to your App +To keep a uniform look within DHIS it is (from DHIS 2.15) possible to add the top menu to your own app. In this section we will explain how to do this. The following will explain how to get both the Apps and the Profile menu into your app. +The first step is to adding the menu is including the stylesheets and scripts that are required. All javascript files are found in /dhis-web-commons/javascripts/dhis2/ while the css files are found in /dhis-web-commons/font-awesome/css/font-awesome.min.css and /dhis-web-commons/css/menu.css +The following list gives a small discription of what these files do. + + + Scripts: + + + jquery.min.js / jqLite / angular.element : One of the mentioned libraries needs to be present. We use the stripped down version of jqLite that is present in angular for the menu. This makes it compatible with jqLite and jQuery. + + + dhis2.translate.js : Translate script that translates menu text to your current dhis language setting + + + dhis2.menu.js : Menu logic that deals with all the ordering, searching of menu items etc. + + + dhis2/dhis2.menu.ui.js : Menu ui code that has all the menu ui related code for scolling, shortcuts, HTML markup etc. + + + Stylesheets: + + + font-awesome.min.css : Used for various icons in the menu. + + + menu.css : The CSS used for the menu. + + + dhis2.translate.js : Translate script that translates menu text to your current dhis language setting + + + + + For a app that will run using the same url structure as the normal DHIS apps the scripts and the stylesheets are the only thing you need. If your app is running using a different url structure than the default one, you will need to specify a base url before including the menu scripts. Including the scripts and stylesheets would look something like the following: + + + + + + + + + + + + + + + + To make the above a bit more clear. The following part will initialize some variables. If you do not use any other dhis libraries these will not be set and therefore will have to be set by you first. After that the 3rd line specifies a baseUrl of where your dhis instance is running on your webserver. For example: dhis in this case means the server is running at http://localhost:8080/dhis/. Note that you will only have to specify the part after the web address. So if your instance is running at http://www.example.com/myInstance/ you would only specify myInstance + + + + + + + The above will only include the neccesary scripts
[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15666: minor change
revno: 15666 committer: Morten Olav Hansen branch nick: dhis2 timestamp: Fri 2014-06-13 08:47:27 +0200 message: minor change removed: dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/SerializationFeature.java added: dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/IncludeStrategy.java modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeAnnotation.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/serializers/Jackson2JsonNodeSerializer.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/types/RootNode.java dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java -- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeAnnotation.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeAnnotation.java 2014-06-09 14:26:55 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeAnnotation.java 2014-06-13 06:47:27 + @@ -36,7 +36,7 @@ /** * @author Morten Olav Hansen */ -@Target( { ElementType.TYPE } ) +@Target( { ElementType.ANNOTATION_TYPE } ) @Retention( RetentionPolicy.RUNTIME ) public @interface NodeAnnotation { === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java 2014-06-12 18:05:28 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Configuration.java 1970-01-01 00:00:00 + @@ -1,66 +0,0 @@ -package org.hisp.dhis.node.config; - -/* - * Copyright (c) 2004-2014, 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 com.google.common.collect.ForwardingMap; -import com.google.common.collect.Maps; - -import java.util.Map; - -/** - * @author Morten Olav Hansen - */ -public class Configuration extends ForwardingMap -{ -@Override -protected Map delegate() -{ -return Maps.newHashMap(); -} - -public void enable( Feature feature ) -{ -delegate().put( feature, true ); -} - -public void disable( Feature feature ) -{ -delegate().put( feature, false ); -} - -public boolean isEnabled( Feature feature ) -{ -if ( delegate().containsKey( feature ) ) -{ -return delegate().get( feature ); -} - -return feature.defaultState(); -} -} === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java 2014-06-12 18:05:28 + +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/Feature.java 2014-06-13 06:47:27 + @@ -33,5 +33,7 @@ */ public interface Feature { -boolean defaultState(); +String key(); + +boolean defaultEnabled(); } === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/IncludeStrategy.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/config/IncludeStrategy.java 1970-01-01 00:00:00 + +++ dhis-2/dhis-api/src/mai