Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Search from web interface?"

Search from web interface?

Is it possible to search from a web (intranet) based form/interface?

Current user: [none]
Register / Log In · Help

Posted By Post

colm_c

14-Dec-2008 22:27

We've got a cardbox database which is used for a library catalogue, we'd like to make it searchable via the staff intranet (without them having to have cardbox client installed).

Can anyone suggest the best way to do this?

bert

15-Dec-2008 00:05

Hi,
Yes, a www interface to your db is possible! By the additional product: CARDWEB (seller: www.cardweb.NL).
See an example: http://bert11.homeip.net which runs with a Cardbox db, Cardbox server and Cardweb on a home DSL connection..!
Regards
Bert

Charles Welling

15-Dec-2008 07:16

I've been a user of Cardweb for quite some years and I must say it works fine. Here's a link to a database containing prints, photographs, drawing, posters etc.
As to the speed: the server's internet connection is a 2 mb DSL, which is also used for other purposes. Using Cardweb on an Intranet is really fast.

http://cardweb.hmr.rotterdam.nl/thesaurus/tw_index_gb.html

What you see there is a combination of
- free search, i.e. users type in a word themselves
- clicking links with predefined queries

Cardweb has an advanced feature which enables you to make hyperlinks of the content of a database, which is used in the above mentioned database. The first screens do not search the actual prints database but they show a thesaurus which guides the user to the correct term. When the user clicks such a term, Cardweb uses it to retrieve it from the prints database. This way you can make dynamic links to a database.

If you decide to start using Cardweb, I would be glad to help you and I'm sure Bert would be too.

Charles

bert

29-Dec-2008 16:09

Hi,
Just did some experiments with ASP (standard in Win XP IIS suported).

With some macro knowlegde is it possible to do a query in Cardbox to from a webpage (also without CardWeb) and get very nice results. I am trying develope a full site with it now.
(to be continued...)

Regards
Bert

Mary Doyle

29-Dec-2008 20:08

Hi Bert,

I experimented a bit with this and was able to search from an intranet page and generate a hta page with the results. It would only work though if everyone had access to the client, so it was not a practical option in my place of work. For that reason I didn't delve too far - it was more out of interest on my part. If you think it would be of use to you I can dig out the sample HTML page.

Mary

bert

29-Dec-2008 21:09

Hi Mary,

"Anyone has to be access to the client": as far as I can see only iss has to be access to a (invisible) client which is installed on the server. I just tested it from a Linux machine and it could query the database, so the Cardbox client really only runs at the IIS server.

Is it possible for you to send me that experimental query page (bert.stortenbeker@ns.nl)?
Thanks in advance!
Regards
Bert

Mary Doyle

8-Jan-2009 07:58

Hi Bert

Sorry for taking so long with this, but workload and illness intervened. This is a very basic sample and, as it wasn't practical to implement at the time, I didn't pursue it. However it did work and may give you some ideas.

Note: the instructions in the HTML form to use specific search terms was just for demo purposes; likewise the password bit, which appears on the form, but which I didn't actually develop.
All Cardbox search facilities can be used, e.g. +, -, * etc

<HTML>
<HEAD>
<TITLE>Search Library Catalogue</TITLE>
<META NAME="generator" CONTENT="Notepad2">
<HTA:APPLICATION
ID="HTASE"
APPLICATIONNAME="HTA Search Library Example"
SCROLL="no"
SINGLEINSTANCE="YES"
WINDOWSTATE="MAXIMIZED"
MaximizeButton="yes"
MinimizeButton="yes"
ShowTaskbar="no"
Sysmenu="yes"
Border="Thick"
Windowstate="maximize"
 />

</HEAD>

<script language="vbscript">
Sub Window_OnLoad
self.focus()
self.ResizeTo 700,450
End Sub
</script>

<script language ="vbscript">

Sub ShowSetting
window.open "http:\\insert full path here...\AwaitingResults.htm"

' See http://www.microsoft.com/technet/scriptcenter/hubs/htas.mspx
'MsgBox "You are now in the VBSCRIPT section"
'MsgBox "You entered " & T1.value & " in the Text box"
'MsgBox "You entered " & T2.value & " in the Password box"
Title = T1.Value
If T3.Value <> "" Then
Author = T3.Value
End If
'MsgBox "The Title is " & Title
'MsgBox "About to activate Cardbox"
Const cbxWriteFormatPRN = 1
Const cbxSequenceRefresh = 1

Set cbx=CreateObject("Cardbox.Application")

Set win=cbx.Windows.OpenFile ("cardbox:\\ServerName\Catalogue")
cbx.visible = False 'End user doesn't see Cardbox
Set recsCat=win.Database.AllRecords
win.Format = ""
win.SelectionLevel = 0 'Start selection with all records available
If T1.value <> "" Then
win.Select "ti",Title
End If

If T3.value <> "" Then
win.Select "au",Author
End If
win.Select "ac","1:"
win.Exclude "st","lost"
win.Exclude "st",":2006.0101"

NumberRecords = win.Records.Count
If NumberRecords = 0 Then
MsgBox "There are no records matching those criteria"
Else
win.SetSequence "*+su+ti",cbxSequenceRefresh
win.Records.WriteToFile cbxWriteFormatPRN,"\\Full path\cat.hta","html"
win.SelectionLevel=0
'win.SetSequence "*+au+ti+su+dt",cbxSequenceRefresh
Call WaitToPrint
End If
End Sub
</script>

<script language ="vbscript">
Sub WaitToPrint
'This sub and PausedSection sub taken from MSScripting website - check proper name
 ' dtmStartTime = Now
        idTimer = window.setTimeout("PausedSection", 500)
    End Sub
</script>

<script language ="vbscript">
 Sub PausedSection
' Msgbox dtmStartTime & vbCrLf & Now
        window.clearTimeout(idTimer)
'MsgBox n & " records. Press View Results to see records"
      'xxxxxxwindow.open "http:\\ezone\library\\demo\cat.htm"
    window.open "http:\\ezone\library\\demo\cat.hta"
    End Sub
</script>

<script language ="vbscript">
Sub ViewResults
'window.open "c:\demo\cat.htm"
window.open "c:\demo\cat.hta"
End sub
</script>

<script language ="vbscript">
Sub CloseResults
'window.close "http:\\ezone\library\demo\cat.htm"
window.open "c:\demo\cat.hta"
self.close
End sub
</script>

<STYLE>
<BODY>

{
background-color:buttonface;
font-family: Helvetica;
font-size: 8pt;
martin-top 2px;
margin-left: 15px;
margin-right: 3px;
margin--bottom: 3px;
}
</style>
<p>
<p>
<p>
Title
<INPUT type="text" size=50 name="T1" value=""><br>Enter title ("for test use cotton" (use + to include words - to exclude + brackets to group)
<P>
<P>

<P>
Author
<INPUT type="text" size=50 name="T3" value=""><br>Enter Author (surname only) (for test use "keeley" or leave blank)

<P>
<P>
<INPUT type="password" size=20 name="T2" value="">This provides masked input

<P><INPUT type="button" value="Push this button to search catalogue" name="B3"
onclick=showsetting()></p>

<p><span
onclick="Viewer.document.location.href='cat.htm'">
</span>

<P><INPUT type="button" value="Exit" name="B6"
onclick="CloseResults"></p>
<p>

</body>
</html>

</BODY>
</HTML>Note: the instructions in the HTML form to use specific search terms only for demo purposes
All Cardbox search facilities can be used, e.g. +, -, * etc
<HTML>
<HEAD>
<TITLE>Search Library Catalogue</TITLE>
<META NAME="generator" CONTENT="Notepad2">
<HTA:APPLICATION
ID="HTASE"
APPLICATIONNAME="HTA Search Library Example"
SCROLL="no"
SINGLEINSTANCE="YES"
WINDOWSTATE="MAXIMIZED"
MaximizeButton="yes"
MinimizeButton="yes"
ShowTaskbar="no"
Sysmenu="yes"
Border="Thick"
Windowstate="maximize"
 />

</HEAD>

<script language="vbscript">
Sub Window_OnLoad
self.focus()
self.ResizeTo 700,450
End Sub
</script>

<script language ="vbscript">

Sub ShowSetting
window.open "http:\\insert full path here...\AwaitingResults.htm"

' See http://www.microsoft.com/technet/scriptcenter/hubs/htas.mspx
'MsgBox "You are now in the VBSCRIPT section"
'MsgBox "You entered " & T1.value & " in the Text box"
'MsgBox "You entered " & T2.value & " in the Password box"
Title = T1.Value
If T3.Value <> "" Then
Author = T3.Value
End If
'MsgBox "The Title is " & Title
'MsgBox "About to activate Cardbox"
Const cbxWriteFormatPRN = 1
Const cbxSequenceRefresh = 1

Set cbx=CreateObject("Cardbox.Application")

Set win=cbx.Windows.OpenFile ("cardbox:\\ServerName\Catalogue")
cbx.visible = False 'End user doesn't see Cardbox
Set recsCat=win.Database.AllRecords
win.Format = ""
win.SelectionLevel = 0 'Start selection with all records available
If T1.value <> "" Then
win.Select "ti",Title
End If

If T3.value <> "" Then
win.Select "au",Author
End If
win.Select "ac","1:"
win.Exclude "st","lost"
win.Exclude "st",":2006.0101"

NumberRecords = win.Records.Count
If NumberRecords = 0 Then
MsgBox "There are no records matching those criteria"
Else
win.SetSequence "*+su+ti",cbxSequenceRefresh
win.Records.WriteToFile cbxWriteFormatPRN,"\\Full path\cat.hta","html"
win.SelectionLevel=0
'win.SetSequence "*+au+ti+su+dt",cbxSequenceRefresh
Call WaitToPrint
End If
End Sub
</script>

<script language ="vbscript">
Sub WaitToPrint
'This sub and PausedSection sub taken from MSScripting website - check proper name
 ' dtmStartTime = Now
        idTimer = window.setTimeout("PausedSection", 500)
    End Sub
</script>

<script language ="vbscript">
 Sub PausedSection
' Msgbox dtmStartTime & vbCrLf & Now
        window.clearTimeout(idTimer)
'MsgBox n & " records. Press View Results to see records"
      'xxxxxxwindow.open "http:\\ezone\library\\demo\cat.htm"
    window.open "http:\\ezone\library\\demo\cat.hta"
    End Sub
</script>

<script language ="vbscript">
Sub ViewResults
'window.open "c:\demo\cat.htm"
window.open "c:\demo\cat.hta"
End sub
</script>

<script language ="vbscript">
Sub CloseResults
'window.close "http:\\ezone\library\demo\cat.htm"
window.open "c:\demo\cat.hta"
self.close
End sub
</script>

<STYLE>
<BODY>

{
background-color:buttonface;
font-family: Helvetica;
font-size: 8pt;
martin-top 2px;
margin-left: 15px;
margin-right: 3px;
margin--bottom: 3px;
}
</style>
<p>
<p>
<p>
Title
<INPUT type="text" size=50 name="T1" value=""><br>Enter title ("for test use cotton" (use + to include words - to exclude + brackets to group)
<P>
<P>

<P>
Author
<INPUT type="text" size=50 name="T3" value=""><br>Enter Author (surname only) (for test use "keeley" or leave blank)

<P>
<P>
<INPUT type="password" size=20 name="T2" value="">This provides masked input

<P><INPUT type="button" value="Push this button to search catalogue" name="B3"
onclick=showsetting()></p>

<p><span
onclick="Viewer.document.location.href='cat.htm'">
</span>

<P><INPUT type="button" value="Exit" name="B6"
onclick="CloseResults"></p>
<p>

</body>
</html>

</BODY>
</HTML>

bert

8-Jan-2009 11:06

Hi Mary,
Thank you! I will look at the code and use it for 'inspiration'. Your code is written for a local machine?

There is a difference in my approach. I develop an ASP application which is 'somewhere' on an IIS server and by anyone in the network and any browser can be used.

The search interface in the browser is ready. You can query by two "input lines" the (photo)db with all Cardbox Boolean search possibilities. (All fields or one field pro line).

The search result is showed in a page which contains max 15 records. If there are more, you can click to next page.

For tagging of records I developed (JavaScript) using a cookie. Tagging I developed prior for in CardWeb. In ASP I could use same script.

I did not yet a heavy load test and a multi-user test. However, the speed is encouraging. I could also use my Linux machine in my network to do queries on the ASP machine!

I now have one major problem: the images which are send by the IIS loose some (to much) quality in all the browsers (except Google Chrome). Probably IIS does not offer the image on a right way to the browser (include IE7!) - so a browser does not understand it complete right and it has to make it to much a chessboard. As said, only Chrome treats images excellent.

So my conclusion is on this moment: with an ASP book, some html and Cardbox macro knowledge is not complex to make an ASP web interface for your database.
When my photodb is running and I can find time for it I can try to make something for "Contacts"...

Regards
Bert

bert

8-Jan-2009 12:13

Hi,

See last message about poor image quality "from Cardbox by ASP to the browser":
It can go quick...

Image quality in IE7 = solved! Only now to solve FireFox 3.

Thanks CardBoss!
Regards
bert

Mary Doyle

9-Jan-2009 09:58

Hi Bert,

I have just realised you have your email address in your original query. I will contact you directly next week and try and answer all your questions.

Best regards,

Mary

bert

16-Mar-2009 19:47

Hi,

In December colm_c wondered if Cardbox could be searched by a web interface.

There are two possibilities on this moment.

As told: You can use Cardweb as web interface to Cardbox. Charles wrote about it earlier. I use it several years now.

Last months I developed also an alternative. I used the IIS web server of Microsoft (standard in Windows) en programmed for my site ASP pages.
I developed some pages/macros which uses one on an IIS server installed Cardbox Client. This Cardbox Client is started invisible on this web server by macros in ASP pages. These macros are running on server side (a feature of ASP). ASP sends only your HTML results to a browser. No matter what browser is used on whatever platform. The invisible Cardbox Client works amazing fast querying database(s).

When developing it, I met some problems presenting images which are stored in the database. They are all solved now. It is solved by some new macro facilities in Cardbox Client.

Very nice is that the database which is used by ASP normally also by a Cardbox Client can be used (in Cardweb is this possible with some small limitations). In the web environment you can use it by example read only, but in your client you can use it read/write. If you want to write in you db’s using a form in your browser, is this possible by using ASP. Cardweb is read-only.

The result is on line now on http://stortenbeker.eu. For only-English speaking people: sorry, it’s all in Dutch langue. Most of the links in this site executes Cardbox search commands. So you can see it’s really working.
It is not fast (enough) now. This is caused by old P3 hardware in combination with a private DSL line.
The Cardweb version is still on line on http://stortenbeker.eu:8080. So, it is possible to compare.

The ASP site seems stable. Last week there were more than 20 users at the same time on line (there was a link on a busy forum). It did not crash! Of course, in this situation very much users at same time probably will not work...

I am convinced this can be used in many offices. System administrators do not need to install Cardbox on many machines. Only the database owners need it. People who (only) want to search: use a browser! Also it is simply possible to integrate Cardbox databases into websites on a Windows platform.
Last but not least: presenting (combined) results of querying more than one database is possible now.

If you need more information, click on the site’s email link to mail me.

Kind Regards
Bert

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home