/** * Create a new factory with a single application endpoint parameter */ public SoaplabProcessorFactory(String completeEndpoint) { init(completeEndpoint); }
/** * Returns the icon for this scavenger */ public ImageIcon getIcon() { return new SoaplabProcessorInfoBean().icon(); }
/** * Invoke the web service, passing no parameters, and return the result. * * @see callWebService(String target, String operation, Object[] parameters) * */ public static Object callWebService(String target, String operation) throws ServiceException, RemoteException { return callWebService(target, operation, new Object[0]); }
/** * populates the tree with discovered categories, and services. * @param categories */ private void populateTree(List<SoaplabCategory>categories) { for (SoaplabCategory category : categories) { DefaultMutableTreeNode categoryNode = new DefaultMutableTreeNode(category.getCategory()); for (String service : category.getServices()) { SoaplabProcessorFactory f = new SoaplabProcessorFactory(base, service); f.setCategory(category.getCategory()); categoryNode.add(new DefaultMutableTreeNode(f)); } this.add(categoryNode); } }
public ColJEditorPane(String type, String text) { super(type, text); setOpaque(false); setEditable(false); setPreferredSize(new Dimension(0, 0)); // Add a listener for hyperlinks in the metadata addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent r) { try { if (r.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { ColJEditorPane.this.setPage(r.getURL()); } } catch (Exception ex) { ex.printStackTrace(); } } }); }
/** * Get the properties for this processor for display purposes */ public Properties getProperties() { Properties props = new Properties(); props.put("Soaplab URL", getEndpoint().toString()); return props; }
/** * Create a new Soaplab scavenger, the base parameter should be the base URL * of the Soaplab service, i.e. if your AnalysisFactory is at * http://foo.bar/soap/AnalysisFactory the parameter should be * http://foo.bar/soap/ */ public SoaplabScavenger(String theBase) throws ScavengerCreationException { // Making sure there is / at the end of theBase super("Soaplab @ " + (theBase.endsWith("/") ? theBase : theBase + "/")); // Of course we have to do this again since we are not allowed to do // such stuff before super() theBase=theBase.trim(); base = theBase.endsWith("/") ? theBase : theBase + "/"; // Get the categories for this installation try { List<SoaplabCategory> categories=SoaplabScavengerAgent.load(base); populateTree(categories); } catch (MissingSoaplabException e) { logger.warn("Unable to load categories for SoaplabScavenger",e); throw new ScavengerCreationException(e.getMessage()); } }
/** * Returns a list of soaplab categories, containing a list of their services. * Throws MissingSoaplabException if an installation cannot be found. */ public static List<SoaplabCategory> load(String base) throws MissingSoaplabException{ List<SoaplabCategory> categories=new ArrayList<SoaplabCategory>(); // Get the categories for this installation boolean foundAnInstallation = loadCategories(base + "AnalysisFactory",categories); // Yes, bitwise OR is on purpose, to make sure the second // loadCategories() is always run. Do NOT replace with // foundInstallation = foundInstallation || getCategories(..) foundAnInstallation |= loadCategories(base + "GowlabFactory",categories); if (!foundAnInstallation) { // Neither Soaplab nor Gowlab were found, probably a fault throw new MissingSoaplabException("Unable to locate a soaplab installation at \n" + base); } return categories; }
public void actionPerformed(ActionEvent ae) { UIUtils.createFrame(sp.getModel(), new PollingPropertiesPanel( sp), 100, 100, 280, 125); } };
protected void paintComponent(Graphics g) { final int width = getWidth(); final int height = getHeight(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint(new GradientPaint(0, 0, col, width, 0, col2)); g2d.fillRect(0, 0, width, height); g2d.setPaint(oldPaint); super.paintComponent(g); }
protected void paintComponent(Graphics g) { final int width = getWidth(); final int height = getHeight(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint(new GradientPaint(0, 0, col, width, 0, col2)); g2d.fillRect(0, 0, width, height); g2d.setPaint(oldPaint); super.paintComponent(g); } /**
public ColXMLTree(String text) throws java.io.IOException, org.jdom.JDOMException { super(text); setOpaque(false); }
public String getName() { if (processor==null){ return "Polling properties"; } else{ return "Polling properties for " + processor.getName(); } }
private void init(String completeEndpoint) { String[] split = completeEndpoint.split("::"); if (split.length == 2) { // Old form : http://foo.bar.com/root/category::analysisname this.applicationname = split[1]; this.endpoint = split[0] + "." + split[1]; } else { // New form : http://foo.bar.com/root/category.analysisname split = completeEndpoint.split("\\."); this.applicationname = split[split.length - 1]; this.endpoint = completeEndpoint; } setName(this.applicationname); }
public Element elementForFactory(ProcessorFactory pf) { SoaplabProcessorFactory slpf = (SoaplabProcessorFactory) pf; Element spec = new Element("soaplabwsdl", XScufl.XScuflNS); spec.setText(slpf.getEndpoint()); return spec; }
public ProcessorFactory getFactory(Element specElement) { String endpoint = specElement.getTextTrim(); return new SoaplabProcessorFactory(endpoint); }
public void hyperlinkUpdate(HyperlinkEvent r) { try { if (r.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { ColJEditorPane.this.setPage(r.getURL()); } } catch (Exception ex) { ex.printStackTrace(); } } });
public static void main(String[] args) throws Exception { System.out.println("Starting test : SoaplabProcessorCreation"); // Create a new ScuflModel ScuflModel model = new ScuflModel(); // Register a listener to print to stdout model.addListener(new ScuflModelEventPrinter(null)); // Attempt to create a new SoaplabProcessor model.addProcessor(new SoaplabProcessor(model, "my_processor", "http://industry.ebi.ac.uk/soap/soaplab/nucleic_gene_finding::getorf")); System.out.println("Finished test : SoaplabProcessorCreation"); }
/** * Create a new factory configured with the specified endpoint base and * application name, which will be concatenated to produce the endpoint URL. */ public SoaplabProcessorFactory(String endpointbase, String applicationname) { init(endpointbase + applicationname); }
/** * Invoke the web service, passing a single String parameter, and return the result. * * @see callWebService(String target, String operation, Object[] parameters) * */ public static Object callWebService(String target, String operation, String parameter) throws ServiceException, RemoteException { return callWebService(target, operation, new String[] { parameter }); }