Announcement Announcement Module
Collapse
No announcement yet.
BeanDoc 0.6 available. Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeanDoc 0.6 available.

    The 0.6.1 release of BeanDoc is now available

    BeanDoc is the tool that facilitates documentation and graphing of Spring bean factories and application context files. While very easy to use, it is designed to be flexible and extensible to meet most needs.

    I'm very keen for as much feedback as possible on features and bugs. Please give it a shot and submit comments via the forums or the Confluence pages.

    http://opensource.atlassian.com/conf...play/BDOC/Home

    Thanks all!

  • #2
    Great, I'll have a look at it soon!

    p.s. I've changed it into an announcement for you. Don't know why you can't do this??

    Comment


    • #3
      Thanks Alef. I don't know either, perhaps Colin can shed some light..?

      Comment


      • #4
        BTW I wanted to take a moment so say that BeanDoc is outstanding. Having a graphical representation of bean dependancies will make a splash with our management, auditors, architecture review board and junior teammates trying to come up to speed. Excellent work - thanks!

        Scott

        Comment


        • #5
          Thanks for your comments Scott - glad it's of use to you

          I think much of the credit needs to go to the ATT developers who wrote GraphViz though - great stuff.

          Comment


          • #6
            beandoc: support for includes

            i don't know if it's the good post but i think it's interessting for the beandoc users

            i've modified the org.springframework.beandoc.DefaultContextProcesso r to handle the includes in the files
            Code:
            <beans>
              <import resource="classpath&#58;/ent-context.xml"/>
            <beans>
            in the method buildDomsFromInputFiles() i have added a called to handleIncludes

            Code:
            	/**
            	 * generate in memory DOM representations from the input files on disk
            	 * 
            	 * @return a Document&#91;&#93;
            	 * @throws IOException
            	 */
            	private Document&#91;&#93; buildDomsFromInputFiles&#40;&#41; throws IOException &#123;
            		logger.debug&#40;"Starting building DOM trees from input files"&#41;;
            	 ....
            
            			// set an attribute on the root element to mark the original input
            			// file
            			Element root = contextDocuments&#91;i&#93;.getRootElement&#40;&#41;;
            			root.setAttribute&#40;Tags.ATTRIBUTE_BD_FILENAME,
            					normalisedFileNames&#91;i&#93;&#41;;
            			logger.debug&#40;"Attribute &#91;" + Tags.ATTRIBUTE_BD_FILENAME
            					+ "&#93; set to &#91;" + normalisedFileNames&#91;i&#93; + "&#93;"&#41;;
            
            			handleIncludes&#40;contextDocuments, builder, i&#41;;
                    ...
            and here's the code of the handleIncludes method

            Code:
            private void handleIncludes&#40;Document&#91;&#93; contextDocuments, SAXBuilder builder, int i&#41; throws IOException &#123;
            		List imports = contextDocuments&#91;i&#93;.getRootElement&#40;&#41;.getChildren&#40;
            				"import"&#41;;
            
            		List importedbeans = new ArrayList&#40;&#41;;
            
            		for &#40;Iterator iter = imports.iterator&#40;&#41;; iter.hasNext&#40;&#41;;&#41; &#123;
            			Element includedImport = &#40;Element&#41; iter.next&#40;&#41;;
            			String importfile = includedImport
            					.getAttributeValue&#40;"resource"&#41;;
            			ResourceLoader loader = new DefaultResourceLoader&#40;&#41;;
            			Resource res = loader.getResource&#40;importfile&#41;;
            				try &#123;
            				Document importDocument = builder.build&#40;res
            						.getInputStream&#40;&#41;&#41;;
            				List beans = importDocument.getRootElement&#40;&#41;.getChildren&#40;
            						"bean"&#41;;
            				for &#40;Iterator iterator = beans.iterator&#40;&#41;; iterator
            						.hasNext&#40;&#41;;&#41; &#123;
            					Element bean = &#40;Element&#41; iterator.next&#40;&#41;;
            					importedbeans.add&#40;bean&#41;;
            				&#125;
            
            			&#125; catch &#40;JDOMException e&#41; &#123;
            				throw new BeanDocException&#40;
            						"Unable to parse or validate input resource &#91;"
            								+ res + "&#93;", e&#41;;
            			&#125;
            
            		&#125;
                            // move the bean nodes to the current contextDocuments
            		for &#40;Iterator iter = importedbeans.iterator&#40;&#41;; iter.hasNext&#40;&#41;;&#41; &#123;
            			Element bean = &#40;Element&#41; iter.next&#40;&#41;;			contextDocuments&#91;i&#93;.getRootElement&#40;&#41;.addContent&#40;bean.detach&#40;&#41;&#41;;
            		&#125;
            	&#125;
            and voila...

            Comment


            • #7
              Is it possible you could post .patch files for the changes you made either to JIRA or the spring-developer mailing list? I'd be very interested in getting this included in beandoc - it's one of the annoying things it can't do right now.

              Thanks for sharing your efforts.

              Regards,

              Comment


              • #8
                a modified version of this that recurses imports is now in CVS.

                Thanks again,

                Comment

                Working...
                X