I've made some attempts, and finally, after debugging, i've noticed that
the wrong Geonetwork UI behavior was not due temporal primitive xml
representation, but simply.. to the gml schema used for MD_Metadata.
Geotk 3.21 was relying on http://www.opengis.net/gml, moving to Apache
SIS, the default GML version is the latest one:
http://www.opengis.net/gml/3.2
Previous GML versions seems unsupported..
I had found this ticket: https://issues.apache.org/jira/browse/SIS-160
which seems related to the above problem
Any advice?
Emmanuel
Le 12/02/2015 23:26, Martin Desruisseaux a écrit :
We do not yet have a temporal module in SIS. One tricky issue will be
to leverage java.time while keeping compatibility with JDK 6 and 7. We
are exploring avenues in the Geotk temporal module before porting to SIS.
In the main time I would suggest to try the following: create a
DefaultPeriod subclass and implement IdentifiedObject as below:
import org.apache.sis.xml.IdentifierMap;
import org.apache.sis.xml.IdentifiedObject;
import org.apache.sis.internal.jaxb.IdentifierMapWithSpecialCases;
class IdentifiedPeriod extends DefaultPeriod implements IdentifiedObject {
private final List<Identifier> identifiers = new ArrayList<>();
@Override
public Collection<Identifier> getIdentifiers() {
return identifiers;
}
@Override
public IdentifierMap getIdentifierMap() {
return new IdentifierMapWithSpecialCases(identifiers);
}
}
It would hopefully allow to use this period in the way proposed in my
previous email.
About controlling the date format, we do not yet have an API for that
in SIS. This is part of the things to do when we will port the
temporal module. However in the main time, it may be possible to do
that by registering a custom JAXB adapter before marshalling. Are you
familiar with javax.xml.bind.annotation.adapters?
Martin
Le 12/02/15 22:50, Emmanuel Blondel a écrit :
Thanks for the indications,
I've tried your suggestion, on my side i use a DefaultPeriod to
implement the TemporalPrimitive and specify it in the metadata
temporal extent.
This is done by using the TemporalUtilities class:
TemporalPrimitive temporalPrimitive =
TemporalUtilities.createPeriod(startTime,endTime);
((IdentifiedObject)
temporalPrimitive).getIdentifierMap().putSpecialized(IdentifierSpace.ID,
"test");
I get the exception: /org.geotoolkit.temporal.object.DefaultPeriod
cannot be cast to org.apache.sis.xml.IdentifiedObject/
I'm also wondering (considering there would be ideally a workaround
to this) how i could specify the period string format as id. Before,
i was using Geotk 3.21 and DefaultPeriod. After marshalling the id
was generated as shown below.
Emmanuel