Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Saving for posterity

Saving For Posterity

These are snippets of code I’ve used recently for finding data in our Connections environment at work. Considering IBM’s wikis and other online publications are going down starting after the new year, I thought I’d post here in case they’re Needed again.

I was tasked with finding a list of the most active activities and communities in Connections for the last 6 months and their prospective owners. And because our Cognos installation has been borked since the upgrade from 4.5 to 5.5, I needed to find this information the hard way. I was pointed to this article written by Darren Cacy (kcibmer) in one of the IBM dev community blogs, detailing the following:

Run these commands from the command line of the Connections server, in the Deployment Manager directory (ex. /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin):

./wsadmin.sh -user xxxxxx -password zzzzzzzz -port 8879 -lang jython

wsadmin>execfile(‘communitiesAdmin.py’)
wsadmin>file=open(‘all.txt’,’w’)
wsadmin>allcomm=CommunitiesService.fetchAllComm()
wsadmin>file.write((CommunitiesService.fetchMember(allcomm)).toString())
wsadmin>file.close()

wsadmin>exit

This creates a file called all.txt in the current directory.

You’re supposed to run a Perl script next to parse the raw data into a more readable form and output that to a CSV which you can then filter further to find what you need. Since the file is also hosted on IBM’s servers, I uploaded it to PasteBin.

I took a screenshot of the post just in case I needed it next week. You can find it here.

And since I needed the Activities data in addition to Communities, I used the above example for the following:

wsadmin>execfile(‘activitiesAdmin.py’)
wsadmin>file=open(‘allact.txt’,’w’)
wsadmin>file.write((ActivityService.fetchActivities()).toString())
wsadmin>file.close()
wsadmin>exit

That created a file called allact.txt containing all Activities data. Unfortunately I did not have a parser pre-written for that so I had to parse it by hand. I used UltraEdit because that allows me to write macros on the fly to help with repetitive editing tasks and was able to have the data I needed in less than half an hour.

Hint: Looking at the output, look for “}, {” in between each of the entries! And you’ll notice the field names are set equal to their prospective values on each entry. A quick Find/Replace can reformat those into “,” format instead. Then simply save as a CSV and filter in Excel, Google Spreadsheets, or any similar software/service.



This post first appeared on Birthplace Of The Process Of Illogical Logic, please read the originial post: here

Share the post

Saving for posterity

×

Subscribe to Birthplace Of The Process Of Illogical Logic

Get updates delivered right to your inbox!

Thank you for your subscription

×