Commit f1cba6ed authored by Roman S's avatar Roman S Committed by daryl herzmann

REST API plugin update to 1.2.3 (#584)

* Added: Add a group with role to a chat room
* Added: Occupants endpoint for chat room
* Fixed: Admin and Member list to group endpoint
parent 7c3ef25c
......@@ -44,7 +44,14 @@
REST API Plugin Changelog
</h1>
<p><b>1.2.2</b> -- January 20th, 2015</p>
<p><b>1.2.3</b> -- May 3rd, 2016</p>
<ul>
<li>Added: Add a group with role to a chat room</li>
<li>Added: Occupants endpoint for chat room</li>
<li>Fixed: Admin and Member list to group endpoint</li>
</ul>
<p><b>1.2.2</b> -- January 20th, 2016</p>
<ul>
<li>Added: Presence status to the Session Enitity. E.g. Online, Away etc.</li>
<li>Fixed: Node parameter in the Session Enitity. E.g. Local or Remote</li>
......
......@@ -5,8 +5,8 @@
<name>REST API</name>
<description>Allows administration over a RESTful API.</description>
<author>Roman Soldatow</author>
<version>1.2.2</version>
<date>01/20/2016</date>
<version>1.2.3</version>
<date>05/03/2016</date>
<minServerVersion>4.0.0</minServerVersion>
<adminconsole>
<tab id="tab-server">
......
This diff is collapsed.
......@@ -13,6 +13,7 @@ import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.jivesoftware.openfire.plugin.rest.entity.GroupEntity;
import org.jivesoftware.openfire.plugin.rest.exceptions.ExceptionType;
import org.jivesoftware.openfire.plugin.rest.exceptions.ServiceException;
import org.jivesoftware.openfire.plugin.rest.utils.MUCRoomUtils;
/**
* The Class GroupController.
......@@ -65,7 +66,11 @@ public class GroupController {
throw new ServiceException("Could not find group", groupName, ExceptionType.GROUP_NOT_FOUND,
Response.Status.NOT_FOUND, e);
}
GroupEntity groupEntity = new GroupEntity(group.getName(), group.getDescription());
groupEntity.setAdmins(MUCRoomUtils.convertJIDsToStringList(group.getAdmins()));
groupEntity.setMembers(MUCRoomUtils.convertJIDsToStringList(group.getMembers()));
return groupEntity;
}
......
package org.jivesoftware.openfire.plugin.rest.entity;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
......@@ -8,7 +11,7 @@ import javax.xml.bind.annotation.XmlType;
* The Class GroupEntity.
*/
@XmlRootElement(name = "group")
@XmlType(propOrder = { "name", "description" })
@XmlType(propOrder = { "name", "description", "admins", "members" })
public class GroupEntity {
/** The name. */
......@@ -17,6 +20,12 @@ public class GroupEntity {
/** The description. */
private String description;
/** The admins. */
private List<String> admins;
/** The members. */
private List<String> members;
/**
* Instantiates a new group entity.
*/
......@@ -76,4 +85,44 @@ public class GroupEntity {
this.description = description;
}
/**
* Gets the admins.
*
* @return the admins
*/
@XmlElementWrapper(name = "admins")
@XmlElement(name = "admin")
public List<String> getAdmins() {
return admins;
}
/**
* Gets the members.
*
* @return the members
*/
@XmlElementWrapper(name = "members")
@XmlElement(name = "member")
public List<String> getMembers() {
return members;
}
/**
* Sets the admins.
*
* @param admins the new admins
*/
public void setAdmins(List<String> admins) {
this.admins = admins;
}
/**
* Sets the members.
*
* @param members the new members
*/
public void setMembers(List<String> members) {
this.members = members;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment