Results 1 to 8 of 8

Thread: BeanDoc 0.6 available.

  1. #1
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default 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!
    Darren Davison.
    Public Key: 0xE855B3EA

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    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??
    Alef Arendsen
    SpringSource
    http://www.springsource.com

  3. #3
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

    Thanks Alef. I don't know either, perhaps Colin can shed some light..?
    Darren Davison.
    Public Key: 0xE855B3EA

  4. #4
    Join Date
    Aug 2004
    Location
    Columbus, OH, USA
    Posts
    133

    Default

    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

  5. #5
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

    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.
    Darren Davison.
    Public Key: 0xE855B3EA

  6. #6
    Join Date
    Oct 2005
    Posts
    11

    Default 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...

  7. #7
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

    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,
    Darren Davison.
    Public Key: 0xE855B3EA

  8. #8
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

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

    Thanks again,
    Darren Davison.
    Public Key: 0xE855B3EA

Similar Threads

  1. BeanDoc and Spring attributes
    By ben_sion in forum Container
    Replies: 3
    Last Post: Oct 10th, 2005, 03:44 AM
  2. Beandoc crashing (on its samples!)
    By aaime in forum Container
    Replies: 17
    Last Post: Oct 7th, 2005, 07:21 AM
  3. Beandoc and Spring 1.2
    By trondgzi in forum Container
    Replies: 2
    Last Post: Jun 14th, 2005, 07:54 AM
  4. BeanDoc without the filesystem
    By kodos in forum Container
    Replies: 1
    Last Post: Jun 6th, 2005, 06:31 PM
  5. beandoc: 2 problems/ideas
    By simcha in forum Container
    Replies: 3
    Last Post: Apr 28th, 2005, 04:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •