Deepak Talape
Deepak Talape

Reputation: 997

Advanced Search in Alfresco Using CMIS

I am developing one HR web Application and it is connected to alfresco 5.0 repository, in my custom web application i need one Advanced search feature.

Here want to get all Employee documents who have joined from xyz date to current date.

I am thinking for writing custom web-script.

but not getting will it be a proper approach or not.

Can you please suggest me that Either CMIS will be a better approach or custom web-script will be better?

If CMIS, then please provide sample code or steps.

Thanks in Advance

Upvotes: 1

Views: 419

Answers (1)

Jeff Potts
Jeff Potts

Reputation: 10538

CMIS has everything you need for this. If you are using CMIS elsewhere in your application, use CMIS for this. If you aren't using CMIS then write a web script.

If you choose to go the CMIS route, here is an example from the custom content types tutorial showing how you use CMIS to do searches with date ranges against dates in a property defined in an aspect:

    queryString = "select d.cmis:objectId, w.sc:published from sc:whitepaper as d join sc:webable as w on d.cmis:objectId = w.cmis:objectId " +  
            "where w.sc:published > TIMESTAMP '2006-01-01T00:00:00.000-05:00' " +
            "  and w.sc:published < TIMESTAMP '2007-06-02T00:00:00.000-05:00'";

In this example, the "sc:webable" aspect has a date time property called "sc:published" and I'm getting back the white papers published between 1/1/2006 and 6/2/2007. In your case that publish date would be the employee hire date.

Depending on how many employees there are, you may want to page over the result set. To understand how to do that see here.

Upvotes: 4

Related Questions