You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by es...@apache.org on 2012/02/22 05:50:36 UTC
svn commit: r1292126 - in /incubator/openmeetings/branches/jira-plugin/src:
main/java/org/openmeetings/jira/plugin/ao/omrooms/
main/java/org/openmeetings/jira/plugin/jira/customfields/
main/java/org/openmeetings/jira/plugin/servlet/ main/resources/ mai...
Author: eschwert
Date: Wed Feb 22 04:50:35 2012
New Revision: 1292126
URL: http://svn.apache.org/viewvc?rev=1292126&view=rev
Log:
OPENMEETINGS-60 New Custom Filed select-room-list jira issues
Added:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/edit.vm
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/view.vm
incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectListTest.java
Removed:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomNameField.java
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-name-field/
Modified:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomService.java
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomServiceImpl.java
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.properties
incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.xml
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/edit.vm
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/list.vm
incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/new.vm
incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmGatawayTest.java
incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmRestServiceTest.java
Modified: incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomService.java?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomService.java (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomService.java Wed Feb 22 04:50:35 2012
@@ -18,4 +18,6 @@ public interface RoomService
Room getRoom(Integer id);
List<Room> all();
+
+ List<Room> allNotDeleted();
}
\ No newline at end of file
Modified: incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomServiceImpl.java?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomServiceImpl.java (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/ao/omrooms/RoomServiceImpl.java Wed Feb 22 04:50:35 2012
@@ -4,6 +4,8 @@ import com.atlassian.activeobjects.exter
import java.util.List;
+import net.java.ao.Query;
+
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.newArrayList;
@@ -30,6 +32,7 @@ public final class RoomServiceImpl imple
room.setRoomType(roomType);
room.setRoomId(roomId);
room.setCreatedByUserId(createdByUserId);
+ room.setIsDeleted(false);
room.save();
return room;
}
@@ -39,6 +42,12 @@ public final class RoomServiceImpl imple
{
return newArrayList(ao.find(Room.class));
}
+
+ @Override
+ public List<Room> allNotDeleted()
+ {
+ return newArrayList(ao.find(Room.class, Query.select().where("IS_DELETED LIKE ?", false).limit(10)));
+ }
@Override
public Room update(Integer id, boolean isAllowedRecording,
Added: incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java?rev=1292126&view=auto
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java (added)
+++ incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java Wed Feb 22 04:50:35 2012
@@ -0,0 +1,99 @@
+package org.openmeetings.jira.plugin.jira.customfields;
+
+import org.openmeetings.jira.plugin.ao.omrooms.Room;
+import org.openmeetings.jira.plugin.ao.omrooms.RoomService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.atlassian.jira.issue.context.JiraContextNode;
+import com.atlassian.jira.issue.customfields.converters.SelectConverter;
+import com.atlassian.jira.issue.customfields.converters.StringConverter;
+import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
+import com.atlassian.jira.issue.customfields.manager.OptionsManager;
+import com.atlassian.jira.issue.customfields.option.Options;
+import com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister;
+import com.atlassian.jira.issue.customfields.persistence.PersistenceFieldType;
+import com.atlassian.jira.issue.customfields.view.CustomFieldParams;
+import com.atlassian.jira.issue.Issue;
+import com.atlassian.jira.issue.fields.CustomField;
+import com.atlassian.jira.issue.fields.config.FieldConfig;
+import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem;
+
+import java.util.List;
+import java.util.Map;
+
+import com.atlassian.jira.issue.customfields.impl.SelectCFType;
+import com.atlassian.jira.util.ErrorCollection;
+
+public class RoomSelectList extends SelectCFType {
+ private static final Logger log = LoggerFactory.getLogger(RoomSelectList.class);
+ //private final OptionsManager optionsManager;
+ //private static SelectConverter selectConverter;
+ private final RoomService roomService;
+
+ public RoomSelectList(CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, SelectConverter selectConverter, OptionsManager optionsManager, GenericConfigManager genericConfigManager, RoomService roomService) {
+ super(customFieldValuePersister, stringConverter, selectConverter, optionsManager, genericConfigManager);
+ this.roomService = roomService;
+ //this.optionsManager = optionsManager;
+}
+
+ @Override
+ public Map<String, Object> getVelocityParameters(final Issue issue,
+ final CustomField field,
+ final FieldLayoutItem fieldLayoutItem) {
+ final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);
+
+ // This method is also called to get the default value, in
+ // which case issue is null so we can't use it to add currencyLocale
+ if (issue == null) {
+ return map;
+ }
+
+ FieldConfig fieldConfig = field.getRelevantConfig(issue);
+ //add what you need to the map here
+ //field.getValue(issue);
+
+ //fieldConfig.getConfigItems().get(1);
+ //getValueFromIssue
+ //Object param = issue.getCustomFieldValue(field);
+ //map.put("param", param);
+
+ List<Room> rooms = roomService.allNotDeleted();
+
+ map.put("rooms", rooms);
+ //map.put("value", param);
+
+ return map;
+ }
+
+ @Override
+ public PersistenceFieldType getDatabaseType()
+ {
+ return PersistenceFieldType.TYPE_LIMITED_TEXT;
+ }
+
+ @Override
+ public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
+ {
+
+ }
+
+// @Override
+// public Options getOptions(FieldConfig config, JiraContextNode jiraContextNode)
+// {
+// return this.optionsManager.getOptions(config);
+// }
+
+// @Override
+// public Object getValueFromIssue(CustomField field, Issue issue){
+//
+// issue.getCustomFieldValue(field);
+// return issue;
+//
+// }
+//
+// public Options getOptions(FieldConfig config, JiraContextNode jiraContextNode)
+// {
+// return this.optionsManager.getOptions(config);
+// }
+}
\ No newline at end of file
Modified: incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java Wed Feb 22 04:50:35 2012
@@ -79,7 +79,7 @@ public final class RoomsServlet extends
}else if("y".equals(req.getParameter("edit"))){
// Renders edit.vm template if the "edit" parameter is passed
- Integer id = Integer.valueOf(req.getParameter("id"));
+ Integer id = Integer.valueOf(req.getParameter("key"));
// Boolean isAllowedRecording = Boolean.valueOf(req.getParameter("isAllowedRecording"));
// Boolean isAudioOnly = Boolean.valueOf(req.getParameter("isAudioOnly"));
// Boolean isModeratedRoom = Boolean.valueOf(req.getParameter("isModeratedRoom"));
@@ -106,41 +106,20 @@ public final class RoomsServlet extends
templateRenderer.render(EDIT_BROWSER_TEMPLATE, context, res.getWriter());
}else if("y".equals(req.getParameter("delete"))){
-
-
+ Integer id = Integer.valueOf(req.getParameter("key"));
+ roomService.delete(id);
+ res.sendRedirect(req.getContextPath() + "/plugins/servlet/openmeetingsrooms");
}else {
// Render the list of issues (list.vm) if no params are passed in
- List<Room> rooms = roomService.all();
+ //List<Room> rooms = roomService.all();
+ List<Room> rooms = roomService.allNotDeleted();
Map<String, Object> context = Maps.newHashMap();
context.put("rooms", rooms);
res.setContentType("text/html;charset=utf-8");
// Pass in the list of rooms as the context
templateRenderer.render(LIST_BROWSER_TEMPLATE, context, res.getWriter());
- }
+ }
-
-
- final PrintWriter w = res.getWriter();
- w.write("<h1>Rooms</h1>");
-
- // the form to post more TODOs
- w.write("<form method=\"post\">");
- w.write("<input type=\"text\" name=\"task\" size=\"25\"/>");
- w.write(" ");
- w.write("<input type=\"submit\" name=\"submit\" value=\"Add\"/>");
- w.write("</form>");
-
- w.write("<ol>");
-
- for (Room room : roomService.all())
- {
- w.printf("<li><%2$s> %s </%2$s></li>", room.getName(), room.getIsModeratedRoom() ? "strike" : "strong");
- }
-
- w.write("</ol>");
- w.write("<script language='javascript'>document.forms[0].elements[0].focus();</script>");
-
- w.close();
}
@Override
@@ -158,8 +137,12 @@ public final class RoomsServlet extends
String roomName = req.getParameter("roomname");
Long numberOfParticipent = Long.valueOf(req.getParameter("numberOfParticipent"));
Long roomType = Long.valueOf(req.getParameter("roomType"));
- Integer id = Integer.valueOf(req.getParameter("id"));
- Long roomId = Long.valueOf(req.getParameter("roomId"));
+ Integer id = Integer.valueOf(req.getParameter("key"));
+ //Long roomId = Long.valueOf(req.getParameter("roomId"));
+
+ //Get RoomId for updating room from DB
+ Room room = roomService.getRoom(id);
+ Long roomId = room.getRoomId();
try {
if(omGateway.loginUser()){
@@ -188,13 +171,13 @@ public final class RoomsServlet extends
e.printStackTrace();
}
-
-
roomService.update(id, isAllowedRecording, isAudioOnly, isModeratedRoom, roomName, numberOfParticipent, roomType);
- //roomService.add(description, true, true, true, "name", 4L, 1L);
-
res.sendRedirect(req.getContextPath() + "/plugins/servlet/openmeetingsrooms");
+ }else if("y".equals(req.getParameter("delete"))){
+ Integer id = Integer.valueOf(req.getParameter("key"));
+ roomService.delete(id);
+ res.sendRedirect(req.getContextPath() + "/plugins/servlet/openmeetingsrooms");
}else{
Boolean isAllowedRecording = Boolean.valueOf(req.getParameter("isAllowedRecording"));
Modified: incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.properties
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.properties?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.properties (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.properties Wed Feb 22 04:50:35 2012
@@ -1,8 +1,10 @@
#
-#Thu Feb 09 19:45:49 CET 2012
+#Tue Feb 21 00:25:25 CET 2012
+room-select-list.description=The Room Select List Plugin
room-name-field.name=Room Name Field
room-name-field.description=The Room Name Field Plugin
-my-class.name=My Class
-my-class.description=The My Class Plugin
+room-select-list.name=Room Select List
openmeetings-crud.name=Openmeetings CRUD
+my-class.description=The My Class Plugin
+my-class.name=My Class
openmeetings-crud.description=The Openmeetings CRUD Plugin
Modified: incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.xml?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.xml (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/atlassian-plugin.xml Wed Feb 22 04:50:35 2012
@@ -8,23 +8,20 @@
<!--<param name="configure.url">/secure/OmConfig.jspa</param>-->
<param name="configure.url">/plugins/servlet/openmeetingsadmin</param>
</plugin-info>
-
- <web-section key="om_config_section" location="integrations_section">
+ <web-section key="om_config_section" location="integrations_section">
<label key="OpenMeetings Setup"/>
</web-section>
-
<web-item key="om_config" section="integrations_section/om_config_section">
<label>Server Setup</label>
<link linkId="admin_link" absolute="false">/plugins/servlet/openmeetingsadmin</link>
</web-item>
-
<web-section key="my_links_section" name="My Links Main Section" location="my_links_link" weight="10">
- <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
+ <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
</web-section>
<web-item key="my_links_link" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47">
<label>OpenMeetings</label>
<link linkId="my_links_link"/>
- <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
+ <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
</web-item>
<web-item key="website_link" name="Rooms Web Site" section="my_links_link/my_links_section" weight="10">
<label>Rooms</label>
@@ -33,52 +30,38 @@
<web-item key="create_room_link" name="Create Room Web Site" section="my_links_link/my_links_section" weight="10">
<label>Create Room</label>
<link linkId="create_room_link" absolute="false">/plugins/servlet/openmeetingsrooms?new=y</link>/>
- </web-item>
-
+ </web-item>
<servlet name="Openmeetings admin" i18n-name-key="openmeetings-admin.name" key="openmeetings-admin" class="org.openmeetings.jira.plugin.servlet.AdminServlet">
<description key="openmeetings-admin.description">The Openmeetings Admin Plugin</description>
<url-pattern>/openmeetingsadmin</url-pattern>
- </servlet>
+ </servlet>
<servlet name="Openmeetings Rooms" i18n-name-key="openmeetings-room.name" key="openmeetings-room" class="org.openmeetings.jira.plugin.servlet.RoomsServlet">
<description key="openmeetings-room.description">The Openmeetings Rooms Plugin</description>
<url-pattern>/openmeetingsrooms</url-pattern>
</servlet>
-
<resource type="i18n" name="i18n" location="atlassian-plugin"/>
-
<component-import key="templateRenderer" interface="com.atlassian.templaterenderer.TemplateRenderer"/>
- <component-import key="userManager" interface="com.atlassian.sal.api.user.UserManager"/>
-
- <customfield-type name="Room Name Field" i18n-name-key="room-name-field.name" key="room-name-field" class="org.openmeetings.jira.plugin.jira.customfields.RoomNameField">
- <description key="room-name-field.description">The Room Name Field Plugin</description>
- <resource name="view" type="velocity" location="/templates/customfields/room-name-field/view.vm"/>
- <resource name="edit" type="velocity" location="/templates/customfields/room-name-field/edit.vm"/>
- </customfield-type>
+ <component-import key="userManager" interface="com.atlassian.sal.api.user.UserManager"/>
+ <customfield-type name="Room Select List" i18n-name-key="room-select-list.name" key="room-select-list" class="org.openmeetings.jira.plugin.jira.customfields.RoomSelectList">
+ <description key="room-select-list.description">The Room Select List Plugin allow to select one OpenMeetings room from roomlist.</description>
+ <resource name="view" type="velocity" location="/templates/customfields/room-select-list/view.vm"/>
+ <resource name="edit" type="velocity" location="/templates/customfields/room-select-list/edit.vm"/>
+ </customfield-type>
+ <!--AO to persist chosen admin configuration -->
+ <ao key="openmeetings-ao-module">
+ <description>The module configuring the Active Objects service used by JIRA-OPENMEETINGS plugin</description>
+ <entity>org.openmeetings.jira.plugin.ao.omrooms.Room</entity>
+ </ao>
+ <component-import key="ao" name="Active Objects components" interface="com.atlassian.activeobjects.external.ActiveObjects">
+ <description>Access to the Active Objects service</description>
+ </component-import>
+ <component-import key="pluginSettingsFactory" interface="com.atlassian.sal.api.pluginsettings.PluginSettingsFactory"/>
+ <component key="tx-processor" name="Transactional Annotation Processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
+ <decription>Processes @Transactional annotations.</decription>
+ </component>
+ <component key="room-service" name="Room Service" class="org.openmeetings.jira.plugin.ao.omrooms.RoomServiceImpl"/>
+ <component key="omPluginSettings" name="OpenMeetings Plugin Settings" class="org.openmeetings.jira.plugin.ao.adminconfiguration.OmPluginSettings"/>
+ <component key="omRestService" name="OpenMeetings REST Service" class="org.openmeetings.jira.plugin.gateway.OmRestService"/>
+ <component key="omGateway" name="OpenMeetings Gateway" class="org.openmeetings.jira.plugin.gateway.OmGateway"/>
- <!--AO to persist chosen admin configuration -->
- <ao key="openmeetings-ao-module">
- <description>The module configuring the Active Objects service used by JIRA-OPENMEETINGS plugin</description>
- <entity>org.openmeetings.jira.plugin.ao.omrooms.Room</entity>
- </ao>
-
- <component-import key="ao" name="Active Objects components"
- interface="com.atlassian.activeobjects.external.ActiveObjects">
- <description>Access to the Active Objects service</description>
- </component-import>
-
- <component-import key="pluginSettingsFactory" interface="com.atlassian.sal.api.pluginsettings.PluginSettingsFactory" />
-
- <component key="tx-processor" name="Transactional Annotation Processor"
- class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
- <decription>Processes @Transactional annotations.</decription>
- </component>
-
- <component key="room-service" name="Room Service" class="org.openmeetings.jira.plugin.ao.omrooms.RoomServiceImpl"/>
-
- <component key="omPluginSettings" name="OpenMeetings Plugin Settings" class="org.openmeetings.jira.plugin.ao.adminconfiguration.OmPluginSettings"/>
-
- <component key="omRestService" name="OpenMeetings REST Service" class="org.openmeetings.jira.plugin.gateway.OmRestService"/>
-
- <component key="omGateway" name="OpenMeetings Gateway" class="org.openmeetings.jira.plugin.gateway.OmGateway"/>
-
</atlassian-plugin>
Added: incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/edit.vm
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/edit.vm?rev=1292126&view=auto
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/edit.vm (added)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/edit.vm Wed Feb 22 04:50:35 2012
@@ -0,0 +1,12 @@
+#customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams)
+<select class="select" name="$customField.id" id="$customField.id">
+ #if (!$fieldLayoutItem || $fieldLayoutItem.required == false)
+ <option value="-1">$i18n.getText("common.words.none")</option>
+ #else
+ <option value="">$i18n.getText("common.words.none")</option>
+ #end
+ #foreach ($option in $rooms)
+ <option value=$option.getRoomId()>$option.getName()</option>
+ #end
+</select>
+#customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)
\ No newline at end of file
Added: incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/view.vm
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/view.vm?rev=1292126&view=auto
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/view.vm (added)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/customfields/room-select-list/view.vm Wed Feb 22 04:50:35 2012
@@ -0,0 +1,6 @@
+#if ($value)
+ RoomURL: "$!value.toString()"
+#else
+undefined
+System.out.println("value view.vm", $value)
+#end
\ No newline at end of file
Modified: incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/edit.vm
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/edit.vm?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/edit.vm (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/edit.vm Wed Feb 22 04:50:35 2012
@@ -1,13 +1,13 @@
<html>
<head>
- <title>Edit Issue — Issue CRUD Tutorial</title>
+ <title>Edit Room — Room Edit</title>
<meta name="decorator" content="atl.general">
</head>
<body class="page-type-admin">
<div class="content-container">
<div class="content-body">
- <h1>Edit issue $issue.getKey()</h1>
+ <h1>Edit Room $room.getName()</h1>
#if ($errors.size()>0)
<div class="aui-message error shadowed">
@@ -21,30 +21,74 @@
<!-- .aui-message -->
#end
+ <h1>Create Room</h1>
<div class="create-issue-panel">
- <form method="post" id="h" action="openmeetingscrud" class="aui">
- <input type="hidden" name="edit" value="y">
- <input type="hidden" name="key" value="$issue.getKey()">
+ <form method="post" id="h" action="openmeetingsrooms" class="aui">
+ <input type="hidden" name="edit" value="y">
+ <input type="hidden" name="key" value=$room.getID()>
<div class="field-group">
- <label for="h-fsummary">
- Summary
+ <label for="h-froomname">
+ Roomname
<span class="aui-icon icon-required"></span>
<span class="content">required</span>
</label>
- <input id="h-fsummary" class="text long-field" type="text" name="summary" value="$issue.getSummary()">
+ <input id="h-froomname" class="text long-field" type="text" name="roomname" value="$room.getName()">
</div>
<div class="field-group">
- <label for="h-fdescription">
- Description
- <span class="aui-icon icon-required"></span>
- <span class="content">required</span>
+ <label for="h-froomtype">
+ Roomtype
+ </label>
+ <select name="roomType" id="om-roomtype" style="width: 30%;">
+ <option value="1">Conference</option>
+ <option value="2" #if ("$room.getRoomType()" == "2")selected#end>Interview</option>
+ <option value="3" #if ("$room.getRoomType()" == "3")selected#end>20</option>
+ <option value="4" #if ("$room.getRoomType()" == "4")selected#end>30</option>
+ <option value="5" #if ("$room.getRoomType()" == "5")selected#end>60</option>
+ </select>
+ </div>
+ <div class="field-group">
+ <label for="h-fnr-participent">
+ Nr. of Participent
+ </label>
+ <select name="numberOfParticipent" id="om-participent" style="width: 30%;">
+ <option value="5" #if ("$room.getNumberOfParticipent()" == "5")selected#end>5</option>
+ <option value="10" #if ("$room.getNumberOfParticipent()" == "10")selected#end>10</option>
+ <option value="20" #if ("$room.getNumberOfParticipent()" == "20")selected#end>20</option>
+ <option value="30" #if ("$room.getNumberOfParticipent()" == "30")selected#end>30</option>
+ <option value="60" #if ("$room.getNumberOfParticipent()" == "60")selected#end>60</option>
+ </select>
+ </div>
+ <div class="field-group">
+ <label for="h-fmoderated">
+ Is moderated
+ </label>
+ <select name="isModeratedRoom" id="om-is-moderated" style="width: 30%;">
+ <option value="false" #if ("$room.getIsModeratedRoom()" == "false")selected#end>No</option>
+ <option value="true" #if ("$room.getIsModeratedRoom()" == "true")selected#end>Yes</option>
+ </select>
+ </div>
+ <div class="field-group">
+ <label for="h-faudioonly">
+ Is audio only
+ </label>
+ <select name="isAudioOnly" id="om-is-moderated" style="width: 30%;">
+ <option value="false" #if ("$room.getIsAudioOnly()" == "false")selected#end>No</option>
+ <option value="true" #if ("$room.getIsAudioOnly()" == "true")selected#end>Yes</option>
+ </select>
+ </div>
+ <div class="field-group">
+ <label for="h-fallow-recording">
+ Allow Recording
</label>
- <textarea id="h-fdescription" name="description">$issue.getDescription()</textarea>
+ <select name="isAllowedRecording" id="om-allow-recording" style="width: 30%;">
+ <option value="false" #if ("$room.getIsAllowedRecording()" == "false")selected#end>No</option>
+ <option value="true" #if ("$room.getIsAllowedRecording()" == "true")selected#end>Yes</option>
+ </select>
</div>
<div class="buttons">
- <input class="button" type="submit" value="Update">
- <a href="openmeetingscrud">Cancel</a>
+ <input class="button" type="submit" value="Save">
+ <a href="openmeetingsrooms">Cancel</a>
</div>
</form>
</div>
Modified: incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/list.vm
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/list.vm?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/list.vm (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/list.vm Wed Feb 22 04:50:35 2012
@@ -75,8 +75,8 @@
$room.getIsAudioOnly()
</td>
<td>
- <a href="openmeetingsrooms?edit=y&key=$room.getKey()">Edit</a>
- <a href="#" class="delete-room" data-key="$room.getKey()">Delete</a>
+ <a href="openmeetingsrooms?edit=y&key=$room.getID()">Edit</a>
+ <a href="openmeetingsrooms?delete=y&key=$room.getID()" class="delete-room" data-key="$room.getID()">Delete</a>
</td>
</tr>
#end
Modified: incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/new.vm
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/new.vm?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/new.vm (original)
+++ incubator/openmeetings/branches/jira-plugin/src/main/resources/templates/omrooms/new.vm Wed Feb 22 04:50:35 2012
@@ -7,7 +7,7 @@
<div class="content-container">
<div class="content-body">
- <h1>Create issue</h1>
+ <h1>Create Room</h1>
<div class="create-issue-panel">
<form method="post" id="h" action="openmeetingsrooms" class="aui">
Modified: incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmGatawayTest.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmGatawayTest.java?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmGatawayTest.java (original)
+++ incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmGatawayTest.java Wed Feb 22 04:50:35 2012
@@ -85,40 +85,40 @@ public class OmGatawayTest {
@Test
public void testAddRoomWithModerationExternalTypeAndTopBarOption() throws XPathExpressionException, IOException, ServletException, SAXException, ParserConfigurationException, DocumentException{
- this.testLogin();
-
- String roomname = "test test";
-
- String testURL = "http://localhost:5080/openmeetings/services/RoomService/addRoomWithModerationExternalTypeAndTopBarOption?" +
- "SID="+this.getSessionId()+
- "&name="+roomname+
- "&roomtypes_id=1"+
- "&comment="+
- "&numberOfPartizipants=2"+
- "&ispublic=true"+
- "&appointment=false"+
- "&isDemoRoom=false"+
- "&demoTime="+
- "&isModeratedRoom=true"+
- "&externalRoomType=2"+
- "&allowUserQuestions="+
- "&isAudioOnly=false"+
- "&waitForRecording=false"+
- "&allowRecording=false"+
- "&hideTopBar=false";
-
- log.error("INFO", java.net.URLEncoder.encode(testURL, "UTF-8").toString());
- System.out.println("INFO "+ java.net.URLEncoder.encode(testURL, "UTF-8"));
- ///LinkedHashMap<String, Element> result = omRestService.call(java.net.URLDecoder.decode(testURL, "UTF-8").replaceAll("+","%20"), null);
-
- LinkedHashMap<String, Element> result = omRestService.call(new URL(testURL).toString().replaceAll(" ","%20"), null);
-
-
- log.error(result.get("return").asXML());
-
- log.error(result.get("return").getStringValue());
-
- //return null;
+// this.testLogin();
+//
+// String roomname = "test test";
+//
+// String testURL = "http://localhost:5080/openmeetings/services/RoomService/addRoomWithModerationExternalTypeAndTopBarOption?" +
+// "SID="+this.getSessionId()+
+// "&name="+roomname+
+// "&roomtypes_id=1"+
+// "&comment="+
+// "&numberOfPartizipants=2"+
+// "&ispublic=true"+
+// "&appointment=false"+
+// "&isDemoRoom=false"+
+// "&demoTime="+
+// "&isModeratedRoom=true"+
+// "&externalRoomType=2"+
+// "&allowUserQuestions="+
+// "&isAudioOnly=false"+
+// "&waitForRecording=false"+
+// "&allowRecording=false"+
+// "&hideTopBar=false";
+//
+// log.error("INFO", java.net.URLEncoder.encode(testURL, "UTF-8").toString());
+// System.out.println("INFO "+ java.net.URLEncoder.encode(testURL, "UTF-8"));
+// ///LinkedHashMap<String, Element> result = omRestService.call(java.net.URLDecoder.decode(testURL, "UTF-8").replaceAll("+","%20"), null);
+//
+// LinkedHashMap<String, Element> result = omRestService.call(new URL(testURL).toString().replaceAll(" ","%20"), null);
+//
+//
+// log.error(result.get("return").asXML());
+//
+// log.error(result.get("return").getStringValue());
+//
+// //return null;
}
public String getSessionId() {
Modified: incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmRestServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmRestServiceTest.java?rev=1292126&r1=1292125&r2=1292126&view=diff
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmRestServiceTest.java (original)
+++ incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/gateway/OmRestServiceTest.java Wed Feb 22 04:50:35 2012
@@ -118,55 +118,94 @@ new OmRestService();
public void testCallApacheCommons() throws SAXException, IOException, ParserConfigurationException, XPathExpressionException, DocumentException {
- String request= "http://localhost:5080/openmeetings/services/UserService/getSession";
- HttpClient client = new HttpClient();
-
- GetMethod method = new GetMethod(request);
-
-
- // Send GET request
-
- int statusCode = client.executeMethod(method);
-
- InputStream rstream = null;
-
- rstream = method.getResponseBodyAsStream();
-
- BufferedReader br = new BufferedReader(new InputStreamReader(rstream));
-
- SAXReader reader = new SAXReader();
- String line;
- Document document = null;
- while ((line = br.readLine()) != null) {
- document = reader.read(new ByteArrayInputStream(line.getBytes("UTF-8")));
- System.out.println("line"+line);
-
- }
-
- //System.out.println("line2"+document.asXML());
-
- Element root = document.getRootElement();
-
- log.error(root.asXML());
-
-
- for ( @SuppressWarnings("unchecked")
-
- Iterator<Element> i = root.elementIterator(); i.hasNext(); ) {
-
- Element item = i.next();
-
- log.debug(item.getName());
- //log.error(item.getNamespacePrefix());
- //log.error(item.getPath());
- //log.error(item.getXPathResult(10).getName());//.getPath("/ns:getSessionResponse/ns:return/ax24:session_id"));
- log.error(item.elementText("session_id"));
-
- String nodeVal = item.getName();
- }
-
- br.close();
-
+// String request= "http://localhost:5080/openmeetings/services/UserService/getSession";
+// HttpClient client = new HttpClient();
+//
+// GetMethod method = new GetMethod(request);
+//
+//
+// // Send GET request
+//
+// int statusCode = client.executeMethod(method);
+//
+// switch (statusCode) {
+//
+// case 200: {
+//
+// System.out.println("Success connection");
+//
+// break;
+//
+// }
+// case 400: {
+//
+// System.out.println("Bad request. The parameters passed to the service did not match as expected. The Message should tell you what was missing or incorrect.");
+//
+// System.out.println("Change the parameter appcd to appid and this error message will go away.");
+//
+// break;
+//
+// }
+//
+// case 403: {
+//
+// System.out.println("Forbidden. You do not have permission to access this resource, or are over your rate limit.");
+//
+// break;
+//
+// }
+//
+// case 503: {
+//
+// System.out.println("Service unavailable. An internal problem prevented us from returning data to you.");
+//
+// break;
+//
+// }
+//
+// default: System.out.println("Your call to Yahoo! Web Services returned an unexpected HTTP status of: " + statusCode);
+//
+// }
+//
+// InputStream rstream = null;
+//
+// rstream = method.getResponseBodyAsStream();
+//
+// BufferedReader br = new BufferedReader(new InputStreamReader(rstream));
+//
+// SAXReader reader = new SAXReader();
+// String line;
+// Document document = null;
+// while ((line = br.readLine()) != null) {
+// document = reader.read(new ByteArrayInputStream(line.getBytes("UTF-8")));
+// System.out.println("line"+line);
+//
+// }
+//
+// //System.out.println("line2"+document.asXML());
+//
+// Element root = document.getRootElement();
+//
+// log.error(root.asXML());
+//
+//
+// for ( @SuppressWarnings("unchecked")
+//
+// Iterator<Element> i = root.elementIterator(); i.hasNext(); ) {
+//
+// Element item = i.next();
+//
+// log.debug(item.getName());
+// //log.error(item.getNamespacePrefix());
+// //log.error(item.getPath());
+// //log.error(item.getXPathResult(10).getName());//.getPath("/ns:getSessionResponse/ns:return/ax24:session_id"));
+// log.error(item.elementText("session_id"));
+//
+// String nodeVal = item.getName();
+// }
+//
+// br.close();
+//
}
}
Added: incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectListTest.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectListTest.java?rev=1292126&view=auto
==============================================================================
--- incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectListTest.java (added)
+++ incubator/openmeetings/branches/jira-plugin/src/test/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectListTest.java Wed Feb 22 04:50:35 2012
@@ -0,0 +1,34 @@
+package org.openmeetings.jira.plugin.jira.customfields;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openmeetings.jira.plugin.jira.customfields.RoomSelectList;
+
+import static org.mockito.Mockito.*;
+
+/**
+ * @since 3.5
+ */
+public class RoomSelectListTest {
+
+ @Before
+ public void setup() {
+
+ }
+
+ @After
+ public void tearDown() {
+
+ }
+
+ @Test(expected=Exception.class)
+ public void testSomething() throws Exception {
+
+ //RoomSelectList testClass = new RoomSelectList();
+
+ throw new Exception("RoomSelectList has no tests!");
+
+ }
+
+}