53 lines
1.3 KiB
Java
53 lines
1.3 KiB
Java
package org.gcube.data.pu;
|
|
|
|
import org.gcube.data.publishing.gCatFeeder.catalogues.CatalogueController;
|
|
import org.gcube.data.publishing.gCatFeeder.catalogues.model.PublishReport;
|
|
import org.gcube.data.publishing.gCatFeeder.catalogues.model.faults.WrongObjectFormatException;
|
|
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
|
|
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@Slf4j
|
|
public class GCatController implements CatalogueController{
|
|
|
|
|
|
private static ObjectMapper mapper=new ObjectMapper();
|
|
|
|
|
|
private CatalogueInstanceDescriptor desc;
|
|
|
|
public GCatController(CatalogueInstanceDescriptor instance) {
|
|
this.desc=instance;
|
|
}
|
|
|
|
/**
|
|
* Expected structure
|
|
*
|
|
* {
|
|
* "profile" : "<serialized_profile>",
|
|
* "item" : "<serialized_item>",
|
|
* "resources" : [
|
|
* "<serialized_resource>",
|
|
* "<serialized_resource>",
|
|
* ....]
|
|
* }
|
|
*
|
|
* NB serialized resources are updated with "package_id" set as the published item id
|
|
*
|
|
*
|
|
*/
|
|
@Override
|
|
public PublishReport publishItem(CatalogueFormatData arg0) throws WrongObjectFormatException {
|
|
log.debug("Publishing {} ",arg0);
|
|
String serialized=arg0.toCatalogueFormat();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|