Document object to String object (Java Code)

Converting a Document object to a String object in Java is an issue I’ve run into a couple times at work. I wanted to see the output of a WebService call response that was in XML in the console. Here’s a quick code snippet I found that handles this:

// xmlDoc is the Document object

DOMSource domSource = new DOMSource(xmlDoc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);

TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(domSource, result);

System.out.println(writer.toString());

Terminal Server Exceeded Connections

Since I do most of my work remotely, I use the Remote Desktop feature of Windows often. I have at least 10 different machines and often time people are using the same machines and forget to log out. What results is the common message: “The terminal server has exceeded the maximum number of allowed connections”. The work around for this is pretty simple.

Open a command prompt as the domain administrator that the remote machine is set to

net use /user:[username] \\servername\share

Next query the current sessions for the remote machine.

query session /server:servername

Now with the information, you can use the reset command to log off that user with the command below.

reset session [ID] /server:servername

This will reset the session and now you can log in again.

Facebook Platform API

So I finally got around to playing with the Facebook Platform API yesterday and my initial take is that there’s a lot of potential to leverage the API and extract and transform the data the resides on Facebook. Of all the API functions, I think ‘fql.query’ alongside understanding the Facebook Query Language gives you the most power to pull and analyze the social and marketing data that resides on their servers around millions of users.

Simply having the ‘uid’ of a user, along with the ‘Users.getInfo‘ function, gives you a ton of information about that user and the only limitation is the user themselves. Unless a Facebook user realizes the security concerns of the data that they’re sharing, their information is free for anyone to see and extract.

PHP is the language of choice for most Facebook developers I think (myself included) but I decided to take the ASP.NET / C# route to see how I could integrate it with Consona CRM. The Facebook Developer Toolkit, which just released a new version (lucky for me) is fairly comprehensive but because it’s so new, the documentation needs some polishing up and there’s not many code samples out there yet around it. I created a quick and dirty solution that takes the customer information and passes it to Facebook to either pull up the customer Facebook profile information or run a search and see if that customer is a Facebook user. One issue that I’ve run into so far is the around the session data. If a parent frame has a different domain than the child page in IE, the session data (stored in the Session object) is not preserved as a security precaution. So unless I preserve the initial session that is created, the user currently needs to login each time a new customer record is pulled up.

Ribbit API

I’ve been fiddling around with Ribbit the past couple days and trying to figure out how to integrate it with the Consona CRM platform. Ribbit has an incredibly full featured API and is developed primarily with Adobe Flex so I’ve had to do a crash course on the side but it hasn’t been all that bad. The Adobe Flex Builder leverages Eclipse so if you’ve used Eclipse IDE for development in the past (Java, Aptana, etc…) it’s really a piece of cake. The SDK that Ribbit provides also has some great examples.

Functionally, Ribbit easily replaces the Consona CRM CTI toolbar. What I need to figure out is how to integrate a user logging into to Ribbit as a user of the Consona system and then be able to track incoming and outcoming phone calls to the customer records in CEDB. Unfortunately I’ve been sidetracked with some other issues the past couple days so I haven’t been able to give my full attention to this side project but I’ll post updates in the future.

What has suprised me is the lack of attention that Ribbit has received in the marketplace. It was acquired by BT a little while ago and they’ve been quietly been release newer versions but the potential of this API is great.

.NET , PHP, or Java

As a sales engineer, I’m in a strange position where I need stay ahead of the latest technologies in order to know how to communicate how my product can fit into their technology stack. The majority of the code base at work relies on .NET and ASP but I often hear about a prospects or client usingĀ  PHP, Java, and other open source technologies in their environment. Constantly switching back and forth does present a challenge but in the end it’s what I have to do.

Google and Enterprise CRM

The post on Mashable and TechCrunch about the latest venture between Google and Salesforce does create a rather unique situation in the realm of CRM. Does this bring an even bigger player into the CRM space? One can argue that the CRM space that Salesforce resides in, software as a service (SaaS) differs greatly from the space that on-premise CRM solutions such as Oracle/Siebel, Consona CRM, Microsoft CRM. But observing the way that software in general is moving toward these days, SaaS and Cloud Computing are starting to slowly make a big impact. It’s hard to say right now if Google will acquire Salesforce in order to extend their reach into the enterprise space, but if they do, it’ll definitely make my work more interesting.