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 11864 - Implement support for DataObject.Container
Summary: Implement support for DataObject.Container
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL: http://projects.netbeans.org/ps/DesOr...
Keywords:
Depends on:
Blocks:
 
Reported: 2001-05-01 15:08 UTC by Jaroslav Tulach
Modified: 2008-12-22 22:30 UTC (History)
3 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
The skeleton - Ales, do not forget to change the @author field ;-) (3.02 KB, text/plain)
2001-05-01 15:09 UTC, Jaroslav Tulach
Details
Improved version that uses URLs (4.43 KB, text/plain)
2001-05-03 14:20 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2001-05-01 15:08:17 UTC
We have introduced a generic interface how DataObject can provide its children.
Currently two objects implement it. DataFolder and DataShadow. We are in need to
have a generic support, so implementing the interface will be easier for
compound data objects that will try to keep list of its children.

I have created a sketch of possible interface, the implementation should store
the links in xml file in similar style as DataShadow (filesystem name + resource
name). 

The interface might not be prefect and can be changed during its usage, so I
would suggest to test the ContainerSupport by changing DataShadow implementation
to use it.
Comment 1 Jaroslav Tulach 2001-05-01 15:09:06 UTC
Created attachment 1287 [details]
The skeleton - Ales, do not forget to change the @author field ;-)
Comment 2 Jaroslav Tulach 2001-05-01 15:11:10 UTC
The reason why most of the methods are protected is that this is SPI interface
and I do not want other code than the one that creates this object to call
methods add,remove,etc. methods on it. Making them public would probably be
mistake (happend with MultiDataObject a time ago).
Comment 3 Jesse Glick 2001-05-02 17:04:52 UTC
Who is expected to use this support?

I do understand the intended use of the methods very well--why are the
propertyChange methods abstract, when normally such things are concrete and
final? Why are the read & write & createChildren methods concrete final, when
normally such things are abstract? Why does getChildren return an empty array?
Why would the implementation store things in an XML file, when for folders this
is nonsense, and for .shadow and .group there is an existing text format that
cannot simply be replaced? Maybe it needs some better documentation or
discussion of the API.
Comment 4 Jaroslav Tulach 2001-05-03 13:52:04 UTC
Right Jesse, this has to be discussed. 
http://projects.netbeans.org/ps/DesOrg.html#GC
Comment 5 Jaroslav Tulach 2001-05-03 14:20:06 UTC
Created attachment 1298 [details]
Improved version that uses URLs
Comment 6 Jaroslav Tulach 2001-05-03 14:22:53 UTC
Jesse, this is just support, DataFolder does not need to use it. As a support it
has to offer more than plain interface, for example storage to XML. Listeners
are abstract, because I think they will usually be delegated to data object that
is using this support.
Comment 7 Jesse Glick 2001-05-03 16:49:43 UTC
OK, I missed the context for this, the URL is helpful...
Comment 8 Jan Chalupa 2001-05-06 08:10:26 UTC
Target milestone -> 3.3
Comment 9 Martin Ryzl 2001-05-07 10:21:26 UTC
GroupShadow seems to be the best candidate to implement DataObject.Container. I 
would suggest the following requirements:

1) support the current format
2) support for relative links. URL is not bad but I'm strictly against using 
nbfs protocol.
3) use XML format. It has been used in project targets demo - see targets branch 
in projects module (it contains an implementation as well). The format is:

    <FileSystem systemName="G:/netbeans_home/Development">
        <File name="/example"/>
        <File name="/icons"/>
    </FileSystem>

if the link starts with '/' it is an absolute link (relative to the 
filesystem/all filesystems) otherwise it is a relative link (relative to the 
Container). systemName may be omitted.

4) The implementation should allow adding additional elements/attributes for 
subclasses (for example naming policy for group templates).




Comment 10 Svata Dedic 2001-06-26 18:49:46 UTC
If this Support also should support project links, then I would like to allow 
customization in the algorithm how is the "base" or "root" name computed and 
resolved. The default implementation will always base it on the filesystem's 
system name. Development Object's implementation will be then able to 
create/resolve those names according to some "places" defined by the project.
ContainerSupport could be also provided with a reference point to a filesystem 
in order to store link(s) relatively to that base point.
It needs to be documented what is going to happen if some change is made to 
the linked DataObject properties (name, primary file).
Comment 11 Vitezslav Stejskal 2001-07-11 21:30:07 UTC
Done, in main trunk.
Comment 12 Jan Zajicek 2001-07-13 13:03:27 UTC
x