Package com.esri.gpt.catalog.schema

Examples of com.esri.gpt.catalog.schema.Schema


public Schema prepareForPublication()
  throws SchemaException, SQLException {

  // prepare the schema for publication, send the request
  MetadataDocument document = new MetadataDocument();
  Schema schema = document.prepareForPublication(this);
  determineSourceUri(schema);
  determineUuid(schema);

  return schema;
}
View Full Code Here


* @throws CatalogIndexException if a document indexing exception occurs
*/
public void publish()
  throws SchemaException, ImsServiceException, SQLException, CatalogIndexException {

  Schema schema = prepareForPublication();
  publish(schema);
}
View Full Code Here

        ProtocolInvoker.setLockTitle(record.getProtocol(), false);
      } else {
        // if the native resource is available, make sure it's a valid metadata resource
        // prepare record for publication; it will validate schema
        PublicationRequest pubReq = new PublicationRequest(context, user, nativeResource.getContent());
        Schema schema = pubReq.prepareForPublication();
        boolean lockTitle = false;
        if (record.getName().length() == 0) {
          title = schema.getMeaning().getTitle();
        } else {
          if (!ProtocolInvoker.getLockTitle(record.getProtocol())) {
            lockTitle = titleChanged;
          } else {
            lockTitle = true;
View Full Code Here

   */
  protected Node extractItemInfo(String metadata) throws AgpPublishException {
    try {
      // find the right schema
      MetadataDocument document = new MetadataDocument();
      Schema schema = document.prepareForView(requestContext, metadata);

      // get transformation file
      String toEsriItemInfoXslt = schema.getToEsriItemInfoXslt();
      if (toEsriItemInfoXslt.isEmpty()) {
        throw new AgpPublishException("Schema: " + schema.getKey() + " has no transformation to ItemInformation.");
      }

      // run the validation xsl
      XsltTemplate template = this.getCompiledTemplate(toEsriItemInfoXslt);
      String result = template.transform(metadata);
View Full Code Here

      Timestamp updateDate = ims.getUpdateDate();
      String xml = ims.getXml();
     
      // build the schema
      MetadataDocument mdDoc = new MetadataDocument();
      Schema schema = mdDoc.prepareForView(getRequestContext(),xml);
     
      // publish
      publishDocument(uuid,updateDate,schema,acl);
     
      return xml;
View Full Code Here

  }
  String metadataXml = this.getMetadataText(uuid, catalogUri);
  this.getSearchResult().setCurrentMetadataXmlInView(metadataXml);
  this.setNavigationOutcome(NAV_RESULTS2VIEWDETAILS);
  MetadataDocument document = new MetadataDocument();
  Schema schema = document.prepareForView(context,metadataXml);
  if ((detailsPanelGroup != null) && (schema != null)) {
    setResourceUrl(schema.getMeaning().getResourceUrl());
   
    // check for a configured XSLT to generate the details page,
    // otherwise, generate the details page from the defined schema
    String htmlFragment = "";
    if (schema.getDetailsXslt().length() > 0) {
       try {
           MessageBroker broker = this.extractMessageBroker();
            htmlFragment = Val.chkStr(document.transformDetails(metadataXml,schema.getDetailsXslt(),broker));
      } catch (TransformerException e) {
        htmlFragment = "";
        LOG.log(Level.SEVERE,"Cannot transform metadata details: "+schema.getDetailsXslt(),e);
      }
    }
    if ((htmlFragment != null) && (htmlFragment.length() > 0)) {
      HtmlOutputText component = new HtmlOutputText();
      component.setId("xsltBasedDetails");
      component.setValue(htmlFragment);
      component.setEscape(false);
      detailsPanelGroup.getChildren().add(component);
    } else {
      UiContext uiContext = new UiContext();
      schema.appendDetailSections(uiContext,detailsPanelGroup);
    }
  }
}
View Full Code Here

    msgBroker.addMessage(fm);

    String sKey = e.getKey();
    if (sKey.length() > 0) {
      String sMsg = sKey;
      Schema schema = context.getCatalogConfiguration().getConfiguredSchemas().get(sKey);
      if (schema != null) {
        if (schema.getLabel() != null) {
          String sResKey = schema.getLabel().getResourceKey();
          if (sResKey.length() > 0) {
            sMsg = extractMessageBroker().retrieveMessage(sResKey)+" ("+sKey+")";
          }
        }
      }
View Full Code Here

      GxeDefinition definition = null;
      String key = Val.chkStr(request.getParameter("key"));
      String loc = Val.chkStr(request.getParameter("loc"));
      if (key.length() > 0) {
        Schemas schemas = context.getCatalogConfiguration().getConfiguredSchemas();
        Schema schema = schemas.get(key);
        if (schema == null) {
          throw new SchemaException("Unsupported schema key.");
        } else {
          definition = schema.getGxeEditorDefinition();
        }
      } else if (loc.length() > 0) {
        definition = new GxeDefinition();
        definition.setFileLocation(loc);
      }
View Full Code Here

       isIE = Val.chkBool(request.getParameter("isIE"),false);
     
      // interrogate the posted XMl, generate the definition
      bWrap = Val.chkBool(request.getParameter("wrap"),false);
      String sXml = this.readPostedXml(request,response,context);
      Schema schema = this.interrogateSchema(context,sXml);
      String sCfg = "";
      GxeDefinition definition = schema.getGxeEditorDefinition();
      if (definition != null) {
        msgBroker = this.getMessageBroker(request,response,context,msgBroker);
        sCfg = this.generateDefinition(request,response,context,msgBroker,definition);
      }
     
      // set the response
      if ((sCfg != null) && (sCfg.length() > 0)) {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("\r\n\"cfgDefinition\":").append(sCfg);
        sb.append(",\r\n\"xml\":\"").append(
            Val.escapeStrForJson(schema.getActiveDocumentXml())).append("\"");
        sb.append("\r\n}");
        sResponse = sb.toString();
      } else {
        throw new SchemaException("Unsupported XML type.");
      }
View Full Code Here

        sMimeType = "text/plain";
      }
     
      // interrogate the posted XMl, generate the details
      String sXml = this.readPostedXml(request,response,context);
      Schema schema = this.interrogateSchema(context,sXml);
      msgBroker = this.getMessageBroker(request,response,context,msgBroker);
      String sDetails = this.generateDetails(request,response,context,msgBroker,schema);
      sDetails = Val.chkStr(sDetails);
     
      // set the response
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.schema.Schema

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.