Package net.sf.gluebooster.java.booster.basic.meta

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext


      if (!successor.isClosed()) {
        successor.close();
      }
    }
   
    DocumentationContext documentationContext = getDocumentationContext(documentationNode);
   
    if (BookBoostUtils.BOOK.equals(type)) {
      Document doc = DomBoostUtils.createDefaultDocumentBuilder().newDocument();
      fillBook(doc, documentationNode);
      OutputStream out = getOutputStream(documentationContext, documentationNode, "index.html");
      DomBoostUtils.write(doc, out);
      out.close();

    } else if (BookBoostUtils.SLIPCASE.equals(type)) {
      getLog().debug("closing slipcase");
     
      //write the list of books
      Document doc = DomBoostUtils.createDefaultDocumentBuilder().newDocument();
      Element body = createHtml(doc, documentationNode.getAttributes().getName(), HTML.Tag.BODY);
      Element list = DomBoostUtils.appendElement(doc, body, HTML.Tag.UL);
      for (BoostedNode zoomInFocusPoint: documentationNode.getAllZoomInFocus()){
        BoostedNode zoomInNode = documentationNode.getZoomIn(zoomInFocusPoint, null);
        Object subtype = zoomInNode.getAttributes().getType();
       
        if (BookBoostUtils.BOOK.equals(subtype)) {
          Element li = DomBoostUtils.appendElement(doc, list, HTML.Tag.LI);
          File directory = documentationContext.getFromAttributesMap(File.class);
          DomBoostUtils.appendElement(
              doc,
              li,
              HTML.Tag.A,
              ContainerBoostUtils.createMap("href",
View Full Code Here


                                        // Go
                                        // up
                                        // to
                                        // the
                                        // main
        DocumentationContext documentationContext = getDocumentationContext(zoomInNode);
        String documentationTargetDirname = (String) documentationContext
            .getFromAttributesMap(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
        if (documentationTargetDirname == null)
          throw new IllegalStateException(
              "no documentationTargetDirname");
View Full Code Here

    if (BookBoostUtils.BOOK.equals(type) || BookBoostUtils.SLIPCASE.equals(type)
        || BookBoostUtils.BOOKSHELF.equals(type)) {
      // these types may have separate files or directories.

      DocumentationContext docContext = getDocumentationContext(documentationNode);

      File file = docContext.getFromAttributesMap(File.class);

      if (file == null) {

        BoostedNode parent = documentationNode.getZoomOut(null)
            .getLeft();
        if (parent == null) {
          String filename = (String) context
              .getFromAttributesMap(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
          if (filename == null)
            throw new IllegalStateException(
                "No filename in documentation context for key "
                    + DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
          Object name = documentationNode.getAttributes().getName();
          if (name == null)
            throw new IllegalStateException(
                "Name not defined in node of type " + type);
          file = new File(filename, name.toString());
        } else {
          setOutputFile(parent);
          file = getDocumentationContext(parent)
              .getFromAttributesMap(File.class);
          Object name = documentationNode.getAttributes().getName();
          if (name == null)
            throw new IllegalStateException(
                "Name not defined in node of type " + type);
          file = new File(file, name.toString()); // todo
                              // internationalization?
        }

        docContext.getAttributes().getAttributes().put(File.class, file);
      }

    }

  }
View Full Code Here

   * @return the context
   */
  @SuppressWarnings("unchecked")
  private DocumentationContext getDocumentationContext(
      BoostedNode documentationNode) throws Exception {
    DocumentationContext docContext = (DocumentationContext) documentationNode
        .getAttributes().getFromAttributes(HtmlDocumentationWriter.class);
    if (docContext == null) {
      docContext = (DocumentationContext) context.clone(); //use the default context
      documentationNode.getAttributes().getAttributes()
          .put(HtmlDocumentationWriter.class, docContext);
View Full Code Here

  }


  @Override
  public void createDocumentation() throws Exception {
    DocumentationContext documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.GERMAN);
    documentationContext.setDocumentationTarget(SwingBoostUtils
        .chooseDirectory("Parent directory of software documentation",
            true).getCanonicalPath());

    SoftwareDocumentationBoostUtils.createSoftwareDocumentation(this,
        documentationContext, true, true);
View Full Code Here

  }

  public void createDocumentation(HasDocumentation toBeDocumented,
      File directory) throws Exception {

      DocumentationContext documentationContext = new DocumentationContext();
      documentationContext.setLocale(Locale.ENGLISH);
      File englishDocumentationDirectory = new File(directory,"english");
      documentationContext.setDocumentationTarget(englishDocumentationDirectory.getCanonicalPath());
      SoftwareDocumentationBoostUtils.createSoftwareDocumentation(
          toBeDocumented, documentationContext, true, true);
      checkCreatedDocumentation(englishDocumentationDirectory,
          documentationContext.getLocale());

      documentationContext = new DocumentationContext();
      documentationContext.setLocale(Locale.GERMAN);
      File germanDocumentationDirectory = new File(directory,"deutsch");
      documentationContext.setDocumentationTarget(germanDocumentationDirectory.getCanonicalPath());
      SoftwareDocumentationBoostUtils.createSoftwareDocumentation(
          toBeDocumented, documentationContext, true, true);

      getLog().debug("created documentation in ", directory);
      checkCreatedDocumentation(germanDocumentationDirectory,
          documentationContext.getLocale());
  }
View Full Code Here

    JFrame frame = (JFrame) graph[0];
    JButton stepButton = (JButton) graph[1];
    TransformationGraph trafo = (TransformationGraph) graph[2];

    File docuDir = createTempDirectory("sampleGraph");
    DocumentationContext context = DocumentationContext
        .createDefaultHtmlContext(docuDir.getCanonicalPath(),
            Locale.ENGLISH);
    BoostedNode bookNode = SoftwareDocumentationBoostUtils
        .newZoomInBook(
            DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION,
View Full Code Here

  @Test
  public void testWriting() throws Exception{
    String ROOT = "root";
   
    MemoryResourceSystem resources = new MemoryResourceSystem();
    DocumentationContext documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.GERMAN);
    documentationContext.setAttribute(ResourceSystem.class, resources);
    documentationContext.setAttribute(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER, ROOT);
   
    SoftwareDocumentationBoostUtils.createSoftwareDocumentation(this,
        documentationContext, true, true);
    
    //check whether a h2 is present (the chapter hierarchy is ok)
View Full Code Here

                    DocumentationResourcesId.DOCUMENTATION_DEVELOPER)
            + "/index.html");
  }

  private static DocumentationContext createDocumentationContext(Locale locale) {
    DocumentationContext context = new DocumentationContext();
    context.setLocale(locale);
    return context;
  }
View Full Code Here

    // Store the documentation in this directory
    File docuDir = createTempDirectory("SoftwareDocuBook1");

    // Create the documentation
    DocumentationContext context = DocumentationContext
        .createDefaultHtmlContext(docuDir.getCanonicalPath(),
            Locale.ENGLISH);
    BoostedNode bookNode = SoftwareDocumentationBoostUtils
        .newZoomInBook(
            DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION,
View Full Code Here

TOP

Related Classes of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

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.