Bug 178490 - [api] ISubSystemConfigurationAdapter.getSystemFilterImage() should be passed context information
Summary: [api] ISubSystemConfigurationAdapter.getSystemFilterImage() should be passed ...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-03-21 02:52 EDT by Tobias Schwarz CLA
Modified: 2008-08-13 13:17 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Schwarz CLA 2007-03-21 02:52:23 EDT
Build ID: e33m5, rse20m5

Steps To Reproduce:
ISubSystemConfigurationAdapter.getSystemFilterImage() and 
ISubSystemConfigurationAdapter.getSystemFilterPoolImage()  should get the references for filter and filter pool to know the context instead of the filter and the filter pool.

knowing the context (subsystem, host) is needed to decorate the filter and/or filter pool according the subsystem and/or host where this filter (pool) is placed.

More information:
Comment 1 Martin Oberhuber CLA 2007-03-21 06:26:18 EDT
Marking as API change - Dave can you comment on this please:

I agree that when returning an image for a filter or filter pool, in order to properly decorate it with status information it is important to know the context (of the ISubSystem) that the filter is used in.

I'm wondering whether it would be possible to pass in an ISystemFilterReference / ISystemFilterPoolReference instead of the ISystemFilter / ISystemFilterPool? The Reference objects would hold information about the filter as well as the context. 

Proposed change
OLD:
ImageDescriptor getSystemFilterPoolImage(ISystemFilterPool filterPool);
ImageDescriptor getSystemFilterImage(ISystemFilter filter);

NEW:
ImageDescriptor getSystemFilterPoolImage(ISystemFilterPoolReference fpRef);
ImageDescriptor getSystemFilterImage(ISystemFilterReference fRef);
Comment 2 Martin Oberhuber CLA 2007-03-21 06:31:46 EDT
FYI: It looks like currently, when the image is actually needed:
1. the SystemView finds a FilterReference;
2. the SystemViewFilterReferenceAdapter finds the filter
3. the filter is adapted to an ISystemViewFilterAdapter
4. the ISystemViewFilterAdapter asks the SubsystemConfigurationAdapter for 
   the image

We propose to streamline the process, such that in (2) the FilterReferenceAdapter directly asks the SubsystemConfigurationAdapter for the image to use with the
reference.

What I am not sure about is, whether it is possible to get rid of the method
that returns an image for the actual filter. Where would a 
SystemViewFilterAdapter actually be used? Aren't we using filter references
everywhere?
Comment 3 David McKnight CLA 2007-03-21 09:37:50 EDT
I guess, up until now, we never cared about context information for images of filters.  Using filter reference (with the additional context information) seems reasonable although one thing we should check before doing this is what gets called from the team view (since we have no context for the objects in there).
Comment 4 Martin Oberhuber CLA 2007-03-21 09:53:52 EDT
Right. We might end up having to provide both "OLD" and "NEW" variants.

A default implementation for the "NEW" variant in SubsystemConfigurationAdapter could get the filter out of the filterReference and call the getSystemFilterImage() method with it. Then, implementors which do not care about the context do not need to change and it's a non-breaking API change.
Comment 5 David McKnight CLA 2007-03-21 11:28:37 EDT
I've added the proposed APIs while keeping the originals.   The default implementation in SubSystemConfigurationAdapter is as follows:

		/**
		 * Supply the image to be used for filter pool references.  This implementation
		 * just gets the referenced filter pool and calls the method
		 * getSystemFilterPoolImage(ISystemFilterPool) on it.
		 * Override this method to provide custom images for filter pool references.
		 */
		public ImageDescriptor getSystemFilterPoolImage(ISystemFilterPoolReference filterPoolRef)
		{
			return getSystemFilterPoolImage(filterPoolRef.getReferencedFilterPool());
		}

		/**
		 * Supply the image to be used for filter references.  This implementation 
		 * just gets the referenced filter and calls the method
		 * getSystemFilterImage(ISystemFile) on it.
		 * Override this method to provide custom images for filter references.
		 */
		public ImageDescriptor getSystemFilterImage(ISystemFilterReference filterRef)
		{
			return getSystemFilterImage(filterRef.getReferencedFilter());
		}
		
Comment 6 Martin Oberhuber CLA 2008-08-13 13:17:41 EDT
[target cleanup] 2.0 M6 was the original target milestone for this bug