Package gluebooster.basic.text

Examples of gluebooster.basic.text.DocumentationContext


  @Ignore("until problems with the correct dependencies are solved")
  @Test
  public void testFillDocumentation() throws Exception{
    MavenDocumentationGenerator generator = new MavenDocumentationGenerator();
   
    DocumentationContext context = new DocumentationContext();
    context.setLocale(Locale.GERMAN);
   
    File file = File.createTempFile("sample", "pom.xml");

    try
    {
View Full Code Here


  }

  public static void start(SwingApplication app,
      String[] documentationContextArgs) {
    try {
      DocumentationContext context = DocumentationContext
          .createFrom(documentationContextArgs);
      if (context == null) {
        app.setVisible(true);
      } else {
        SoftwareDocumentationUtils.createSoftwareDocumentation(app,
View Full Code Here

    ServletContext context =  config.getServletContext();
    Boolean ignoreErrors = (Boolean) context.getAttribute("ignoreErrors");
    try {
    
   
    DocumentationContext  documentationContext = JEEDocumentationUtils.getDocumentationContext(config.getServletContext());
    if (documentationContext != null){
      for (Object documentationType: documentationContext.getDocumentationTypeNodes().keySet()){
       
       
        BoostedNode servletChapter = documentationContext.getDocumentationTypeMap(documentationType, false).get( WebXml.SERVLET_TAG + config.getServletName());
        if (servletChapter == null){
          logger.info("Did not write a servletChapter for documentationType " + documentationType+
              ". Did not find "+ WebXml.SERVLET_TAG + config.getServletName()+
              " in keys "+ documentationContext.getDocumentationTypeMap(documentationType, false).keySet()+
              ". Either the documentation type needs no servlet chapter or the initialization has probably not been correct. (Maybe an error in the SoftwareDocumentationListener)"  );
        }
        fillDocumentation(documentationType, servletChapter, documentationContext);
      }
View Full Code Here

      if (!successor.isClosed()) {
        successor.close();
      }
    }
   
    DocumentationContext documentationContext = getDocumentationContext(documentationNode);
   
    if (GeneralConstants.BOOK.equals(type)) {
      Document doc = DomUtils.createDefaultDocumentBuilder().newDocument();
      fillBook(doc, documentationNode);
      OutputStream out = getOutputStream(documentationContext, documentationNode, "index.html");
View Full Code Here

    if (GeneralConstants.BOOK.equals(type)
        || GeneralConstants.SLIPCASE.equals(type)
        || GeneralConstants.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().getMap().put(File.class, file);
      }

    }

  }
View Full Code Here

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

  }
   
  @Test
  public void fillDocumentationTest() throws Exception{
    NavigationInterceptor interceptor = new NavigationInterceptor();
    DocumentationContext context = new DocumentationContext();
    context.setLocale(Locale.GERMAN);
    BoostedNode root = SoftwareDocumentationUtils.createSoftwareDocumentationSlipcase(new ConfigurationPropertiesReader(), context, false);

    interceptor.fillDocumentation("noType",root , context);
  }
View Full Code Here

      List<String> mappings = webxml.getServletMappingUrlsForClass(DispatcherServlet.class.getName());
      //use the first mapping
      String mapping = mappings.get(0);
      relativeDispatcherServletPath  = MISSING_WEBAPP_PATH +  mapping.replace("*", "");
     
      DocumentationContext docContext = JEEDocumentationUtils.getDocumentationContext( context);
      if (docContext == null){
        log.warn("no documentationContext, skipping documentation");
      }
      else{
        for (Object docType: docContext.getDocumentationTypeNodes().keySet()){
            BoostedNode servletContextNode = JEEDocumentationUtils.getServletContextChapterNode(docContext, docType, context);
            if (servletContextNode != null)
              fillDocumentation(docType, servletContextNode, docContext);
        }
      }
View Full Code Here

TOP

Related Classes of gluebooster.basic.text.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.