Tuesday, June 25, 2013

Download and configure the Starface UCI Java API in Eclipse

The first step to build a first class CTI plugin is to get a test environment where you can try out functions of the new java api without the complexity of the whole Notes client plugin system.

First of all, download the UCI Java API from the starface website and expand it to a folder on your harddisk. Unfortunatly the log4j.jar is missing in the UCI Java API download. So you have to download the log4j.jar from http://www.apache.org/dyn/closer.cgi/logging/log4j/1.2.17/log4j-1.2.17.zip and copy the log4j.jar from this zip to the "starface-uci-proxy-java-2.2.0\lib" folder in the UCI Java API folder.

Create a new Java Project for your Tests in your Eclipse IDE.


Right click your new Java project and select "Build path->Configure Build Path..."


 In the Build Path Configuration select the "Libraries" Tab and click the "Add External JARs..." Pushbutton.

In the File selection dialog go to the directory where you have expanded the UCI Java API in Step 1 and add all jars in the "starface-uci-proxy-java-2.2.0\lib" folder to your build configuration.


Repeat the same steps to add the "starface-uci-proxy-2.2.0.jar" in the "starface-uci-proxy-java-2.2.0" folder to your build path configuration.

As an optional but very recommended step you can add the javadoc of the API to your build configuration. To do so expand the "starface-rpc.*.jar", click the Javadoc location line and select Edit.


In the following Dialog select "Browse" and browse to the location of the "starface-uci-proxy-java-2.2.0\docs\starface-rpc" folder.

Repeat the steps to add the Java doc for starface-uci and starface-uci-proxy too.

Now your "Build path configuration" should look like this:


To test if everything has been configured correctly create a new Java class in your new Java project and paste the following code to the main function.

 public static void main(String[] args) {
  UciProxy proxy = null;
  try {
   UcpTransportFactory ucpTransportFactory = new HttpUcpTransportFactory(
     Inet4Address.getLocalHost().getHostAddress(), 8181,
     "starfacehost", 80, false, null, null);
   final UciProxyFactory uciProxyFactory = UciProxyFactory
     .createWithTransportFactory(ucpTransportFactory);
   UciProxy uciProxy = uciProxyFactory.createUciProxy("userID",
     "password");
   uciProxy.connect();
   proxy = uciProxy;

  } catch (UnknownHostException e) {
   e.printStackTrace();
  } catch (UcpConnectionFailedException e) {
   e.printStackTrace();
  } finally {
   if (proxy != null)
    proxy.disconnect();
  }
 }

You have to replace "starfacehost" "userID" and "password" with the correct values of your environment. When you run the programm you should see the following status message in the console view.

08:40:06,139 DEBUG openTransportAndAttach: Connecting to UCP server...
08:40:06,172 DEBUG Sending RPC request: ucp.v22.requests.connection.login() to http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,234 DEBUG Incoming RPC return value: true from http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,234 DEBUG Sending RPC request: ucp.v22.requests.service.subscribeEvents("ucp.v22.events.connection") to http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,234 DEBUG Incoming RPC return value: true from http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,234 INFO  shutdown: RPC server is currently not running.
2013-06-25 08:40:06.250:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2013-06-25 08:40:06.282:INFO::jetty-6.1.24
2013-06-25 08:40:06.297:INFO::Started SocketConnector@0.0.0.0:8181
08:40:06,297 DEBUG Registered  RpcMethod [name=ucp.v22.events.connection.reset, method=public abstract void de.starface.integration.uci.java.v22.ucp.messages.events.UcpConnectionEvents.reset(), requiredAuthType=null, object=RpcObject [rpcInterface=interface de.starface.integration.uci.java.v22.ucp.messages.events.UcpConnectionEvents, namePrefix=null, requiredAuthType=class de.starface.integration.uci.v22.client.transport.http.LoginUrlAuthToken, name=ucp.v22.events.connection]]
08:40:06,297 DEBUG Successfully registered RpcObject [rpcInterface=interface de.starface.integration.uci.java.v22.ucp.messages.events.UcpConnectionEvents, namePrefix=null, requiredAuthType=class de.starface.integration.uci.v22.client.transport.http.LoginUrlAuthToken, name=ucp.v22.events.connection]
08:40:06,297 DEBUG openTransportAndAttach: Connecting to UCP server...
08:40:06,297 INFO  onConnectionEstablished: Connection to UCP server successfully initialized.
08:40:06,297 DEBUG startReconnectTimer: Activating reconnect timer.
08:40:06,297 DEBUG resubscribeAllEvents: Resubscribing all UCP events...
08:40:06,297 DEBUG resubscribeAllEvents: Finished resubscribing events.
08:40:06,297 INFO  onConnectionEstablished: Connection to UCP server successfully initialized.
08:40:06,297 DEBUG stopReconnectTimer: Deactivating reconnect timer.
08:40:06,297 DEBUG closeTransportAndDetach: Disconnecting from UCP server...
08:40:06,297 DEBUG Sending RPC request: ucp.v22.requests.connection.logout() to http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,297 DEBUG Incoming RPC return value: true from http://starfacehost:80/xml-rpc?de.vertico.starface.auth=edb03a2ba7cca2c7b8100dfdedc83ba0&de.vertico.starface.user=userID&de.vertico.starface.callback.type=http&de.vertico.starface.callback.host=172.16.2.85&de.vertico.starface.callback.port=8181&de.vertico.starface.callback.path=/
08:40:06,297 DEBUG shutdown: Shutting down RPC server...
2013-06-25 08:40:06.297:INFO::Stopped SocketConnector@0.0.0.0:8181
08:40:06,407 DEBUG shutdown: RPC server shut down.
08:40:06,407 INFO  closeTransportAndDetach: Successfully disconected from UCP server.
08:40:06,407 INFO  shutdown: RPC server is currently not running.



Trace DHCP traffic with wireshark

The best tool to analyze weird problems in DHCP Systems is the network analysator Wireshark. But the network traces of wireshark can be very big and confusing. So you have to use filters to select only the traffic you really need to solve your problem. To see only DHCP traffic on your network interface you have to apply "bootp.option.type==53" in Wireshark.


Thursday, June 20, 2013

Is an IBM System to weigh SPR's a Dream?

Maybe this dream can come true, when the idea "Change the way you, as a customer, can weigh on SPR's" gets many votes. So if you want to tell IBM which SPR's are the most important then vote for this idea on idea jam.


Scott Souder has announced ODBC for Domino 9

Better late then never Scott Souder has announced the availability of the ODBC driver for Domino 9.

When you have an IBM id you can download the ODBC driver from the developerworks site

The part numbers for the 32 bit version is CIMW6EN and for the 64 bit version CIMW7EN.
 

Wednesday, June 19, 2013

A new toy has arrived

Last week we got a new toy to play at our company. A Starface PBX which will possibly replace our old Ericsson PBX system. The Starface PBX is built on Opensource technology like Asterisk and Hylafax with a proprietary Web UI. The system is very easy to administrate and you can connect the PBX over IP trunks or ISDN Links to the telephony providers. My task in the evaluation process is to check if i can build a first class CTI Solution which integrates with our custom CRM and ERP System. So stay tuned if you are interested in informations how to place calls, get calllists or make configuration changes of your telephone from the Notes client.

Tuesday, June 18, 2013

Easy way to get the Url of an update site in Notes

If you want to create a new widget from a feature in an update site you can either type in the url of the update site in the new widget dialog manually (ServerName/ReplicaID/site.xml).



Wednesday, June 12, 2013

Read Character Columns with CCSID 65535 in JDBC

In DB2 on the System i every Character Column have a CCSID which defines with which characterset the data of this column is encoded. For example a column with german characters should normally be encoded with 273 or 1141. When you access this columns from JDBC the data will be automatically converted from the characterset used in the column to Unicode. But when the CCSID of the column is 65535 (binary data) the jdbc driver will not convert and since all data on the System i is stored in EBCDIC you will only get garbage from this columns.





But there is an easy way to fix this problem. You need to set the translateBinary Option to true when you connect to your System i and every 65535 character field will be translated from EBCDIC to Unicode automatically.

  AS400JDBCDataSource dataSource = new AS400JDBCDataSource(systemName, userName, password);
  dataSource.setTranslateBinary(true);
  Connection conn = dataSource.getConnection();

  // Or when you prefer the old connection Method
  Connection conn2 = DriverManager.getConnection("jdbc:as400://" + systemName + ";translate binary=true",
    userName, password);

Then the result is human readable.


ad