Aligned Header properties
This commit is contained in:
parent
b19539f9e5
commit
f760231d6b
|
@ -32,12 +32,12 @@ public class HeaderOrient extends ODocument implements Header {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCreator() {
|
public String getCreatedBy() {
|
||||||
return this.field(Header.CREATOR_PROPERTY);
|
return this.field(Header.CREATED_BY_PROPERTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreator(String creator) {
|
public void setCreatedBy(String createdBy) {
|
||||||
this.field(Header.CREATOR_PROPERTY, creator);
|
this.field(Header.CREATED_BY_PROPERTY, createdBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,12 +50,12 @@ public class HeaderOrient extends ODocument implements Header {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModifiedBy() {
|
public String getLastUpdateBy() {
|
||||||
return this.field(Header.MODIFIED_BY_PROPERTY);
|
return this.field(Header.LAST_UPDATE_BY_PROPERTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModifiedBy(String modifiedBy) {
|
public void setLastUpdateBy(String lastUpdateBy) {
|
||||||
this.field(Header.MODIFIED_BY_PROPERTY, modifiedBy);
|
this.field(Header.LAST_UPDATE_BY_PROPERTY, lastUpdateBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -76,7 +76,6 @@ public class HeaderOrient extends ODocument implements Header {
|
||||||
@Override
|
@Override
|
||||||
public void setAdditionalProperties(Map<String, Object> additionalProperties) {
|
public void setAdditionalProperties(Map<String, Object> additionalProperties) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -88,7 +87,6 @@ public class HeaderOrient extends ODocument implements Header {
|
||||||
@Override
|
@Override
|
||||||
public void setAdditionalProperty(String key, Object value) {
|
public void setAdditionalProperty(String key, Object value) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,8 @@ public class HeaderUtility {
|
||||||
header.setUUID(uuid);
|
header.setUUID(uuid);
|
||||||
|
|
||||||
String creator = getUser();
|
String creator = getUser();
|
||||||
header.setCreator(creator);
|
header.setCreatedBy(creator);
|
||||||
header.setModifiedBy(creator);
|
header.setLastUpdateBy(creator);
|
||||||
|
|
||||||
Date date = Calendar.getInstance().getTime();
|
Date date = Calendar.getInstance().getTime();
|
||||||
SimpleDateFormat ft = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
|
SimpleDateFormat ft = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
|
||||||
|
@ -102,9 +102,9 @@ public class HeaderUtility {
|
||||||
String json = oDocument.toJSON();
|
String json = oDocument.toJSON();
|
||||||
Header header = ElementMapper.unmarshal(Header.class, json);
|
Header header = ElementMapper.unmarshal(Header.class, json);
|
||||||
headerOrient.setUUID(header.getUUID());
|
headerOrient.setUUID(header.getUUID());
|
||||||
headerOrient.setCreator(header.getCreator());
|
headerOrient.setCreatedBy(header.getCreatedBy());
|
||||||
headerOrient.setCreationTime(header.getCreationTime());
|
headerOrient.setCreationTime(header.getCreationTime());
|
||||||
headerOrient.setModifiedBy(header.getModifiedBy());
|
headerOrient.setLastUpdateBy(header.getLastUpdateBy());
|
||||||
headerOrient.setLastUpdateTime(header.getLastUpdateTime());
|
headerOrient.setLastUpdateTime(header.getLastUpdateTime());
|
||||||
return headerOrient;
|
return headerOrient;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
@ -134,8 +134,8 @@ public class HeaderUtility {
|
||||||
|
|
||||||
public static void updateModifiedByAndLastUpdate(OElement element) throws ResourceRegistryException {
|
public static void updateModifiedByAndLastUpdate(OElement element) throws ResourceRegistryException {
|
||||||
ODocument oDocument = element.getProperty(IdentifiableElement.HEADER_PROPERTY);
|
ODocument oDocument = element.getProperty(IdentifiableElement.HEADER_PROPERTY);
|
||||||
String modifiedBy = getUser();
|
String lastUpdateBy = getUser();
|
||||||
oDocument.field(Header.MODIFIED_BY_PROPERTY, modifiedBy);
|
oDocument.field(Header.LAST_UPDATE_BY_PROPERTY, lastUpdateBy);
|
||||||
Date lastUpdateTime = Calendar.getInstance().getTime();
|
Date lastUpdateTime = Calendar.getInstance().getTime();
|
||||||
oDocument.field(Header.LAST_UPDATE_TIME_PROPERTY, lastUpdateTime);
|
oDocument.field(Header.LAST_UPDATE_TIME_PROPERTY, lastUpdateTime);
|
||||||
element.setProperty(IdentifiableElement.HEADER_PROPERTY, oDocument);
|
element.setProperty(IdentifiableElement.HEADER_PROPERTY, oDocument);
|
||||||
|
|
Loading…
Reference in New Issue