mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
added description and lastModified attribute to group
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -234,6 +234,8 @@ public class XmlGroupManager extends AbstractGroupManager
|
||||
|
||||
if (groupDB.contains(name))
|
||||
{
|
||||
group.setLastModified(System.currentTimeMillis());
|
||||
|
||||
synchronized (XmlGroupManager.class)
|
||||
{
|
||||
groupDB.remove(name);
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user