Codota Logo
DefaultOnlineResource
Code IndexAdd Codota to your IDE (free)

How to use
DefaultOnlineResource
in
org.apache.sis.metadata.iso.citation

Best Java code snippets using org.apache.sis.metadata.iso.citation.DefaultOnlineResource (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: org.apache.sis.storage/sis-netcdf

/**
 * Creates an {@code OnlineResource} element if the given URL is not null. Since ISO 19115
 * declares the URL as a mandatory attribute, this method will ignore all other attributes
 * if the given URL is null.
 *
 * @param  url   the URL (mandatory - if {@code null}, no resource will be created).
 * @return the online resource, or {@code null} if the URL was null.
 */
private OnlineResource createOnlineResource(final String url) {
  final URI uri = createURI(url);
  if (uri == null) {
    return null;
  }
  final DefaultOnlineResource resource = new DefaultOnlineResource(uri);
  final String protocol = uri.getScheme();
  resource.setProtocol(protocol);
  if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) {
    resource.setApplicationProfile("web browser");
  }
  resource.setFunction(OnLineFunction.INFORMATION);
  return resource;
}
origin: org.apache.sis.storage/sis-storage

/**
 * Adds a URL to a more complete description of the metadata.
 *
 * <ul>
 *   <li>{@code metadata/metadataLinkage/linkage}
 *     with {@code function} set to {@code OnLineFunction.COMPLETE_METADATA}</li>
 * </ul>
 *
 * @param  link
 */
public final void addCompleteMetadata(final URI link) {
  if (link != null) {
    final DefaultOnlineResource ln = new DefaultOnlineResource(link);
    ln.setFunction(OnLineFunction.valueOf("COMPLETE_METADATA"));
    ln.setProtocol(link.getScheme());
    addIfNotPresent(metadata().getMetadataLinkages(), ln);
  }
}
origin: apache/sis

final DefaultOnlineResource r = new DefaultOnlineResource();
try {
  r.setLinkage(new URI(url));
} catch (URISyntaxException exception) {
  unexpectedException("getAuthority", exception);
r.setFunction(function);
r.setDescription(description);
c.getOnlineResources().add(r);
origin: apache/sis

/**
 * Tests XML marshalling for the given metadata version.
 *
 * @param  file     file containing the expected metadata.
 * @param  version  the metadata version to marshal.
 */
private void testMarshalling(final String file, final Version version) throws JAXBException {
  final DefaultOnlineResource rs = new DefaultOnlineResource(URI.create("https://tools.ietf.org/html/rfc1149"));
  rs.setName("IP over Avian Carriers");
  rs.setDescription(new SimpleInternationalString("High delay, low throughput, and low altitude service."));
  rs.setFunction(OnLineFunction.OFFLINE_ACCESS);
  final DefaultContact contact = new DefaultContact(rs);
  contact.setContactInstructions(new SimpleInternationalString("Send carrier pigeon."));
  contact.getIdentifierMap().putSpecialized(IdentifierSpace.ID, "ip-protocol");
  final DefaultCitation c = new DefaultCitation("Fight against poverty");
  final DefaultResponsibleParty r1 = new DefaultResponsibleParty(Role.ORIGINATOR);
  final DefaultResponsibleParty r2 = new DefaultResponsibleParty(Role.valueOf("funder"));
  r1.setParties(Collections.singleton(new DefaultIndividual("Maid Marian", null, contact)));
  r2.setParties(Collections.singleton(new DefaultIndividual("Robin Hood",  null, contact)));
  c.setCitedResponsibleParties(Arrays.asList(r1, r2));
  c.getDates().add(new DefaultCitationDate(TestUtilities.date("2015-10-17 00:00:00"), DateType.valueOf("adopted")));
  c.getPresentationForms().add(PresentationForm.valueOf("physicalObject"));
  /*
   * Check that XML file built by the marshaller is the same as the example file.
   */
  assertMarshalEqualsFile(file, c, version, "xmlns:*", "xsi:schemaLocation");
}
origin: apache/sis

final Anchor country = new Anchor(URI.create("SDN:C320:2:FR"), "France"); // Non-public SIS class.
  final DefaultOnlineResource online = new DefaultOnlineResource(URI.create("http://www.ifremer.fr/sismer/"));
  online.setProtocol("http");
  final DefaultContact contact = new DefaultContact(online);
  contact.getIdentifierMap().putSpecialized(IdentifierSpace.ID, "IFREMER");
    final DefaultOnlineResource online = new DefaultOnlineResource(URI.create("http://www.com.univ-mrs.fr/LOB/"));
    online.setProtocol("http");
    final DefaultContact contact = new DefaultContact(online);
    contact.setPhones(Arrays.asList(
  final DefaultOnlineResource onlines = new DefaultOnlineResource(URI.create("http://www.ifremer.fr/data/something"));
  onlines.setDescription(new SimpleInternationalString("CTDF02"));
  onlines.setFunction(OnLineFunction.DOWNLOAD);
  onlines.setProtocol("http");
  transfer.setOnLines(singleton(onlines));
  distributionInfo.setTransferOptions(singleton(transfer));
origin: org.apache.sis.core/sis-metadata

DefaultOnlineResource firstOnline = DefaultOnlineResource.castOrCopy(CollectionsExt.first(onlineResources));
if (firstOnline == null) {
  firstOnline = new DefaultOnlineResource();
firstOnline.setLinkage(uri);
onlineResources = OtherLocales.setFirst(onlineResources, firstOnline);
citation.setOnlineResources(onlineResources);
origin: apache/sis

/**
 * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
 * This method performs the first applicable action in the following choices:
 *
 * <ul>
 *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
 *   <li>Otherwise if the given object is already an instance of
 *       {@code DefaultOnlineResource}, then it is returned unchanged.</li>
 *   <li>Otherwise a new {@code DefaultOnlineResource} instance is created using the
 *       {@linkplain #DefaultOnlineResource(OnlineResource) copy constructor}
 *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
 *       metadata contained in the given object are not recursively copied.</li>
 * </ul>
 *
 * @param  object  the object to get as a SIS implementation, or {@code null} if none.
 * @return a SIS implementation containing the values of the given object (may be the
 *         given object itself), or {@code null} if the argument was null.
 */
public static DefaultOnlineResource castOrCopy(final OnlineResource object) {
  if (object == null || object instanceof DefaultOnlineResource) {
    return (DefaultOnlineResource) object;
  }
  return new DefaultOnlineResource(object);
}
origin: org.apache.sis.core/sis-referencing

final DefaultOnlineResource r = new DefaultOnlineResource();
try {
  r.setLinkage(new URI(url));
} catch (URISyntaxException exception) {
  unexpectedException("getAuthority", exception);
r.setFunction(function);
r.setDescription(description);
c.getOnlineResources().add(r);
origin: apache/sis

/**
 * Adds a URL to a more complete description of the metadata.
 * Storage location is:
 *
 * <ul>
 *   <li>{@code metadata/metadataLinkage/linkage}
 *     with {@code function} set to {@code OnLineFunction.COMPLETE_METADATA}</li>
 * </ul>
 *
 * @param  link  URL to a more complete description of the metadata, or {@code null}.
 */
public final void addCompleteMetadata(final URI link) {
  if (link != null) {
    final DefaultOnlineResource ln = new DefaultOnlineResource(link);
    ln.setFunction(OnLineFunction.valueOf("COMPLETE_METADATA"));
    ln.setProtocol(link.getScheme());
    addIfNotPresent(metadata().getMetadataLinkages(), ln);
  }
}
origin: apache/sis

DefaultOnlineResource firstOnline = DefaultOnlineResource.castOrCopy(CollectionsExt.first(onlineResources));
if (firstOnline == null) {
  firstOnline = new DefaultOnlineResource();
firstOnline.setLinkage(uri);
onlineResources = OtherLocales.setFirst(onlineResources, firstOnline);
citation.setOnlineResources(onlineResources);
origin: org.apache.sis.core/sis-metadata

/**
 * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
 * This method performs the first applicable action in the following choices:
 *
 * <ul>
 *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
 *   <li>Otherwise if the given object is already an instance of
 *       {@code DefaultOnlineResource}, then it is returned unchanged.</li>
 *   <li>Otherwise a new {@code DefaultOnlineResource} instance is created using the
 *       {@linkplain #DefaultOnlineResource(OnlineResource) copy constructor}
 *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
 *       metadata contained in the given object are not recursively copied.</li>
 * </ul>
 *
 * @param  object  the object to get as a SIS implementation, or {@code null} if none.
 * @return a SIS implementation containing the values of the given object (may be the
 *         given object itself), or {@code null} if the argument was null.
 */
public static DefaultOnlineResource castOrCopy(final OnlineResource object) {
  if (object == null || object instanceof DefaultOnlineResource) {
    return (DefaultOnlineResource) object;
  }
  return new DefaultOnlineResource(object);
}
origin: apache/sis

/**
 * Creates an {@code OnlineResource} element if the given URL is not null. Since ISO 19115
 * declares the URL as a mandatory attribute, this method will ignore all other attributes
 * if the given URL is null.
 *
 * @param  url   the URL (mandatory - if {@code null}, no resource will be created).
 * @return the online resource, or {@code null} if the URL was null.
 */
private OnlineResource createOnlineResource(final String url) {
  final URI uri = createURI(url);
  if (uri == null) {
    return null;
  }
  final DefaultOnlineResource resource = new DefaultOnlineResource(uri);
  final String protocol = uri.getScheme();
  resource.setProtocol(protocol);
  if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) {
    resource.setApplicationProfile("web browser");
  }
  resource.setFunction(OnLineFunction.INFORMATION);
  return resource;
}
origin: apache/sis

/**
 * Wraps the given URI in a {@code <cit:OnlineResource>} element.
 */
@Override
public CI_OnlineResource marshal(final URI value) {
  if (value != null) {
    return ADAPTER.marshal(new DefaultOnlineResource(value));
  }
  return null;
}
origin: Geomatys/geotoolkit

cit.getOnlineResources().add(new DefaultOnlineResource(resource));
info.setCitation(cit);
org.apache.sis.metadata.iso.citationDefaultOnlineResource

Javadoc

Information about on-line sources from which the dataset, specification, or community profile name and extended metadata elements can be obtained. The following property is mandatory in a well-formed metadata according ISO 19115:
CI_OnlineResource └─linkage……………… Location (address) for on-line access using a Uniform Resource Locator address or similar addressing scheme.

Limitations:

  • Instances of this class are not synchronized for multi-threading. Synchronization, if needed, is caller's responsibility.
  • Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases. Serialization support is appropriate for short term storage or RMI between applications running the same version of Apache SIS. For long term storage, use org.apache.sis.xml.XML instead.

Most used methods

  • <init>
    Constructs a new instance initialized with the values from the specified metadata object. This is a
  • setFunction
    Sets the code for function performed by the online resource.
  • setDescription
    Sets the detailed text description of what the online resource is/does.
  • setProtocol
    Sets the connection protocol to be used.
  • setLinkage
    Sets the location (address) for on-line access using a Uniform Resource Locator address or similar a
  • castOrCopy
    Returns a SIS metadata implementation with the values of the given arbitrary implementation. This me
  • checkWritePermission
  • getProtocolRequest
    Returns the request used to access the resource depending on the protocol. This is used mainly for P
  • setApplicationProfile
    Sets the name of an application profile that can be used with the online resource.
  • setName
    Sets the name of the online resource.Upcoming API change — internationalization The argument type ma

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • findViewById (Activity)
  • putExtra (Intent)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now