On 18/03/2013 08:53, welkin zzp wrote:
> Hello,

Hello

> I have written a WPS service which is a web process service
> specification implementation of the ogc organizationplug-in in taverna
> framework,and I want to display detail information , says available
> values​​ ,port descriptionetc., in the "Detail" tab when I click on the
> activity's input or output port ,

You can do this with a ContextualView, assume it is 
WPSPortContextualView. You also need a factory for making the contextual 
view - WPSPortContextualViewFactory.

In the WPSPortContextualViewFactory you say:

public class WPSPortContextualViewFactory implements
                ContextualViewFactory<Object> {

        public boolean canHandle(Object selection) {
                if (!(selection instanceof ActivityInputPort) &&
                     !(selection instanceof ActivityOutputPort)) {
                     return false;
                 }
                return (hasContainingWPSActivity(selection));
        }
        
        public static boolean hasContainingWPSActivity(Object selection) {
                Processor p = null;
                Dataflow d = FileManager.getInstance().getCurrentDataflow();
                if (selection instanceof ActivityInputPort) {
                        p = Tools.getFirstProcessorWithActivityInputPort(d, 
(ActivityInputPort) selection);
                }
                if (selection instanceof ActivityOutputPort) {
                        p = Tools.getFirstProcessorWithActivityOutputPort(d, 
(ActivityOutputPort) selection);
                }
                Activity a = p.getActivityList().get(0);
                return a instanceof WPSActivity;
        
        }

        public List<ContextualView> getViews(Object selection) {
                return Arrays.<ContextualView>asList(new 
WPSPortContextualView(selection));
        }

}

You need to list WPSPortContextualViewFactory as implementing the SPI of 
ContextualViewFactory. So the file
net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
in your src/main/resources/META-INF/services needs to have the fully 
qualified name of WPSPortContextualViewFactory

> it's better if the activity canmarked
> in a different color which input port must be set those which do not in
> workflowwindow, how should I do ?

I am sorry but I do not understand this part of your question.

> Thanks

Alan



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
taverna-hackers mailing list
taverna-hackers@lists.sourceforge.net
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/
Developers Guide: http://www.taverna.org.uk/developers/

Reply via email to