Package edu.isi.karma.rep.sources

Examples of edu.isi.karma.rep.sources.WebService


  @Override
  public UpdateContainer undoIt(Workspace workspace) {

    Worksheet wk = workspace.getWorksheet(worksheetId);

    WebService service = null;
    DataSource source = null;
   
    if (!wk.containService()) {
      logger.error("The worksheet does not have a service object.");
//      return new UpdateContainer(new ErrorUpdate(
//        "Error occured while deleting the model. The worksheet does not have a service object."));
    } else
      service = wk.getMetadataContainer().getService();
   
    if (!wk.containSource()) {
      logger.error("The worksheet does not have a source object.");
//      return new UpdateContainer(new ErrorUpdate(
//        "Error occured while deleting the model. The worksheet does not have a source object."));
    } else
      source = wk.getMetadataContainer().getSource();
   
    try {

      // one way to un-publish is just set the service model to null and publish it again.
      // in this way the invocation part will be kept in the repository.
//      ServicePublisher servicePublisher = new ServicePublisher(service);
//      servicePublisher.publish("N3", true);

      // deleting the service completely from the repository.
      if (service != null) {
        WebServiceLoader.getInstance().deleteSourceByUri(service.getUri());
        logger.info("Service model has successfully been deleted from repository.");
        return new UpdateContainer(new ErrorUpdate(
            "Service model has successfully been deleted from repository."));
      }
      else {
        DataSourceLoader.getInstance().deleteSourceByUri(source.getUri());
        logger.info("Source model has successfully been deleted from repository.");
        return new UpdateContainer(new ErrorUpdate(
            "Source model has successfully been deleted from repository."));
      }

    } catch (Exception e) {
      logger.error("Error occured while deleting the source/service " + service.getId(), e);
      return new UpdateContainer(new ErrorUpdate(
          "Error occured while deleting the source/service " + service.getId()));
    }
   
  }
View Full Code Here


   * @throws FileNotFoundException
   */
  @Override
  public void publish(String lang, boolean writeToFile) throws FileNotFoundException {
   
    WebService existingService = WebServiceLoader.getInstance().getServiceByAddress(service.getAddress());
    if (existingService != null)
      WebServiceLoader.getInstance().deleteSourceByUri(existingService.getUri());
   
    if (this.model == null)
      model = exportToJenaModel();
   
    // update the repository active model
View Full Code Here

   
  }
 
  public static void main(String[] args) throws FileNotFoundException {
    String serviceUri = ModelingConfiguration.getKarmaServicePrefix() + "CDA81BE4-DD77-E0D3-D033-FC771B2F4800" + "#";
    WebService service = WebServiceLoader.getInstance().getSourceByUri(serviceUri);
   
    String service_file = ServletContextParameterMap.getParameterValue(ContextParameter.USER_DIRECTORY_PATH) +
                  Repository.Instance().SERVICE_REPOSITORY_REL_DIR +
                  "service" +
                  Repository.Instance().getFileExtension(SerializationLang.N3);
View Full Code Here

TOP

Related Classes of edu.isi.karma.rep.sources.WebService

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.