Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating HTML for a search

Status
Not open for further replies.

deesloop

IS-IT--Management
Jul 19, 2013
12
GB
I want to have a url generated based on a text box criteria outwith ECM.

So my front end will have a button which will when clicked open up a url that runs a search in a specific folder (01+Training+Records) for the criteria in a combo box (in the case below 7667)

A standard search generates this

7667&ScopeSelection=1584878%7C139957%7CWithin+01+Training+Records&context_id1=none&lookfor1=allwords&modifier1=relatedto&boolean2=And&lookfor2=complexquery&typeDropDownId=1&boolean3=And&lookfor3=complexquery&dateDropDownId=1&func=search&objType=258&SearchBarSearch=TRUE&location_id1=139957&facets=user&fulltextMode=allwords

And I guess I could substitute 7667 for something else but it's a little inelegant to say the least and there must be a shorter URl

Thanks v much in advance
 
why can't you use POST for that

behind the scens all you want could be in html "hidden" controls and the button would do a POST

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Most because I don't know how to implement that in VBA.

This will be a bunch or rows in either excel or access
Each row will have A docname in it which will appears as a hyperlink
The hyperlink will be generated one per record and use the docname as the search criteria.
Clicking that will then open IE and run the search for the document name as I have no way of linking excel/access directly to the document in ECM.
It's totally do-able outside of ECM if I stored the docs in a regular FS, but not ECM.





 
we have Excel VBA Macros for searching in LL see example.Our target URL is kept in a Excel cell against a slice in livelink so the URL is much shorter
I doubt if you need all those you have typically ?func=search is what invokes the searchAPI and all those things are documented in the search API
docu

Code:
Sub Find_Documents()

    Dim i As Integer, tmpstr As String, document_num As String, ll_url As String
    Dim cnt As Integer
                    
    cnt = 0
    i = 1
    tmpstr = ""
    Range("C9").Select
            
    Do While ActiveCell.Value <> ""
        
        document_num = ActiveCell.Value
        
        tmpstr = tmpstr & "&where" & i & "=Attr_13006_19:" & document_num
        tmpstr = tmpstr & "&lookfor" & i & "=complexquery"
        
        If i >= 10 Then
            ll_url = Range("LLSearchURL").Value & tmpstr
    
            ActiveWorkbook.FollowHyperlink Address:=ll_url, NewWindow:=True
            
            i = 0
            tmpstr = ""

            If MsgBox("Searching 10 Items, click <OK> to seach more", vbOKCancel, "Search Controls") = vbCancel Then
                Exit Do
            End If
                
        End If
        
        ActiveCell.Offset(1, 0).Select
        
        i = i + 1
        cnt = cnt + 1
    
    Loop
    
    If tmpstr <> "" Then
        ll_url = Range("LLSearchURL").Value & tmpstr
    
        ActiveWorkbook.FollowHyperlink Address:=ll_url, NewWindow:=True
    End If
    
End Sub

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Hmm, not seeingho that works
However It's pointed me in the right direct

I've a cell with

=HYPERLINK(" this")

What would be even nicer would be getting that document rather than it opening a search (it will always only find one document) and then having to open it that way.
However I'm not sure that can even be done.
 
Code:
=HYPERLINK("[URL unfurl="true"]http://myecmserver.co.uk/otcs/cs.exe?func=search&lookfor1=complexquery&where1="&A4,"Find[/URL] this")
 
If there is always a one to one mapping, then you may be better going to the OT database rather than via Search to generate the link ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Assuming that you have a definite 1:1 mapping between the file name and the system you can connect to the OT DB and look in the DTREE table as that stores the name and unique id.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
I understand, you mean run a search for the Filename and pull the doc ID, and then use a link direct to the docID?
I don't know how to link directly to the document - say to open it as a PDF (it'll always be a pdf)
Fetch isn't working and all other attempts are producing bad syntax - it appears to be looking for a function?
 
yes, something like :

SELECT * FROM table WHERE file_name = "<x>"

you can get the specific SQL from the OT DB Schema document via an NDA, although if you have a lot of documents, a single query using an IN clause for the name and then using VBA to process the resultset and create the links may be better. Link would be something like ?func=ll&objid=1234&objaction=properties to get the properties page.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Greg if SSO is active then he can just create a Live Report and call that from the VBA code that way his client code need not be concerned with securing a DB connection and it will also be permission aware
as a quick example go to your personal ->Reports->Live Reports Volume therein you will see many canned Live Reports that is the one I am talking about.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top