We help IT Professionals succeed at work.

Permissions for using the $$Search form

Steamer
Steamer asked
on


I have the following issue :

I use a customized websearch form in my web application allowing the user to search a couple of different views.
Everytime i call the form , the user is presendted a login screen.
When i use the standard search form ( i.e. i don't define a $$Search form ) , the form shows-up without having to login.
I tried changing a few settings , like changing the permission to 'create' a document of type "Search" to a user role and linking that user role to the anonymous user , but still i am presented the login screen.

What's my problem ? How can i get rid of the login screen without having to put the max internet permissions to author.
 
Comment
Watch Question

Commented:
Check your search form properties, and make sure the "Available to Public Access Users" checkbox is checked. Also, include a field in the form, called $PublicAccess. It should a computed text field, and should remain hidden. It should have the value of "1". See if this helps.

Melanie Fay
Jean Marie GeeraertsApplication Engineer

Commented:
Melanie is almost right. There are two things to check :
1. Make sure the form is available for public users
2. Make sure that anonymous is in your database's ACL and has the check next to "write public documents". If anonymous users only have read access (as is the case in most applications) you can't perform the search, unless you have checked this option in the ACL.

Also make sure that you define 'Anonymous' as a Person in the ACL.
Jean Marie GeeraertsApplication Engineer

Commented:
The $PublicAccess field is not needed when the form properties and ACL are correct.

Commented:
True...you don't need the $PublicAccess field if the ACL is set properly. But based on what Steamer said, I assumed that Anonymous was in the ACL appropriately...so, if your ACL settings aren't as jerrith described, then you need to set them that way.

Melanie

Author

Commented:
Thanx for the tips :

the solution was the setting "write public documents" which wasn't on. Now everything seemed to be ok , until i tried to add a submit button to the form.
Normally when you don't add a button to the search form , a submit button is displayed at the left end of the screen.
If you put a button on the form , Domino looks for the first button and considers that button as the submit button.

Problem is , in no way i seem to be able to display a button on the HTML page.
I even tried a completely empty $$Search form and there wasn't a submit button appearing anywhere.

Did i forget to switch on some setting again ? This $$Search is really driving me nuts.

Commented:
Have you made sure that the database properties has the "Web Access: Use JavaScript when generating pages" checkbox is selected?
Jean Marie GeeraertsApplication Engineer

Commented:
If this option is selected, if i remember correctly, the submit button is not generated. It is only generated when this option is left out.
If you enable the option you will have to create your own button. (for example through a hotspot button).

What I usually do when I create a search form for the web is create a JavaScript function to parse the different search criteria into a search URL and submit this url in the action button.
The last line of the function reads something like
location.href="/path/database.nsf/ViewToSearchIn?SearchView&Query=WhatToLookFor.

I don't have access to the internet at work at the moment (due to a virus infection on the internet servers), but the details about constructing the URL you can find in the designer help. Just look on $$Search keyword and select the document "URL commands for searching for text" to read all about it.

Sorry, if my comments come a bit late, but as I said, no internet connection at work for the moment (hope they get it fixed by Monday)

Have a nice weekend,
jerrith

Commented:
Well, I was under the assumption that the submit button was something he put in himself. If the "Web Access: Use JavaScript when generating pages" checkbox is NOT selected, then Notes will put a submit button on EVERY form, and most people don't want that. So by checking that checkbox, you have the ability to put submit buttons only where you want them. So as jerrith said, if that checkbox is selected, you can create the button either by using a hotspot button, or you can put the HTML code for a button (set it as passthru) in your form.

Author

Commented:
Indeed , unchecking the option did the trick.
I use the $$Reutn field to generate the submit page for the search form.
i did never use the javascript option.
What would be an advantage of using javascript ?
Commented:
Well, it doesn't necessarily mean you would use JavaScript to code. But if you don't have that option checked, then the submit button would appear on every form you display on the web. But if that's the only form you have, then that's OK. I like using the Javascript option, because then I can have my Java action bar, and the Java rich text editor applet for my users....you can just provide more functionality that way. But if you want to display more of a "static" site, then you probably wouldn't want the JavaScript option...because checking that option DOES increase load time.

Commented:
Thank you for the "A" grade...I'm glad I could help.
Jean Marie GeeraertsApplication Engineer

Commented:
FYI: I use a JavaScript function to perform searches, because I can perform a check on input fields and compose a very complex query on the local browser, without using resources on the server.
Especially on a busy server it is always better to perform as much processing as possible on the browser side and then just submit the result back to the server.

Regards,
Jerrith

Explore More ContentExplore courses, solutions, and other research materials related to this topic.