Monday, June 30, 2008
101st Posting
Friday, June 27, 2008
A safe way to save entities in HP OpenView Service Desk (OVSD) web-api
If you have have worked with HP OpenView Service Desk (OVSD) web-api, you may have noticed sometimes it throws an exception that says "There are no changes to save." when you call the save() method on entities such as Servicecall, Workorder, Change, etc. This is annoying and fairly useless thing to know if you ask me. This should not be an exception in my opinion if you call save too often, especially since the api doesn't support transactions. Instead of repeating the same try catch blocks everywhere in my code, it became obvious to me that the safest thing to do is to just write a very simple method to call instead of the standard save() method on an entity. What the method below does is allows you to pass virtually any type of entity from HPOV web-api objects that have a save() method or more specifically inherit from IApiEntity object (this is at least all the major ones). Now instead of ... myServiceCallObject.save(); just call the method and pass it the object you want to save. SaveEntity(myServiceCallObject); This is clean and reduces unexpected bugs caused by this "exception" :) private void SaveEntity(IApiEntity entity) throws Exception { try{ entity.save(); } catch (Exception ex) { if (!ex.getMessage().equalsIgnoreCase("There are no changes to save.")) { throw ex; } } }
HP OpenView Service Desk Web-api saves when you don't expect it to.
Thursday, June 26, 2008
HP OpenView template field returns null from Web-api
Monday, June 23, 2008
Screen Capture Tool
Sunday, June 8, 2008
Sharing iPhoto Library between users
You can always try this method, but I don't like it. You can hold down the option key when you click iPhoto on the Dock. This will have iPhoto ask you to Create a new Library or Choose an Existing Library. You should be able to create it in /Users/Shared/Pictures/iPhoto Library, and then for the other user point it to the same location instead of creating a new one. I have not tested this, but I expect it would work.
The thing is, I still wanted all things to appear to iPhoto and other applications that I am using my own iPhoto Library and see it in the /Users/Shared/user1/Pictures/iPhoto Library directory. I don't know if there is a good reason, but it seems like there will be less trouble in the future.
To accomplish this we can take advantage of what is called a symbolic link. It is different than the Alias feature in OS X.
Create a symbolic link each Pictures directory that points to the iPhoto Library for the Shared user.
Here is a sample of what you will need to do, probably from the root account
mkdir /Users/Shared/Pictures/iPhoto\ Library
sudo ln -s /Users/Shared/Pictures/iPhoto\ Library/ /Users/user1/Pictures/iPhoto\ Library
sudo ln -s /Users/Shared/Pictures/iPhoto\ Library/ /Users/user2/Pictures/iPhoto\ Library
NOTE: The example above has a space in the directory name. When using the shell, a back slash is need before the space to escape it. Much like many programming languages.
After that you will need to make sure user1 and user2 have Read / Write permissions on the /Users/Shared/Pictures/iPhoto Library directory. Otherwise, you will get permission or file locked error.
I'm sure there is a command to do this, but the UI makes it easy by getting info in Finder on the /Users/Shared/Pictures/iPhoto Library directory.
I would love feedback on this solution. I fiddled with the syntax to get it to work, and I think I got what I actually did written accurately here.