cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Modified date of a particular document in KM Content

Former Member
0 Kudos
64

Hi,

Can I fetch the modified date of a particular document from KM Content?

I know i can find the date in settings -> properties. But I want to fetch the value of modified date/time.

I want to save that modified date/time in particular attribute in a program developed in NWDS so that I can proceed with my code depending on modified date/time.

Please guide me.

Regards

Simin

Accepted Solutions (1)

Accepted Solutions (1)

former_member182598
Active Contributor
0 Kudos

Belw code snippet gives me the Modified date for the document RFCCall.html stored in documents folder.



 public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    {
		IUserContext uc = request.getUser();
		IUser user = (IUser)uc.getUser(); 
		ResourceContext ctxt = new ResourceContext(user);
		RID rid = RID.getRID("/documents/RFCCall.html");
		IResource resource;
		try {
			resource = ResourceFactory.getInstance().getResource(rid, ctxt);
			response.write(resource.getLastModified().toString());
		} catch (ResourceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		



    }

You need to add a sharing reference to knowledgemanagement for this to work.

Regards

Prashant

Former Member
0 Kudos

Thank you Kumar. It was very helpful.

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Dear Simin,

Please refer to the below document for getting KM Document details:

http://wiki.sdn.sap.com/wiki/display/WDJava/LockingandUnLockingMechanisminKMDocumentUsingWebdynpro+Java

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f02b492c-7d76-2a10-86aa-e11e8388f...

http://help.sap.com/javadocs/NW04S/SPS09/km/com/sapportals/wcm/repository/IResource.html

Hope it will helps

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Thank you Arun. It was very helpful .