This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 84755

Summary: Need isShared() in AXIComponent
Product: xml Reporter: Girish Balachandran <girixkumar>
Component: Schema ToolsAssignee: Samaresh Panda <samaresh>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 84157    

Description Girish Balachandran 2006-09-13 02:13:53 UTC
A method boolean isShared() in AXIComponent would be helpful as this logic is
replicated in the UI code and can be centralized in the model.

The basic algorithm would be as follows:

false = not shared
true = shared

The following algorithm in schema terms would work (I think):

Global ComplexType (complexType itself returns false)
 * Elements which are defined locally, return false
 * Elements which are coming from a super type or group return true, true is
applied for all children
 * Attributes which are defined locally return false
 * Attributes which come from a super type or through attribute group return true


Global Element (itself returns false)
 * Attributes and Elements defined within a local complex type (or simple type)
return false
 * Everything else returns true (I think everything which is a proxy basically)
includes element ref, attribute ref etc.


The algorithm might be as simple from the model side as returning true if the
component is a proxy and false otherwise.
Comment 1 Samaresh Panda 2006-09-14 02:19:19 UTC
It turns out, in addition to this, we need one more API getReferent() in Element
and Attribute.
Comment 2 Samaresh Panda 2006-09-14 02:22:22 UTC
AXIComponent.java: new revision: 1.1.2.66;
Attribute.java: new revision: 1.1.2.12;
Element.java: new revision: 1.1.2.21;
AttributeProxy.java: new revision: 1.1.2.8;
ElementProxy.java: new revision: 1.1.2.15;
SchemaGeneratorUtil.java: new revision: 1.1.2.14;
AttributeRef.java: new revision: 1.1.2.17;
ElementImpl.java: new revision: 1.1.2.37;
ElementRef.java: new revision: 1.1.2.24;
AttributeImpl.java: new revision: 1.1.2.15;
AXIModelUpdater.java: new revision: 1.1.2.31;
Comment 3 Girish Balachandran 2006-09-20 20:12:34 UTC
verified on 9/20