Pages

Tuesday, May 29, 2012

Windows Phone App : Chennai Train Travel

Chennai MRTS had extended till Velacherry for a while now. Number of travelers had increased since it is extended. Soon it will be extended till St. Thomas Mount and at that point it will connect more residential areas and Link with Beach Tambaram Sub Urban Line. Since more people are using MRTS and also to increase its patron further I recently published an APP in Windows Market Place. The app can be accessed here.

Once you start the app, it contacts the Southern Railway server to get the latest information. Once loaded, you can tap and select the station from and station to in the main screen.



Once the stations have been selected, click on the button to get the fare and route from the server again. This will initially show you the total fare and the route. The route markers are designated as follows:
> Green: Your starting station
> Yellow: Stations en route.
> Red: Your destination station














 So in the screenshot on the left, you start from Chintadripet, arrive at Tiruvallikeni. The cool part is that it works offline and you do not have to have data plan or internet connection.

 Feel free to try it out and do send feedback on the MarketPlace.The app will be extended to include lines including Chennai Metro.

Friday, May 11, 2012

File Name is Locked for editing by another user

Yesterday I was at a client place trying to steer them in getting there processes automated with SharePoint and Workflow. I already have created a test workflow for them to do a Demo to their executives. It was a simple workflow that sends the document for approval and publishes it to PDF. The IT team was preparing for demo by testing the workflow. When they kicked the workflow one of the reviewer opened the document for review and added his comment and about to check in but the Microsoft Word crashed and he had to close the application. When he tried to open the document again from the library he started getting the error shown below.






The Library is not force checkout enabled nor the document is checked out. Further the document shows is checked out to the same person.

The reason why he was seeing the error is because in SharePoint when you open a document for editing SharePoint places a write lock on the document. If Word crashes or the application is force closed the lock is not released and there is no manual way to unlock the document. The solution is to wait for 10 minutes before trying to edit the document. If you wait for 10 minutes SharePoint releases it lock and the document returns to normal state.




Hope this helps some one. You can find more information on this in this KB article here.


Monday, May 7, 2012

Understanding runwithelevatedprivilege in SharePoint 2010

SharePoint is been around for sometime now and there are substantial amount of developer community behind SharePoint. There is also huge push on the enterprise to adopt SharePoint for variety of applications varying from single farm to large scale implementation.Everyone of us would have written code in SharePoint that requires to run with elevated privileges. There are times we tend to miss the fact that run with elevated privilege is a delegate which requires all the SharePoint objects to be created again.  I wanted to write down some of the best practices that one should keep in mind while using run with elevated privilege and which objects should be created again within the elevated context.

Please feel free to add your suggestions in comments.



Primitive ojects
SharePoint Objects
Primitive Objects Viz: String, int, Float etc
 All sharepoint objects Viz: SPSite, SPWeb, SPListItem, SPSList etc
Can be passed from call outside elevated privileges
Cannot pass these objects because of different context where it is created

Always create new SPSite and SPWeb Object

Dispose all the objects once it is used or while leaving the delegate.

Use only when needed and do not use it to bypass security. Instead use impersonation using SPUser Token