Package org.tuba.data.xml

Examples of org.tuba.data.xml.XMLReference


  }

  @Test
  public void testBadFile9() throws ParseException {
    String fileName = getBadFileName(9);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertTrue(ref.getOperations().size() == 1);
    Assert.assertNull(ref.getOperations().get(0).getId());
  }
View Full Code Here


    OODocument ooDocument = new OODocument(document, new EclipseFile(
        "test/sample.odt")); //$NON-NLS-1$

    XMLProvider provider = new XMLProvider(
        "org.some.provider", "some.artefact"); //$NON-NLS-1$//$NON-NLS-2$
    XMLReference reference = new XMLReference(provider);
    XMLArtefact artefact = ReferenceManager.getInstance().generateArtefact(
        ooDocument, reference);
    Assert.assertNotNull(artefact);
    new File("test/sample.odt.artefacts").delete(); //$NON-NLS-1$
  }
View Full Code Here

    Assert.assertNotNull(ref.getOperations());
  }

  private XMLReference getReference(XMLArtefact artefact)
      throws ParseException {
    XMLReference ref = ReferenceManager.getInstance()
        .getReference(artefact);
    return ref;
  }
View Full Code Here

  }

  private XMLReference createReference() {
    XMLProvider provider = new XMLProvider(
        "providerID", "artefactID"); //$NON-NLS-1$//$NON-NLS-2$
    return new XMLReference(provider);
  }
View Full Code Here

      String artefactID = location.getArtefactID();
      if (providerID == null || artefactID == null)
        continue;
      XMLProvider provider = new XMLProvider(providerID,
          artefactID);
      XMLReference reference = new XMLReference(provider);
      IntegrationDialog dialog = new IntegrationDialog(PlatformUI
          .getWorkbench().getActiveWorkbenchWindow().getShell(),
          document);
      if (dialog.open() != Dialog.OK)
        continue;

      for (MetaArtefactOperation operation : dialog.getOperations()) {
        XMLArtefactOperation o = new XMLArtefactOperation(operation
            .getId());
        o.setConfiguration(operation.getConfiguration());
        reference.getOperations().add(o);
      }

      MetaIntegrator integrator = dialog.getIntegrator();
      if (integrator != null) {
        XMLIntegrator i = new XMLIntegrator(integrator.getId());
        i.setConfiguration(integrator.getConfiguration());
        reference.setIntegrator(i);
      }

      XMLArtefact artefactTag = ReferenceManager.getInstance()
          .generateArtefact(document, reference);
View Full Code Here

      String providerID = location.getProviderID();
      String artefactID = location.getArtefactID();
      if (providerID == null || artefactID == null)
        continue;
      XMLProvider provider = new XMLProvider(providerID, artefactID);
      XMLReference reference = new XMLReference(provider);
//      IntegrationDialog dialog = new IntegrationDialog();


//      for (MetaArtefactOperation operation : dialog.getOperations()) {
//        XMLArtefactOperation o = new XMLArtefactOperation(operation
View Full Code Here

  }

  private void updateIntegratorConfiguration(Configuration config,
      XMLArtefact xmlArtefact) {
    try {
      XMLReference reference = ReferenceManager.getInstance()
          .getReference(xmlArtefact);
      reference.getIntegrator().setConfiguration(config);
      ReferenceManager.getInstance()
          .saveReference(reference, xmlArtefact);
    } catch (ParseException e) {
      return;
    }
View Full Code Here

      DetailProgressMonitor monitor) throws ParseException {
    ReferenceManager refManager = ReferenceManager.getInstance();
    XMLArtefact artefact = refManager.parseArtefact(position);

    artefact.setContext(position.getTutorialDocument());
    XMLReference reference = refManager.getReference(artefact);

    try {
      // TODO externalize
      logger.info("prepare integration"); //$NON-NLS-1$
      boolean hasChanged = prepareIntegration(reference);
      if (hasChanged)
        refManager.saveReference(reference, artefact);
    } catch (MissingProviderException e) {
      return;
    } catch (IntegrationException e) {
      return;
    }

    int nrOfStepsToDo = reference.getOperations().size() + 2;
    monitor.setLocalSteps(nrOfStepsToDo);

    // TODO externalize
    logger.info("get artefact from provider '" //$NON-NLS-1$
        + reference.getProvider().getId() + "'"); //$NON-NLS-1$
    IArtefactRepresentation representation = getArtefactFromProvider(reference
        .getProvider());
    monitor.doLocalStep();

    representation = applyOperations(representation, reference
        .getOperations(), monitor);

    // TODO externalize
    logger.info("integrate with '" //$NON-NLS-1$
        + reference.getIntegrator().getId() + "'"); //$NON-NLS-1$
    String integrationID = integrate(position, representation, reference
        .getIntegrator());
    monitor.doLocalStep();

    if (integrationID == null)
      return;
View Full Code Here

TOP

Related Classes of org.tuba.data.xml.XMLReference

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.