Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: IGeoResource / IGeoResource clarification / discussion

Seems we are on the same track,

Comments in line:

These IGeoResource methods are considered ui safe:
- getIdentifier()
- getService()
- equals() & hashCode()
- getStatus() & getStatusMessage()

mmm, this isn't always posible/advisable. It is entirely posible to have
a resource without an associated Service until it is required to be
resolved. That said ... a placeholder could be created and returned.
I need do need a parent for user interface land, suggestions? You could return null and use events when you have a parent (nasty for the poor user interface). Also see the comment about IResource and Phantom, we could have a Type of Phantom and the ui could know not to look for a parent...

This IGeoResourceInfo method:
- getType()

And these are considered blocking:
- getInfo()

Can force a load when the info is loaded ... most cases would do this
anyways.
That would be the "blocking" part :-)

Recomendation/Discussion:
- make getInfo() throw an IOException (so it is *really* obvious I/O is
happeningSure, this would change the current assumption though that the info is
loaded at this time.
Not sure I understand - I would think an IOException would enforce the idea that Info is loaded. Although I guess an IO problem should result in a phantom with enough information in getStatus to communicate the error.

- move getType() to IGeoResource, we will need to remove the constant WRITE as it the only ability we would be "know" simply from the identifier.
The move is fine, but unsure as to the WRITE constant.
Don't we have to check the service to figure out if something is writable?

Consider/Discussion:
You may also want to look at the IResource link bellow:
- it has a getWorkspace() indicating that a getCatalog() method may be useful (allow client code the ability to know where to listen for event notification).
Yes and No, I currently magically move the IService around ...
Still as client I *need* to know where to get my notification from, besides I think the replace event can be used to communicate the Catalog Move. You are replacing the IGeoResource with another in a different catalog after all.

- getName() defined to be last section of the Path, we can define getName() to be the name of the getIdentifierURL()
in most cases it's the reference of the url.
Right now I have the following code in the LabelItemProvider:

IGeoResource resource = layer.resource();
label = resource.getIdentifier().getPath();
        if( label != null || label.length() == 0 ){
            int split = label.indexOf('/');
            if( split != -1 ){
                label = label.substring( label.lastIndexOf('/') );
            }
            return label;
        }

Alternate proposal: Make a Services utility class with:
- getName( IService )
- getDefaultIcon( IService )
- getName( IGeoResource )
- getDefaultIcon( IGeoResource )

This would prevent everyone from making up their own recipe for identification to label (when title is not available of course).

- contains the idea of Phantom resources (ie pending), a similar idea
It may be nice to have the Phantom type, just so we can indicate that in the user interface. See above comment about replace event for moving a Phantom into a the local Catalog for actual data access..

may be useful for search results that we are not connected to yet.
- has both session properties, and persistent properties (w/ 2k limit)
Dont like this ... the represent the service/resource ... don't want
then to hold people's state too.
Not sure I like it either, but I suspect people will ask for it. We can wait until they do. Most of them will be content to play with
Layer (which already has a properties Blackboard for collaboration)..


Back to the top