Strap and Metannogen - Controlling other programs via network

localhost colon port

By opening external web addresses in text views, a dialog appears to open the Web page in the browser. Things are different for Web-addresses of the form http://localhost:portNumber?Text. Here a test. Open the notepad in the File-menu of Metannogen or Strap. Enter
      http://localhost:1234?Hello_world
    
By clicking you will get an Exception similar to:
      java.net.ConnectException: Connection refused
	    at java.net.PlainSocketImpl.socketConnect(Native Method)
	    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)	  
        ...
    
This is because Strap tries to connect to port 1234 but no program is listening to this port. Open a terminal and enter the line
      netcat -l -p 1234
    
The program netcat is installed on standard computer systems. On Windows, however, it might be necessary to use netcat via Cygwin shell. You can also try port numbers other than 1234. The lower port numbers are reserved but the hihger numbers can be used.

Context menu

Enter a word into the notepad and open the context menu by right clicking the word. Chose "Shell command or web application". You see an expandable tree with the branch "Demo". Within "Demo" you find the item "local host". By clicking this item, the given text will be send to the port 1234 which can be tested with netcat as described above.

Customization of "Shell command or web application"

Using the customize button in this dialog, own actions can be defined. The settings can be saved on this computer.

Customization via program parameter

All customizable lists can be changed by program parameters. The advantage is, that all Clients started via Web-start can be customized by modifying the Web-start link. The command line option/Web variable is formed by prepending "customizeAdd". In this case the command line option is "-customizeAddWebLinks fileWithSettings" and the web variable is "customizeAddWebLinks&fileWithSettings". The fileWithSettings contains lines like
      demo\Example: local host port%09.*%09 http://localhost:1234?blabla_*
    
wheras %09 codes the field separator tab and the asterisk is a place holder for the current text.

Customization of Metannogen

In Metannogen a list of cross-links for reactions can be defined using the program option "-customizeAddReactionCrossLinks File_With_List_Of_Crosslinks". If a reaction is activated, these crosslinks are shown in the info text field. They may be crude external web addresses, addresses starting with "http://localhost:port?" or symbolic names like DEMO_VIA_PORT_1234:* which are translated into an URL using the customize field "webLinks". Entries can be added to the customize field "webLinks" the program option "-customizeWebLinks File_With_List_Of_Web_links". A line could look like
      MY_CONNTECTION: http://localhost:1234?Some_url-encoded_text_*