Package org.tuba.data.xml

Examples of org.tuba.data.xml.XMLArtefact


  private static final String id6 = "cnnbcbn6"; //$NON-NLS-1$

  @Test
  public void test() throws ParseException {
    XMLReference ref;
    XMLArtefact artefact;

    artefact = constructArtefact(file, id1);
    ref = getReference(artefact);
    testReference(artefact, ref);
    Assert.assertEquals("mockrepository_provider", ref //$NON-NLS-1$
View Full Code Here


    testReference(artefact, ref);
  }

  @Test
  public void testUpdate() throws ParseException {
    XMLArtefact artefact = constructArtefact(file, id1);
    XMLReference ref = getReference(artefact);

    String time = Long.toString(System.currentTimeMillis());

    Element element = new Element(TAG_TIME);
View Full Code Here

    Assert.assertNull(configuration);
  }

  @Test
  public void testReferenceDeletion() throws ParseException, IOException {
    XMLArtefact artefact = constructArtefact("nonexistingfile", "id"); //$NON-NLS-1$ //$NON-NLS-2$
    ReferenceManager.getInstance().deleteReference(artefact);

    XMLReference reference = createReference();
    artefact = ReferenceManager.getInstance().generateArtefact(
        "test/some.odt", reference); //$NON-NLS-1$
    artefact.setContext("test/"); //$NON-NLS-1$

    ReferenceManager.getInstance().deleteReference(artefact);

    Document doc = loadFile(artefact.getReferenceFile());
    Element root = doc.getRootElement();
    Assert.assertEquals(0, root.getChildren().size());

    artefact.getReferenceFile().delete();
  }
View Full Code Here

  }

  @Test
  public void testReferenceCreation() throws ParseException, IOException {
    XMLReference reference = createReference();
    XMLArtefact artefact = ReferenceManager.getInstance().generateArtefact(
        "test/some.odt", reference); //$NON-NLS-1$
    artefact.setContext("test/"); //$NON-NLS-1$

    Assert.assertTrue(artefact.getReferenceFile().exists());
    artefact.getReferenceFile().delete();
  }
View Full Code Here

        "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

        .getReference(artefact);
    return ref;
  }

  private XMLArtefact constructArtefact(String fileName, String id) {
    XMLArtefact artefact = new XMLArtefact(fileName, id);
    artefact.setContext("test/"); //$NON-NLS-1$
    return artefact;
  }
View Full Code Here

        XMLIntegrator i = new XMLIntegrator(integrator.getId());
        i.setConfiguration(integrator.getConfiguration());
        reference.setIntegrator(i);
      }

      XMLArtefact artefactTag = ReferenceManager.getInstance()
          .generateArtefact(document, reference);

      if (editorConnector.insertTag(document, artefactTag.toString()))
        doIntegration = true;
    }

    if (doIntegration) {
      IntegrationJob job = new IntegrationJob(document);
View Full Code Here

//      }

      //TODO Jan:hier das korrekte Verzeichnis des Ordners CodeFiles übergeben
//      int ind = path.lastIndexOf("\\");
      String fileName = path + File.separator + artefactID.substring(artefactID.lastIndexOf("/") + 1);
      XMLArtefact artefactTag = ReferenceManager.getInstance().generateArtefact(fileName, reference);
      System.out.println(artefactTag);
    }
  }
View Full Code Here

      return 0;

    int undoSteps = 0;
    for (IIntegrator integrator : docInfo.getIntegrators())
      for (String integrationID : docInfo.getIntegrationIDs(integrator)) {
        XMLArtefact xmlArtefact = integrationInfo
            .getArtefactReference(integrationID);
        try {
          Configuration config = integrator
              .getConfiguration(integrationID);
          updateIntegratorConfiguration(config, xmlArtefact);
        } catch (UnknownIntegrationArtefact e) {
          removeArtefact(xmlArtefact);
          continue;
        }

        undoSteps += integrator.undoIntegration(document,
            integrationID, xmlArtefact.toString());
      }
    return undoSteps;
  }
View Full Code Here

  }

  private void process(IArtefactPosition position,
      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$
View Full Code Here

TOP

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

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.