------------------------------------------------------------ revno: 8037 committer: Tran Chau <tran.hispviet...@gmail.com> branch nick: dhis2 timestamp: Tue 2012-09-11 20:35:26 +0700 message: Rename Comment object to PatientComment removed: dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/CommentService.java dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment/ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment/DefaultCommentService.java dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate/ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate/Comment.hbm.xml added: dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientCommentService.java dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment/ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment/DefaultPatientCommentService.java dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate/ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate/PatientComment.hbm.xml renamed: dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddCommentAction.java => dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemoveCommentAction.java => dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 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/javascript/smsReminder.js dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.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
=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment' === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java 2012-09-06 09:44:43 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java 1970-01-01 00:00:00 +0000 @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2004-2009, 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. - */ - -package org.hisp.dhis.patient.comment; - -import java.util.Date; - -/** - * @author Chau Thu Tran - * - * @version Comment.java 9:24:52 AM Aug 17, 2012 $ - */ -public class Comment -{ - private int id; - - private String commentText; - - private Date createdDate; - - private String creator; - - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public Comment() - { - - } - - public Comment( String commentText, String creator, Date createdDate ) - { - this.commentText = commentText; - this.creator = creator; - this.createdDate = createdDate; - } - - // ------------------------------------------------------------------------- - // Getters/Setters - // ------------------------------------------------------------------------- - - public int getId() - { - return id; - } - - public void setId( int id ) - { - this.id = id; - } - - public String getCommentText() - { - return commentText; - } - - public void setCommentText( String commentText ) - { - this.commentText = commentText; - } - - public Date getCreatedDate() - { - return createdDate; - } - - public void setCreatedDate( Date createdDate ) - { - this.createdDate = createdDate; - } - - public String getCreator() - { - return creator; - } - - public void setCreator( String creator ) - { - this.creator = creator; - } - - @Override - public String toString() - { - return createdDate + " - " + creator + "_" + commentText; - } - -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/CommentService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/CommentService.java 2012-08-17 06:42:32 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/CommentService.java 1970-01-01 00:00:00 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2004-2009, 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. - */ - -package org.hisp.dhis.patient.comment; - -import java.util.Collection; - -/** - * @author Chau Thu Tran - * - * @version CommentService.java 9:27:31 AM Aug 17, 2012 $ - */ -public interface CommentService -{ - String ID = CommentService.class.getName(); - - int addComment( Comment comment ); - - void deleteComment( Comment comment ); - - void updateComment( Comment comment ); - - Comment getComment( int id ); - - Collection<Comment> getAllComments(); - -} === added directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment' === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java 2012-09-11 13:35:26 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2004-2009, 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. + */ + +package org.hisp.dhis.patientcomment; + +import java.util.Date; + +/** + * @author Chau Thu Tran + * + * @version PatientComment.java 9:24:52 AM Aug 17, 2012 $ + */ +public class PatientComment +{ + private int id; + + private String commentText; + + private Date createdDate; + + private String creator; + + // ------------------------------------------------------------------------- + // Constructor + // ------------------------------------------------------------------------- + + public PatientComment() + { + + } + + public PatientComment( String commentText, String creator, Date createdDate ) + { + this.commentText = commentText; + this.creator = creator; + this.createdDate = createdDate; + } + + // ------------------------------------------------------------------------- + // Getters/Setters + // ------------------------------------------------------------------------- + + public int getId() + { + return id; + } + + public void setId( int id ) + { + this.id = id; + } + + public String getCommentText() + { + return commentText; + } + + public void setCommentText( String commentText ) + { + this.commentText = commentText; + } + + public Date getCreatedDate() + { + return createdDate; + } + + public void setCreatedDate( Date createdDate ) + { + this.createdDate = createdDate; + } + + public String getCreator() + { + return creator; + } + + public void setCreator( String creator ) + { + this.creator = creator; + } + +} === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientCommentService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientCommentService.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientCommentService.java 2012-09-11 13:35:26 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2004-2009, 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. + */ + +package org.hisp.dhis.patientcomment; + +import java.util.Collection; + +/** + * @author Chau Thu Tran + * + * @version CommentService.java 9:27:31 AM Aug 17, 2012 $ + */ +public interface PatientCommentService +{ + String ID = PatientCommentService.class.getName(); + + int addPatientComment( PatientComment patientComment ); + + void deletePatientComment( PatientComment patientComment ); + + void updatePatientComment( PatientComment patientComment ); + + PatientComment getPatientComment( int id ); + + Collection<PatientComment> getAllPatientComments(); + +} === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2012-09-07 09:18:04 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2012-09-11 13:35:26 +0000 @@ -33,7 +33,7 @@ import java.util.Set; import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.patient.comment.Comment; +import org.hisp.dhis.patientcomment.PatientComment; import org.hisp.dhis.sms.outbound.OutboundSms; /** @@ -76,7 +76,7 @@ private List<OutboundSms> outboundSms; - private Set<Comment> comments; + private Set<PatientComment> patientComments; private Integer status; @@ -256,14 +256,14 @@ this.outboundSms = outboundSms; } - public Set<Comment> getComments() + public Set<PatientComment> getPatientComments() { - return comments; + return patientComments; } - public void setComments( Set<Comment> comments ) + public void setPatientComments( Set<PatientComment> patientComments ) { - this.comments = comments; + this.patientComments = patientComments; } public Integer getStatus() === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java 2012-09-11 13:35:26 +0000 @@ -28,7 +28,6 @@ import java.util.Collection; -import org.hisp.dhis.program.Program; import org.springframework.transaction.annotation.Transactional; /** === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java 2012-09-11 13:35:26 +0000 @@ -28,7 +28,6 @@ import java.util.Collection; -import org.hisp.dhis.program.Program; import org.springframework.transaction.annotation.Transactional; /** === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment' === removed file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment/DefaultCommentService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment/DefaultCommentService.java 2012-08-17 06:42:32 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/comment/DefaultCommentService.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2004-2009, 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. - */ - -package org.hisp.dhis.patient.comment; - -import java.util.Collection; - -import org.hisp.dhis.common.GenericIdentifiableObjectStore; - -/** - * @author Chau Thu Tran - * - * @version DefaultCommentService.java 9:45:40 AM Aug 17, 2012 $ - */ -public class DefaultCommentService - implements CommentService -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private GenericIdentifiableObjectStore<Comment> commentStore; - - public void setCommentStore( GenericIdentifiableObjectStore<Comment> commentStore ) - { - this.commentStore = commentStore; - } - - // ------------------------------------------------------------------------- - // Implementation methods - // ------------------------------------------------------------------------- - - @Override - public int addComment( Comment comment ) - { - return commentStore.save( comment ); - } - - @Override - public void deleteComment( Comment comment ) - { - commentStore.delete( comment ); - } - - @Override - public void updateComment( Comment comment ) - { - commentStore.update( comment ); - } - - @Override - public Comment getComment( int id ) - { - return commentStore.get( id ); - } - - @Override - public Collection<Comment> getAllComments() - { - return commentStore.getAll(); - } - -} === added directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment' === added file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment/DefaultPatientCommentService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment/DefaultPatientCommentService.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientcomment/DefaultPatientCommentService.java 2012-09-11 13:35:26 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2009, 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. + */ + +package org.hisp.dhis.patientcomment; + +import java.util.Collection; + +import org.hisp.dhis.common.GenericIdentifiableObjectStore; + +/** + * @author Chau Thu Tran + * + * @version DefaultPatientCommentService.java 9:45:40 AM Aug 17, 2012 $ + */ +public class DefaultPatientCommentService + implements PatientCommentService +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private GenericIdentifiableObjectStore<PatientComment> patientCommentStore; + + public void setPatientCommentStore( GenericIdentifiableObjectStore<PatientComment> patientCommentStore ) + { + this.patientCommentStore = patientCommentStore; + } + + // ------------------------------------------------------------------------- + // Implementation methods + // ------------------------------------------------------------------------- + + @Override + public int addPatientComment( PatientComment patientComment ) + { + return patientCommentStore.save( patientComment ); + } + + @Override + public void deletePatientComment( PatientComment patientComment ) + { + patientCommentStore.delete( patientComment ); + } + + @Override + public void updatePatientComment( PatientComment patientComment ) + { + patientCommentStore.update( patientComment ); + } + + @Override + public PatientComment getPatientComment( int id ) + { + return patientCommentStore.get( id ); + } + + @Override + public Collection<PatientComment> getAllPatientComments() + { + return patientCommentStore.getAll(); + } + +} === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2012-09-11 04:54:34 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2012-09-11 13:35:26 +0000 @@ -375,16 +375,16 @@ <property name="jdbcTemplate" ref="jdbcTemplate" /> </bean> - <!-- Comment --> + <!-- PatientComment --> - <bean id="org.hisp.dhis.patient.comment.CommentService" - class="org.hisp.dhis.patient.comment.DefaultCommentService"> - <property name="commentStore" ref="org.hisp.dhis.patient.comment.CommentStore" /> + <bean id="org.hisp.dhis.patientcomment.PatientCommentService" + class="org.hisp.dhis.patientcomment.DefaultPatientCommentService"> + <property name="patientCommentStore" ref="org.hisp.dhis.patientcomment.PatientCommentStore" /> </bean> - <bean id="org.hisp.dhis.patient.comment.CommentStore" + <bean id="org.hisp.dhis.patientcomment.PatientCommentStore" class="org.hisp.dhis.hibernate.HibernateGenericStore"> - <property name="clazz" value="org.hisp.dhis.patient.comment.Comment" /> + <property name="clazz" value="org.hisp.dhis.patientcomment.PatientComment" /> <property name="sessionFactory" ref="sessionFactory" /> </bean> === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment' === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate' === removed file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate/Comment.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate/Comment.hbm.xml 2012-08-17 06:42:32 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/comment/hibernate/Comment.hbm.xml 1970-01-01 00:00:00 +0000 @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE hibernate-mapping PUBLIC - "-//Hibernate/Hibernate Mapping DTD 3.0//EN" - "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> - -<hibernate-mapping> - <class name="org.hisp.dhis.patient.comment.Comment" table="comment"> - - <id name="id" column="commentid"> - <generator class="native" /> - </id> - - <property name="commentText" column="commenttext"/> - - <property name="createdDate" column="createddate"/> - - <property name="creator" column="creator"/> - - </class> -</hibernate-mapping> === added directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment' === added directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate' === added file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate/PatientComment.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate/PatientComment.hbm.xml 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientcomment/hibernate/PatientComment.hbm.xml 2012-09-11 13:35:26 +0000 @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<!DOCTYPE hibernate-mapping PUBLIC + "-//Hibernate/Hibernate Mapping DTD 3.0//EN" + "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> + +<hibernate-mapping> + <class name="org.hisp.dhis.patientcomment.PatientComment" table="patientcomment"> + + <id name="id" column="patientcommentid"> + <generator class="native" /> + </id> + + <property name="commentText" column="commenttext"/> + + <property name="createdDate" column="createddate"/> + + <property name="creator" column="creator"/> + + </class> +</hibernate-mapping> === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml 2012-09-07 07:57:47 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml 2012-09-11 13:35:26 +0000 @@ -31,9 +31,9 @@ <many-to-many class="org.hisp.dhis.sms.outbound.OutboundSms" column="outboundsmsid" /> </list> - <set name="comments" order-by="createdDate desc" cascade="all"> + <set name="patientComments" order-by="createdDate desc" cascade="all"> <key column="programstageinstanceid" /> - <one-to-many class="org.hisp.dhis.patient.comment.Comment" /> + <one-to-many class="org.hisp.dhis.patientcomment.PatientComment" /> </set> <property name="status" column="status" /> === renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddCommentAction.java' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddCommentAction.java 2012-08-17 06:42:32 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java 2012-09-11 13:35:26 +0000 @@ -31,7 +31,7 @@ import java.util.HashSet; import java.util.Set; -import org.hisp.dhis.patient.comment.Comment; +import org.hisp.dhis.patientcomment.PatientComment; import org.hisp.dhis.program.ProgramStageInstance; import org.hisp.dhis.program.ProgramStageInstanceService; import org.hisp.dhis.user.CurrentUserService; @@ -41,9 +41,9 @@ /** * @author Chau Thu Tran * - * @version AddCommentAction.java 9:55:04 AM Aug 17, 2012 $ + * @version AddPatientCommentAction.java 9:55:04 AM Aug 17, 2012 $ */ -public class AddCommentAction +public class AddPatientCommentAction implements Action { // ------------------------------------------------------------------------- @@ -91,14 +91,14 @@ ProgramStageInstance programStageInstance = programStageInstanceService .getProgramStageInstance( programStageInstanceId ); - Set<Comment> comments = programStageInstance.getComments(); + Set<PatientComment> comments = programStageInstance.getPatientComments(); if ( comments == null ) { - comments = new HashSet<Comment>(); + comments = new HashSet<PatientComment>(); } - Comment comment = new Comment( commentText, currentUserService.getCurrentUsername(), new Date() ); + PatientComment comment = new PatientComment( commentText, currentUserService.getCurrentUsername(), new Date() ); comments.add( comment ); programStageInstanceService.updateProgramStageInstance( programStageInstance ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java 2012-09-06 09:44:43 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java 2012-09-11 13:35:26 +0000 @@ -32,9 +32,9 @@ import java.util.List; import java.util.Map; -import org.hisp.dhis.patient.comment.Comment; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; +import org.hisp.dhis.patientcomment.PatientComment; import org.hisp.dhis.program.ProgramStageInstance; import org.hisp.dhis.program.ProgramStageInstanceService; import org.hisp.dhis.sms.outbound.OutboundSms; @@ -80,7 +80,7 @@ private List<OutboundSms> outboundSms; - private List<Comment> comments; + private List<PatientComment> comments; private String currentUsername; @@ -115,7 +115,7 @@ return currentUsername; } - public List<Comment> getComments() + public List<PatientComment> getComments() { return comments; } @@ -147,7 +147,7 @@ outboundSms = new ArrayList<OutboundSms>( programStageInstance.getOutboundSms() ); - comments = new ArrayList<Comment>( programStageInstance.getComments() ); + comments = new ArrayList<PatientComment>( programStageInstance.getPatientComments() ); currentUsername = currentUserService.getCurrentUsername(); === renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemoveCommentAction.java' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemoveCommentAction.java 2012-08-17 06:42:32 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java 2012-09-11 13:35:26 +0000 @@ -27,11 +27,8 @@ package org.hisp.dhis.caseentry.action.reminder; -import java.util.ArrayList; -import java.util.List; - -import org.hisp.dhis.patient.comment.Comment; -import org.hisp.dhis.patient.comment.CommentService; +import org.hisp.dhis.patientcomment.PatientComment; +import org.hisp.dhis.patientcomment.PatientCommentService; import org.hisp.dhis.program.ProgramStageInstance; import org.hisp.dhis.program.ProgramStageInstanceService; @@ -40,9 +37,9 @@ /** * @author Chau Thu Tran * - * @version RemoveCommentAction.java 10:02:15 AM Aug 17, 2012 $ + * @version RemovePatientCommentAction.java 10:02:15 AM Aug 17, 2012 $ */ -public class RemoveCommentAction +public class RemovePatientCommentAction implements Action { @@ -57,9 +54,9 @@ this.programStageInstanceService = programStageInstanceService; } - private CommentService commentService; + private PatientCommentService commentService; - public void setCommentService( CommentService commentService ) + public void setCommentService( PatientCommentService commentService ) { this.commentService = commentService; } @@ -88,12 +85,12 @@ public String execute() { - Comment comment = commentService.getComment( id ); + PatientComment patientComment = commentService.getPatientComment( id ); ProgramStageInstance programStageInstance = programStageInstanceService .getProgramStageInstance( programStageInstanceId ); - programStageInstance.getComments().remove( comment ); + programStageInstance.getPatientComments().remove( patientComment ); programStageInstanceService.updateProgramStageInstance( programStageInstance ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-11 07:31:17 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-11 13:35:26 +0000 @@ -1021,18 +1021,18 @@ <!-- Comment --> - <bean id="org.hisp.dhis.caseentry.action.reminder.AddCommentAction" - class="org.hisp.dhis.caseentry.action.reminder.AddCommentAction" + <bean id="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction" + class="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction" scope="prototype"> <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" /> <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" /> </bean> - <bean id="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction" - class="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction" + <bean id="org.hisp.dhis.caseentry.action.reminder.RemovePatientCommentAction" + class="org.hisp.dhis.caseentry.action.reminder.RemovePatientCommentAction" scope="prototype"> - <property name="commentService" ref="org.hisp.dhis.patient.comment.CommentService" /> + <property name="commentService" ref="org.hisp.dhis.patientcomment.PatientCommentService" /> <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" /> </bean> === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-09-07 09:53:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-09-11 13:35:26 +0000 @@ -974,14 +974,14 @@ <!-- Comment --> - <action name="addComment" - class="org.hisp.dhis.caseentry.action.reminder.AddCommentAction"> + <action name="addPatientComment" + class="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction"> <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm </result> </action> - <action name="removeComment" - class="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction"> + <action name="removePatientComment" + class="org.hisp.dhis.caseentry.action.reminder.RemovePatientCommentAction"> <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm </result> </action> === 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 2012-09-07 07:57:47 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm 2012-09-11 13:35:26 +0000 @@ -12,7 +12,7 @@ #set($index = 0) #set( $mark = false ) #foreach($programStageInstance in $programStageInstances) - #foreach( $comment in $programStageInstance.comments ) + #foreach( $comment in $programStageInstance.patientComments ) #if( $index < 5 ) <tr id="comment_$comment.id" #alternate($mark)> <td>$format.formatDate($comment.createdDate)</td> @@ -43,7 +43,7 @@ <tbody id='moreComments' class='hidden'> #foreach($programStageInstance in $programStageInstances) - #foreach( $comment in $programStageInstance.comments ) + #foreach( $comment in $programStageInstance.patientComments ) #if( $index >= 5 ) <tr id="comment_$comment.id" #alternate($mark)> <td>$format.formatDate($comment.createdDate)</td> === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-09-07 08:08:36 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-09-11 13:35:26 +0000 @@ -206,7 +206,7 @@ var commentText = getFieldValue( 'commentText' ); if( commentText != '') { - jQuery.postUTF8( 'addComment.action', + jQuery.postUTF8( 'addPatientComment.action', { programStageInstanceId: programStageInstanceId, commentText: commentText @@ -225,7 +225,7 @@ function removeComment( programStageInstanceId, commentId ) { - jQuery.postUTF8( 'removeComment.action', + jQuery.postUTF8( 'removePatientComment.action', { programStageInstanceId:programStageInstanceId, id: commentId === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-11 07:31:17 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-11 13:35:26 +0000 @@ -1,6 +1,7 @@ <h4>$programInstance.program.name</h4> <input type='hidden' id='programInstanceId' name='programInstanceId' value='$programInstance.id' /> <input type='hidden' id='patientId' name='patientId' value='$programInstance.patient.id' /> +<input type='hidden' id='currentUsername' name='currentUsername' value='$currentUsername'> <table> <tr> === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2012-09-11 09:52:55 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2012-09-11 13:35:26 +0000 @@ -67,7 +67,7 @@ <td> #set($title="") #set($index = 0) - #foreach( $comment in $programStageInstance.comments) + #foreach( $comment in $programStageInstance.patientComments) #if( $index < 5) #set( $title= $title + "$format.formatDate( $comment.createdDate ) - $comment.creator - $comment.commentText " ) #set( $index = $index + 1 )
_______________________________________________ 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