Fixing model

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@130942 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-08-02 09:47:15 +00:00
parent e6809d4db7
commit 841d7ee6df
3 changed files with 12 additions and 7 deletions

View File

@ -8,7 +8,7 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import org.gcube.informationsystem.model.orientdb.impl.relation.ConsistOf;
import org.gcube.informationsystem.model.relation.ConsistsOf;
import org.gcube.informationsystem.model.relation.IsRelatedTo;
import org.gcube.informationsystem.resourceregistry.api.EntityManagement;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
@ -95,7 +95,7 @@ public class EntityManager {
ResourceRegistryException {
logger.trace(
"requested to attach resource {} to facet {} ({} Type {}) with properties {}",
resourceUUID, facetUUID, ConsistOf.class.getSimpleName(),
resourceUUID, facetUUID, ConsistsOf.class.getSimpleName(),
consistOfType, jsonProperties);
return entityManager.attachFacet(resourceUUID, facetUUID,
consistOfType, jsonProperties);

View File

@ -7,7 +7,6 @@ import java.util.Iterator;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.informationsystem.model.orientdb.impl.embedded.Header;
import org.gcube.informationsystem.model.orientdb.impl.entity.Context;
import org.gcube.informationsystem.model.orientdb.impl.entity.Entity;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
@ -60,7 +59,7 @@ public class ContextUtility {
protected static String getContextUUIDFromContextVertex(Vertex vertex) {
ODocument header = vertex.getProperty(Entity.HEADER_PROPERTY);
String contextID = header.field(Header.UUID_PROPERTY);
String contextID = header.field(org.gcube.informationsystem.model.embedded.Header.UUID_PROPERTY);
return contextID;
}

View File

@ -3,6 +3,9 @@
*/
package org.gcube.informationsystem.resourceregistry.resources.utils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
@ -48,9 +51,12 @@ public class HeaderUtility {
}
header.setCreator(creator);
long timestamp = System.currentTimeMillis();
header.setCreationTime(timestamp);
header.setLastUpdateTime(timestamp);
Date date = Calendar.getInstance().getTime();
SimpleDateFormat ft = new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
logger.trace("Setting Last Update and Creation Time to " + ft.format(date));
header.setCreationTime(date);
header.setLastUpdateTime(date);
return header;
}