Package com.esri.gpt.catalog.search

Examples of com.esri.gpt.catalog.search.ResourceLink


   * @return the metadata url
   */
  private String getIdentifierUrl(ResourceLinks links) {
    String identifierUrl = "";
    for (int j = 0; j < links.size(); j++) {
      ResourceLink link = links.get(j);
      if (link.getTag().equals(ResourceLink.TAG_METADATA)) {
        identifierUrl = link.getUrl();
        return identifierUrl;
      }
    }
    return identifierUrl;
  }
View Full Code Here


    levelUp();
    boolean moreLinks = false;
    for (int j = 0; j < links.size(); j++) {
      boolean bPrintLink = false;
      String format = "";
      ResourceLink link = links.get(j);
      /*if (link.getTag().equals(ResourceLink.TAG_OPEN)) {
        defaultValues.put("webService", link.getUrl());
      }*/
      if (link.getTag().equals(ResourceLink.TAG_METADATA)) {
        bPrintLink = true;
        if (!moreLinks) {
          moreLinks = true;
        } else {
          moreLinks = false;
        }
        format = "text/xml";
      }
      if (link.getTag().equals(ResourceLink.TAG_DETAILS)) {
        bPrintLink = true;
        if (!moreLinks) {
          moreLinks = true;
        } else {
          moreLinks = false;
View Full Code Here

      if (indexValue == null) {
        if(dcatField.isRequired()){
          if(dcatFieldName.equalsIgnoreCase("accessURL")){
            ResourceLinks links = r.getResourceLinks();
            for (int j = 0; j < links.size(); j++) {
                ResourceLink link = links.get(j);
                if (link.getTag().equals(ResourceLink.TAG_METADATA)) {             
                  val = link.getUrl();
                  break;
                }
            }
          }else{
            val =  defaultValues.get(dcatFieldName);
View Full Code Here

    _writer.println("\"/>");
    writeTag("media:text", sTitle);
  }

  // record type thumbnail
  ResourceLink contentTypeLink = record.getResourceLinks().findByTag(ResourceLink.TAG_CONTENTTYPE);
  String recordTypeThumbnail = Val.chkUrl(contentTypeLink!=null? contentTypeLink.getUrl(): "");
  if (url.length()>0 || recordTypeThumbnail.length() > 0) {
    _writer.print("<media:thumbnail url=\"");
    _writer.print(Val.escapeXml(url.length()>0? url: recordTypeThumbnail));
    _writer.println("\"/>");
  }
 
  // write geometry
  writeGeometry(record);

  // resource URL
  ResourceLink openRL = record.getResourceLinks().findByTag(ResourceLink.TAG_OPEN);
  if (openRL!=null) {
    String serviceType = Val.chkStr(openRL.getParameters().getValue(ResourceLinkBuilder.RESOURCE_TYPE));
      _writer.print("<geoportal:resourceUrl");
      if (serviceType.length()>0) {
        _writer.print(" " +ResourceLinkBuilder.RESOURCE_TYPE+ "=\"");
        _writer.print(Val.escapeXml(serviceType));
        _writer.print("\"");
      }
      _writer.print(">");
      _writer.print(Val.escapeXml(openRL.getUrl()));
      _writer.println("</geoportal:resourceUrl>");
  }

  _writer.println("</item>");
  _writer.flush();
View Full Code Here

    AtomEntry ae = new AtomFeedWriter(this.getPrintWriter()).new AtomEntry();
    ae.setId(event.getSearchStatus().getRid());
    ae.setTitle(ae.getId() + " " + message);
   
   
    ResourceLink link = new ResourceLink();
    link.setLabel(this.getMessageBroker().retrieveMessage(
      "catalog.search.distributedSearch.linkLabel"));
    link.setUrl(this.getRestUrl() + "&rid=" + event.getSearchStatus().getRid());
    ae.addResourceLink(link);
    if(event.getSource() instanceof SearchThread) {
      SearchThread searchThread = (SearchThread) event.getSource();
      ASearchEngine engine = searchThread.getSearchEngine();
      try {
View Full Code Here

   
    String sNodeId = Val.escapeXmlForBrowser(sUuid);
    _writer.println("<div id=\""+sNodeId+"\" class=\"" + TITLE_STYLE_CLASS + "\">");
   
    // content type icon
    ResourceLink icon = record.getResourceLinks().getIcon();
    if (icon != null) {
      String sUrl = Val.chkStr(icon.getUrl());
      if ((sUrl.length() > 0) && getShowIcon()) {
        _writer.print("<img src=\"");
        _writer.print(Val.escapeXmlForBrowser(sUrl));
        _writer.print("\" alt=\"");
        _writer.print(Val.escapeXmlForBrowser(icon.getLabel()));
        _writer.print("\" title=\"");
        _writer.print(Val.escapeXmlForBrowser(icon.getLabel()));
        _writer.print("\"/>");
      }
    }
   
    // title (or uuid if no title)
View Full Code Here

    String resourceUrl = Val.chkStr(record.getResourceUrl());
    String serviceType = Val.chkStr(record.getServiceType()).toLowerCase();
    String restUrl = Val.chkStr(resourceIdentifier.guessAgsServiceRestUrl(resourceUrl));
    String url;
    String resourceKey;
    ResourceLink link;

    if ((restUrl.length() > 0) && serviceType.equals("ags")) {

      // kml
      if ((restUrl.toLowerCase().endsWith("/mapserver") || restUrl.toLowerCase().endsWith("/imageserver"))) {
View Full Code Here

      String addToMapUrl = iMapViewer.readAddToMapUrl();
      if (addToMapUrl == null || "".equals(addToMapUrl)) {
        return;
      }
      String resourceKey = "catalog.rest.addToMap";
      ResourceLink link = this.makeLink(addToMapUrl, ResourceLink.TAG_ADDTOMAP,
              resourceKey);
      link.setTarget(iMapViewer.readTarget());
      record.getResourceLinks().add(link);
      return;

    }
    // maybe url is already an add to map url?  if so no modigications are required
    if ((resourceUrl.toLowerCase().startsWith("http:") || resourceUrl
            .toLowerCase().startsWith("https:"))
            && resourceUrl.toLowerCase().contains("resources=map")) {
    } else {

      // set up an ArcGIS soap service for the viewer
      if (serviceType.equals("ags")) {
        resourceUrl = Val.chkStr(resourceIdentifier.guessAgsMapServerSoapUrl(resourceUrl));
      }

      // set up an ArcIMS service for the viewer
      int nIdx = resourceUrl.toLowerCase().indexOf(
              "/servlet/com.esri.esrimap.esrimap?servicename=");
      if (nIdx > 0) {
        resourceUrl = resourceUrl.substring(0, nIdx) + "/"
                + resourceUrl.substring(nIdx + 46);
      }

      // set up an OGC service for the viewer
      if (serviceType.equalsIgnoreCase("wms")
              || serviceType.equalsIgnoreCase("wfs")
              || serviceType.equalsIgnoreCase("wcs")) {
        nIdx = resourceUrl.toLowerCase().indexOf("?");
        if (nIdx > 0) {
          resourceUrl = resourceUrl.substring(0, nIdx);
        }
      }
    }

    // TODO: explanation?
    resourceUrl = resourceUrl.replaceAll("/$", "")
            + (serviceName.length() > 0 ? "/" + serviceName : "");
    resourceUrl = Val.chkStr(resourceUrl);

    if (resourceUrl.length() > 0) {
      String url = viewerUrl + "?resources=map:" + serviceType + "@"
              + resourceUrl;
      String resourceKey = "catalog.rest.addToMap";
      ResourceLink link = this.makeLink(url, ResourceLink.TAG_ADDTOMAP,
              resourceKey);
      record.getResourceLinks().add(link);
    }

    String url = "";
View Full Code Here

   */
  protected void buildMetadataLink(IFeedRecord record) {
    String uuid = Val.chkStr(record.getUuid());
    String url = baseContextPath + metadataPath + "?id=" + encodeUrlParam(uuid);
    String resourceKey = "catalog.rest.viewFullMetadata";
    ResourceLink link = makeLink(url, ResourceLink.TAG_METADATA, resourceKey);
    record.getResourceLinks().add(link);
  }
View Full Code Here

   */
  protected void buildDetailsLink(IFeedRecord record) {
    String uuid = Val.chkStr(record.getUuid());
    String url = baseContextPath + this.resourceDetailsPath + "?uuid=" + encodeUrlParam(uuid);
    String resourceKey = "catalog.rest.viewDetails";
    ResourceLink link = makeLink(url, ResourceLink.TAG_DETAILS, resourceKey);
    record.getResourceLinks().add(link);
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.search.ResourceLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.