Collection of questions about B/S development beginners in LOTUS

Source: Internet
Author: User

In the development of lotus B/S, we often see some problems such as this in the new notebook. I have only been in touch with. net for a month or two, and I have no experience. I have collected some things online, but I try my best to understand the principles.
I. Questions about creating a user login interface in B/S
1. In server settings, select "Internet Protocol"> "Domino Web engine"> "HTTP session"> "session Verification" as a single server or multiple servers, and then type: tell http restart (restart the HTTP service ).
2. Use the server-side advanced template domcfg5.ntf, that is, the Domino Web Server to configure the database template and create a database in the/domino/data/directory: domcfg. nsf.
3. Use notes to open the newly created domcfg. nsf database, click "login form ing" view, then select "CREATE"> "ing login form" from the menu, and add the target database file name, that is, domcfg. nsf, and target form name: CustomLoginForm, save and close the document.
4. Use the designer to open the domcfg. nsf database and create a form named CustomLoginForm. The form is displayed when the web server asks the browser user to provide the name and password. If you do not create a ing logon form, the system displays the $ LoginUserForm by default.
2. If you have customized your logon form, you should register the user.
What is the registration procedure like ?, What did you do when you use admin to register a person on the server? The Lotuscript class is notesregistration.
When you enter the registration page, the database opened is names. nsf, which is the database that translates Chinese characters into address books. The default personnel view is of course people view. When you start registering a person, you must first use a verification word. The default one is Cert. id, and you must enter a password. Then there is the name, password, email, and ID of the specified person. This is also the general process in lotuscript. See Part of the Code: (the code is still in the company's machine's own library. Next time I copy it back and paste it again, it is really more painful to write a diary than to learn technology .)
Sub Initialize
Dim session As New NotesSession
Dim curdoc As NotesDocument
Dim tempdoc As notesdocument
Dim db As NotesDatabase
Dim namedb As NotesDatabase
Dim peopleview As NotesView
Dim reg As New NotesRegistration

Set Namedb = New NotesDatabase ("", "names. nsf ")
Set PeopleView = Namedb. GetView ("People ")
Set curdoc = session. DocumentContext
Set db = session. CurrentDatabase

Leleview. AutoUpdate = True
Set Tempdoc = PeopleView. GetDocumentByKey (Curdoc. UserName (0), True)
If Not (tempdoc Is Nothing) Then
Print "the user already exists! "
Print "<input type = button onClick = 'History. go (-1) 'VALUE = 'return'>"
Else
Dt = Datenumber (Year (Today) + 1, Month (Today), Day (Today ))
Reg. RegistrationServer = curdoc. servername (0)
Reg. CreateMailDb = True
Reg. CertifierIDFile = "E: \ Lotus \ Domino \ Data \ cert. id"
Reg. Expiration = dt
Reg. IDType = ID_HIERARCHICAL
Reg. MinPasswordLength = 5
Reg. IsNorthAmerican = True
Reg. OrgUnit = curdoc.org (0)
Reg. RegistrationLog = "log. nsf"
Reg. UpdateAddressBook = True
Reg. StoreIDInAddressBook = True

Call reg. RegisterNewUser (curdoc. username (0), _ 'last name
"E: \ Lotus \ notes \ data \ ids \ people \" & curdoc. username (0) & ". id", _ 'file to be created
"CN =" & curdoc. servername (0) & "/O =" & curdoc.org (0), _ 'mail server
"", _ 'First name
"", _ 'Middle initial
"Lgyw20040708", _ 'certifier password
"Office", _ 'location field
"", _ 'Comment field
"E: \ Lotus \ Domino \ Data \ mail \" & curdoc. username (0) & ". nsf", _ 'mail file
"", _ 'Forwarding domain
Curdoc. password (0), _ 'user password
Notes_shorttop_client) 'user

Call curdoc. Save (False, False)
Print "you have registered successfully! "
Print "<a href = javascript: history. back ()> return </a>"
End If
End Sub
How do I add a role to a proxy? See the Code :)
Sub Initialize
Dim session As New notesSession
Dim db As notesDatabase
Dim acl As notesacl
Dim roles As String
Set db = session. currentDatabase
Set acl = db. acl
Call acl. addrole ("manage ")
Call acl. save
Print "the role has been added"
End Sub
Note that the security of this proxy must be set to: 3. allow restricted operations with full administration
3. Create paging forms

In OA system applications, the results of Displaying Multiple records are generally achieved through the paging view. The paging view implementation scheme is as follows:
1. Embedded view in Form
The most direct way to link a view with a form is to simply create a form and insert an embedded view element in it. Another way to embed a view in a form is to create a field named $ ViewBody. Its default value is the view name. In earlier Domino versions, this was the only way to embed a view in a form.
On the Web server, you can view the following resources to determine the number of lines displayed:
Use this number if the URL contains the & count Parameter
If no value is specified, view the number specified in the "embedded View" attribute box.
If this parameter is not specified, the general default value for the server is used.
2. design the appearance through general HTML
Select "view" | "advanced" in view properties, click the "Web Access" tab, and select "Treat view contents as HTML ". In the form, the embedded view attributes are determined to be displayed in HTML during Web access.
You can add CSS and HTML code to the form page to beautify the page. The following table lists the content displayed in the View:
First, add HTML code to the page.
[<Table width = "306" border = 1px;
<Tr>
<Td width = "74"> id </th> <td width = "74"> name </th> <td width = "74"> company </th> <td width = "74"> phone number </th> </tr>
Use embedded View
</Table>]
Then, add the corresponding HTML code to the attribute formula of each row in the view.
The value of Id is:
"<Td width = \" 74 \ "> <a href = \" "+ url +" \ ">" + id + "</a> </th>"
The value of the name is:
"<Td width = \" 74 \ ">" + name + "</td>"
3. Use a URL suffix such as & count, & start to display the starting line, get the current page, and control the page flow. (The view set in the Code displays 5 lines per page)
The fields set in the form are:
The value of query_string_decoded is query_string_decoded.
Ø start: = @ Right (query_string_decoded; "start ="); @ If (start = ""; "1"; start)
Ø the value of count is @ Elements (@ DbColumn ("": "nocache"; ""; "info"; 1 ))
The page value is @ If (count/5)-@ Round (count/5)> 0; @ Round (count/5) + 1; @ Round (count/5 ))
The javascript code for page Jump is as follows:
Var pathname = window. location. pathname;
Function prev ()
{
Var tmpstart = eval (document. forms [0]. start. value)-5;
Var tmpallpage = document. forms [0]. page. value;
If (tmpstart <0)
{
Alert ("already the first page! ");
}
Else
{
Location. href = pathname + "? Openform & start = "+ tmpstart
}
}
Function next ()
{
Var tmpstart = eval (document. forms [0]. start. value) + 5;
Var tmpallpage = document. forms [0]. page. value;
If (tmpstart> tmpallpage * 5)
{
Alert ("this is the last page! ");
}
Else
{
Location. href = pathname + "? Openform & start = "+ tmpstart
}
}
Function last ()
{
Var tmpstart = (document. forms [0]. page. value-1) * 5 + 1;
Location. href = pathname + "? Openform & start = "+ tmpstart
}
4. perform operations on the document through the Document ID
Add this document link to the ID item in the document and directly set the field formula for the ID in the view. The formula is as follows:
Db: = @ ReplaceSubstring (@ Subset (@ DbName;-1 );"\\";"/");
Unid: = @ Text (@ DocumentUniqueID );
Url: = "/" + db + "/info/" + unid + "? Opendocument ";
"<Td width = \" 74 \ "> <a href = \" "+ url +" \ ">" + id + "</a> </th>"
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.