Author: solomax
Date: Wed Oct 14 14:02:58 2015
New Revision: 1708603

URL: http://svn.apache.org/viewvc?rev=1708603&view=rev
Log:
[OPENMEETINGS-1268] calendar service is fixed to return DTOs only

Added:
    
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/calendar/AppointmentCategoryDTO.java
Modified:
    
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebService.java
    
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebServiceFacade.java
    
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/room/RoomDTO.java
    
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
    
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java

Modified: 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebService.java?rev=1708603&r1=1708602&r2=1708603&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebService.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebService.java
 Wed Oct 14 14:02:58 2015
@@ -34,10 +34,10 @@ import org.apache.openmeetings.db.dao.ca
 import org.apache.openmeetings.db.dao.room.RoomTypeDao;
 import org.apache.openmeetings.db.dao.server.SessiondataDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.dto.calendar.AppointmentCategoryDTO;
 import org.apache.openmeetings.db.dto.calendar.AppointmentDTO;
 import org.apache.openmeetings.db.dto.calendar.AppointmentReminderTypeDTO;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
-import org.apache.openmeetings.db.entity.calendar.AppointmentCategory;
 import org.apache.openmeetings.db.entity.calendar.AppointmentReminderTyps;
 import org.apache.openmeetings.db.entity.calendar.MeetingMember;
 import org.apache.openmeetings.db.entity.user.User;
@@ -492,25 +492,14 @@ public class CalendarWebService {
         * @param SID
         * @return - all categories of calendar events
         */
-       public List<AppointmentCategory> getAppointmentCategoryList(String SID) 
{
+       public List<AppointmentCategoryDTO> getAppointmentCategoryList(String 
SID) {
                
log.debug("AppointmenetCategoryService.getAppointmentCategoryList SID : " + 
SID);
 
                try {
                        Long users_id = sessiondataDao.checkSession(SID);
 
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-                               List<AppointmentCategory> res = 
appointmentCategoryDao.getAppointmentCategoryList();
-
-                               if (res == null || res.size() < 1) {
-                                       log.debug("no AppointmentCategories 
found");
-                               } else {
-                                       for (int i = 0; i < res.size(); i++) {
-                                               AppointmentCategory ac = 
res.get(i);
-                                               log.debug("found appCategory : 
" + ac.getName());
-                                       }
-                               }
-
-                               return res;
+                               return 
AppointmentCategoryDTO.list(appointmentCategoryDao.getAppointmentCategoryList());
                        } else {
                                
log.error("AppointmenetCategoryService.getAppointmentCategoryList : UserLevel 
Error");
                        }

Modified: 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebServiceFacade.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebServiceFacade.java?rev=1708603&r1=1708602&r2=1708603&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebServiceFacade.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/CalendarWebServiceFacade.java
 Wed Oct 14 14:02:58 2015
@@ -23,9 +23,9 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.axis2.AxisFault;
+import org.apache.openmeetings.db.dto.calendar.AppointmentCategoryDTO;
 import org.apache.openmeetings.db.dto.calendar.AppointmentDTO;
 import org.apache.openmeetings.db.dto.calendar.AppointmentReminderTypeDTO;
-import org.apache.openmeetings.db.entity.calendar.AppointmentCategory;
 
 public class CalendarWebServiceFacade extends BaseWebService {
        
@@ -88,7 +88,7 @@ public class CalendarWebServiceFacade ex
                return 
getBean(CalendarWebService.class).getAppointmentByRoomId(SID, room_id);
        }
 
-       public List<AppointmentCategory> getAppointmentCategoryList(String SID) 
throws AxisFault {
+       public List<AppointmentCategoryDTO> getAppointmentCategoryList(String 
SID) throws AxisFault {
                return 
getBean(CalendarWebService.class).getAppointmentCategoryList(SID);
        }
 

Added: 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/calendar/AppointmentCategoryDTO.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/calendar/AppointmentCategoryDTO.java?rev=1708603&view=auto
==============================================================================
--- 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/calendar/AppointmentCategoryDTO.java
 (added)
+++ 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/calendar/AppointmentCategoryDTO.java
 Wed Oct 14 14:02:58 2015
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.db.dto.calendar;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.openmeetings.db.entity.calendar.AppointmentCategory;
+
+public class AppointmentCategoryDTO {
+       private Long id;
+       private String name;
+       private Date inserted;
+       private Date updated;
+       private boolean deleted;
+       private String comment;
+       
+       public AppointmentCategoryDTO() {}
+       
+       public AppointmentCategoryDTO(AppointmentCategory c) {
+               this.id = c.getCategoryId();
+               this.name = c.getName();
+               this.inserted = c.getStarttime();
+               this.updated = c.getUpdatetime();
+               this.deleted = c.getDeleted();
+               this.comment = c.getComment();
+       }
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public Date getInserted() {
+               return inserted;
+       }
+
+       public void setInserted(Date inserted) {
+               this.inserted = inserted;
+       }
+
+       public Date getUpdated() {
+               return updated;
+       }
+
+       public void setUpdated(Date updated) {
+               this.updated = updated;
+       }
+
+       public boolean isDeleted() {
+               return deleted;
+       }
+
+       public void setDeleted(boolean deleted) {
+               this.deleted = deleted;
+       }
+
+       public String getComment() {
+               return comment;
+       }
+
+       public void setComment(String comment) {
+               this.comment = comment;
+       }
+       
+       public static List<AppointmentCategoryDTO> 
list(List<AppointmentCategory> l) {
+               List<AppointmentCategoryDTO> rList = new ArrayList<>();
+               if (l != null) {
+                       for (AppointmentCategory c : l) {
+                               rList.add(new AppointmentCategoryDTO(c));
+                       }
+               }
+               return rList;
+       }
+}

Modified: 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/room/RoomDTO.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/room/RoomDTO.java?rev=1708603&r1=1708602&r2=1708603&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/room/RoomDTO.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dto/room/RoomDTO.java
 Wed Oct 14 14:02:58 2015
@@ -129,7 +129,7 @@ public class RoomDTO {
        }
 
        public static List<RoomDTO> list(List<Room> l) {
-               List<RoomDTO> rList = new ArrayList<RoomDTO>();
+               List<RoomDTO> rList = new ArrayList<>();
                if (l != null) {
                        for (Room r : l) {
                                rList.add(new RoomDTO(r));

Modified: 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java?rev=1708603&r1=1708602&r2=1708603&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
 Wed Oct 14 14:02:58 2015
@@ -28,6 +28,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlType;
 
 import org.simpleframework.xml.Element;
 import org.simpleframework.xml.Root;
@@ -36,7 +37,9 @@ import org.simpleframework.xml.Root;
 @Table(name = "sipusers")
 @Root(name="asterisksipuser")
 public class AsteriskSipUser implements Serializable {
-       private static final long serialVersionUID = -565831761546365623L;
+       private static final long serialVersionUID = 1L;
+       
+       @XmlType(namespace="org.apache.openmeetings.user.asterisk")
        public enum Type {
                friend,
                user,

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java?rev=1708603&r1=1708602&r2=1708603&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/AsteriskSipUser.java
 Wed Oct 14 14:02:58 2015
@@ -38,6 +38,7 @@ import org.simpleframework.xml.Root;
 @Root(name="asterisksipuser")
 public class AsteriskSipUser implements Serializable {
        private static final long serialVersionUID = 1L;
+       
        @XmlType(namespace="org.apache.openmeetings.user.asterisk")
        public enum Type {
                friend,


Reply via email to