added description and lastModified attribute to group

This commit is contained in:
Sebastian Sdorra
2011-02-12 15:07:25 +01:00
parent ffa429de33
commit 89f65b34eb
3 changed files with 85 additions and 6 deletions

View File

@@ -187,6 +187,7 @@ public class Group
group.setName(name);
group.setMembers(members);
group.setType(type);
group.setDescription(description);
}
/**
@@ -219,6 +220,20 @@ public class Group
return false;
}
if ((this.description == null)
? (other.description != null)
: !this.description.equals(other.description))
{
return false;
}
if ((this.lastModified != other.lastModified)
&& ((this.lastModified == null)
||!this.lastModified.equals(other.lastModified)))
{
return false;
}
if ((this.members != other.members)
&& ((this.members == null) ||!this.members.equals(other.members)))
{
@@ -251,18 +266,24 @@ public class Group
@Override
public int hashCode()
{
int hash = 5;
int hash = 7;
hash = 89 * hash + ((this.creationDate != null)
hash = 29 * hash + ((this.creationDate != null)
? this.creationDate.hashCode()
: 0);
hash = 89 * hash + ((this.members != null)
hash = 29 * hash + ((this.description != null)
? this.description.hashCode()
: 0);
hash = 29 * hash + ((this.lastModified != null)
? this.lastModified.hashCode()
: 0);
hash = 29 * hash + ((this.members != null)
? this.members.hashCode()
: 0);
hash = 89 * hash + ((this.name != null)
hash = 29 * hash + ((this.name != null)
? this.name.hashCode()
: 0);
hash = 89 * hash + ((this.type != null)
hash = 29 * hash + ((this.type != null)
? this.type.hashCode()
: 0);
@@ -338,6 +359,28 @@ public class Group
return creationDate;
}
/**
* Method description
*
*
* @return
*/
public String getDescription()
{
return description;
}
/**
* Method description
*
*
* @return
*/
public Long getLastModified()
{
return lastModified;
}
/**
* Method description
*
@@ -415,6 +458,28 @@ public class Group
this.creationDate = creationDate;
}
/**
* Method description
*
*
* @param description
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* Method description
*
*
* @param lastModified
*/
public void setLastModified(Long lastModified)
{
this.lastModified = lastModified;
}
/**
* Method description
*
@@ -454,6 +519,13 @@ public class Group
@XmlJavaTypeAdapter(XmlTimestampDateAdapter.class)
private Long creationDate;
/** Field description */
private String description;
/** Field description */
@XmlJavaTypeAdapter(XmlTimestampDateAdapter.class)
private Long lastModified;
/** Field description */
private List<String> members;

View File

@@ -234,6 +234,8 @@ public class XmlGroupManager extends AbstractGroupManager
if (groupDB.contains(name))
{
group.setLastModified(System.currentTimeMillis());
synchronized (XmlGroupManager.class)
{
groupDB.remove(name);

View File

@@ -53,7 +53,7 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, {
initComponent: function(){
var groupStore = new Sonia.rest.JsonStore({
url: restUrl + 'groups.json',
fields: [ 'name', 'members', 'creationDate', 'type'],
fields: [ 'name', 'members', 'description', 'creationDate', 'type'],
sortInfo: {
field: 'name'
}
@@ -67,6 +67,7 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, {
},
columns: [
{id: 'name', header: 'Name', dataIndex: 'name'},
{id: 'description', header: 'Description', dataIndex: 'description', width: 300 },
{id: 'members', header: 'Members', dataIndex: 'members', renderer: this.renderMembers},
{id: 'creationDate', header: 'Creation date', dataIndex: 'creationDate'},
{id: 'type', header: 'Type', dataIndex: 'type', width: 80}
@@ -204,6 +205,10 @@ Sonia.group.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
name: 'name',
allowBlank: false,
readOnly: this.item != null
},{
fieldLabel: 'Description',
name: 'description',
xtype: 'textarea'
}]
},{
id: 'memberGrid',