Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Document hit count never stops..

Hi All

I followed the steps as described in [this|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2654] blog to count the number of document hits.

The problem is that after clicking on the document for the first time, the count is incremented (as expected); however it keeps on incrementing from there on each second even without clicking the document again.

Please help me to solve this problem.

Thanks

Deepak

replied

Hi Deepak,

		
public void received(IEvent event){

IResourceEvent myEvent = (IResourceEvent) event;
		IResource reso = myEvent.getResource();
		IResourceContext rctxt = reso.getContext();
		logger.fatalT("User:::" + rctxt.getUser().getDisplayName());
		RID resoRid = null;

		if (rctxt.getUser().getDisplayName().equalsIgnoreCase("index_service")
			== false) {

		              logger.fatalT(
			"Res:::"
				+ reso.getDisplayName()
				+ " .Event is::: "
				+ event.getDescription());
		               try {
			//Do your logic here....
                                                //

			} catch (NotSupportedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (AccessDeniedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (ResourceException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (NumberFormatException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			

		}//end of IF loop
}

the if loop will avoid the "index_service" user getting into the loop and hence the property wont be updated.

and hence property is not updated, the rep service wont be called up again..

Regards

BP

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question