Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
<<Can LAPI handle wildcard searching?>>
Kevin_Jackson_(kjackson_(Delete)_1777340)
Our client needs to locate specific documents in document repository. The document content (18 out of 5000+) contains a order number in which the first three (3) digits are unique to a specific store. They can locate the individual documents using the Livelink browser and Explorer search engines. They want to know if one of our LAPI clients (LLDesktop/Explorer 3x) could support instring or wildcard searches. If that option is not available, can anyone suggest a LAPI search tool or report which can harvest documents based on instring searches.ThanksKevin Jackson
Find more posts tagged with
Comments
***_****_(citlon01admin_-_(deleted))
Change the where variable to Where = "(OTName : "abc*") will find any document with the name that starts with abc.'Initialize the Livelink API.'The LL_Initialize call initializes the Livelink API, and, in the process, verifies that the text'definition files and *.dll files are of compatible versions. If initialization fails, an error message'is printed and execution terminates. Otherwise, execution continues.lStatus = LL_Initialize(LL_HEADER_VERSION)If (lStatus <> LL_OK) ThenEndEnd If'Allocate value objects.'The value objects that will be used later in the program are allocated.'(Value objects are used extensively in Livelink to store many kinds of'information. In this program they store the allocated session and Livelink'Library object information.) If allocation fails, an error message is printed'and execution terminates. Otherwise, execution continues.' grab some value objectslStatus = LL_ValueAlloc(lMessage)If (lStatus <> LL_OK) ThenEndEnd If'Allocate a session and connect to the Livelink server.'Upon successful initialization, the LL_SessionAllocEx call allocates a session'and attempts to connect to the Livelink server. If the connection cannot be made'( LL_SessionAllocEx does not return LL_OK), execution skips,'where the connection error is retrieved by making the LL_SessionStatus call and'is displayed. Otherwise, execution continues.' Allocate our sessionlStatus = LL_SessionAllocEx(lSession, "clnt_lltest", 2099, "livelink", "Admin", "abc123", 0)If (lStatus <> LL_OK) ThenlStatus = LL_SessionStatus(lSession, siz, lMessage)If (lStatus <> LL_OK) ThenEndEnd IfEnd If' Use Search Engine to find documents' create a list of the scopes that are available to useDim listBrokers As LonglStatus = LL_ValueAlloc(listBrokers)lStatus = LL_ValueSetAssoc(listBrokers)lStatus = LL_ValueSetList(listBrokers)lStatus = LL_GetSearchBrokers(lSession, listBrokers)' what is the number of brokers found in the listDim intNumberofBrokers As LonglStatus = LL_ValueGetLength(listBrokers, intNumberofBrokers)Dim lAssoc As LongDim intNodeID As LongDim strNodeName As StringDim intLoop As LonglStatus = LL_ValueAlloc(lAssoc)intLoop = 0Do Until Left(buf, siz) = "Enterprise" ' look for the enterprise scope' get the association from the list of brokerslStatus = LL_ListGetValue(listBrokers, intLoop, lAssoc)lStatus = LL_AssocGetInteger(lAssoc, "NodeID", intNodeID)lStatus = LL_AssocGetString(lAssoc, "NodeName", buf, 255, siz)intLoop = intLoop + 1LoopDim vSelectlist As Long' //Define value objectslStatus = LL_ValueAlloc(vSelectlist)lStatus = LL_ValueSetList(vSelectlist)' //Set up the list of fields for ApplyQuery to returnlStatus = LL_ValueSetLength(vSelectlist, 4)' //Note: OTObject must be in this list for ApplyQuery to worklStatus = LL_ListSetString(vSelectlist, 0, "OTDataID") '//The objects IDlStatus = LL_ListSetString(vSelectlist, 1, "OTName") ' //Object NamelStatus = LL_ListSetString(vSelectlist, 2, "OTObject")lStatus = LL_ListSetString(vSelectlist, 3, "OTOwnerID") '//The objects VolumeIDDim Where As String ' same entry enteres in the search criteriaWhere = "(OTName : "abc123.doc")"Dim queryResults As LonglStatus = LL_ValueAlloc(queryResults)Do' search LivelinklStatus = LL_ApplyQuery(lSession, intNodeID, vSelectlist, Where, 0, "", 0, 10000, "LivelinkQueryLanguage", queryResults)Dim intNumberofReturns As Long ' the number of documents returnedlStatus = LL_ValueGetLength(queryResults, intNumberofReturns)For intLoop = 0 To intNumberofReturns - 1DoEventslStatus = LL_ListGetValue(queryResults, intLoop, lAssoc)Dim DocumentID As String' get the document IDlStatus = LL_AssocGetString(lAssoc, "OTDataID", buf, 255, siz)DocumentID = Val(Left(buf, siz))Dim DocumentName As String' get the document namelStatus = LL_AssocGetString(lAssoc, "OTName", buf, 255, siz)DocumentName = Left(buf, siz)msgbox DocumentID & " " & DocumentName