Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332871 - DTDElementAdapter.getMaxOccur returns incorrect value
Summary: DTDElementAdapter.getMaxOccur returns incorrect value
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.dtd (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard: WI63995
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-17 13:24 EST by Galileo Perez CLA
Modified: 2011-01-11 20:55 EST (History)
3 users (show)

See Also:
keith.chong.ca: review+


Attachments
Modified the getMaxOccur method (1.72 KB, patch)
2010-12-17 13:29 EST, Galileo Perez CLA
galileo: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Galileo Perez CLA 2010-12-17 13:24:26 EST
Build Identifier: 

I added a DDE editor for a Faces config file with the following DTD:

    http://java.sun.com/dtd/web-facesconfig_1_1.dtd (Clicking the link will see the content)
   
I can see the problem even with an almost empty customization file like this:

<customization customizationNamespace=""
    customizationSchemaLocation=""
    xmlns="http://com.ibm.xwt.dde/CustomizationFile";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://com.ibm.xwt.dde/CustomizationFile CustomizationFile.xsd "
    ></customization>
    
The problem is as follows:

   Select the root element <faces-config> and add a <lifecycle> child element in the editor. The element is added in source, but in the tree view on the left side of the design pane, the <lifecycle> element can't be displayed. (See details in the attached screenshots)
    
   Some other elements have the similar problem. 

Reproducible: Always

Steps to Reproduce:
1.Open a faces config file (xml) with the DDE on design mode
2.Select the Faces Config Element on the overview side.
3.Add a new Lifecycle element
4.The element will be added just in the source code not it the design tab Tree element.
Comment 1 Galileo Perez CLA 2010-12-17 13:29:01 EST
Created attachment 185451 [details]
Modified the getMaxOccur method

Patch consists on validate the kind of content of the DTDelement if is a DTDRepeatableContent will use the getMaxOccurHelper, if isn't will keep the current implementation.
Comment 2 Galileo Perez CLA 2010-12-20 12:16:05 EST
feature in an adopter product fails because DTDElementAdapter.getMaxOccur returns incorrect value
Comment 3 Nitin Dahyabhai CLA 2011-01-11 20:55:50 EST
Released to 3.2.3 and HEAD.  Thanks!