Aligned Header properties

This commit is contained in:
Luca Frosini 2021-03-08 11:18:53 +01:00
parent b19539f9e5
commit f760231d6b
2 changed files with 14 additions and 16 deletions

View File

@ -32,12 +32,12 @@ public class HeaderOrient extends ODocument implements Header {
}
@Override
public String getCreator() {
return this.field(Header.CREATOR_PROPERTY);
public String getCreatedBy() {
return this.field(Header.CREATED_BY_PROPERTY);
}
public void setCreator(String creator) {
this.field(Header.CREATOR_PROPERTY, creator);
public void setCreatedBy(String createdBy) {
this.field(Header.CREATED_BY_PROPERTY, createdBy);
}
@Override
@ -50,12 +50,12 @@ public class HeaderOrient extends ODocument implements Header {
}
@Override
public String getModifiedBy() {
return this.field(Header.MODIFIED_BY_PROPERTY);
public String getLastUpdateBy() {
return this.field(Header.LAST_UPDATE_BY_PROPERTY);
}
public void setModifiedBy(String modifiedBy) {
this.field(Header.MODIFIED_BY_PROPERTY, modifiedBy);
public void setLastUpdateBy(String lastUpdateBy) {
this.field(Header.LAST_UPDATE_BY_PROPERTY, lastUpdateBy);
}
@Override
@ -76,7 +76,6 @@ public class HeaderOrient extends ODocument implements Header {
@Override
public void setAdditionalProperties(Map<String, Object> additionalProperties) {
// TODO Auto-generated method stub
}
@Override
@ -88,7 +87,6 @@ public class HeaderOrient extends ODocument implements Header {
@Override
public void setAdditionalProperty(String key, Object value) {
// TODO Auto-generated method stub
}
}

View File

@ -58,8 +58,8 @@ public class HeaderUtility {
header.setUUID(uuid);
String creator = getUser();
header.setCreator(creator);
header.setModifiedBy(creator);
header.setCreatedBy(creator);
header.setLastUpdateBy(creator);
Date date = Calendar.getInstance().getTime();
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();
Header header = ElementMapper.unmarshal(Header.class, json);
headerOrient.setUUID(header.getUUID());
headerOrient.setCreator(header.getCreator());
headerOrient.setCreatedBy(header.getCreatedBy());
headerOrient.setCreationTime(header.getCreationTime());
headerOrient.setModifiedBy(header.getModifiedBy());
headerOrient.setLastUpdateBy(header.getLastUpdateBy());
headerOrient.setLastUpdateTime(header.getLastUpdateTime());
return headerOrient;
} catch(Exception e) {
@ -134,8 +134,8 @@ public class HeaderUtility {
public static void updateModifiedByAndLastUpdate(OElement element) throws ResourceRegistryException {
ODocument oDocument = element.getProperty(IdentifiableElement.HEADER_PROPERTY);
String modifiedBy = getUser();
oDocument.field(Header.MODIFIED_BY_PROPERTY, modifiedBy);
String lastUpdateBy = getUser();
oDocument.field(Header.LAST_UPDATE_BY_PROPERTY, lastUpdateBy);
Date lastUpdateTime = Calendar.getInstance().getTime();
oDocument.field(Header.LAST_UPDATE_TIME_PROPERTY, lastUpdateTime);
element.setProperty(IdentifiableElement.HEADER_PROPERTY, oDocument);