Use URL commands in Domino Notes

Source: Internet
Author: User
<HTML>
<Head>
<Title> Io test demo </title>
<SCR limit PT Type = "text/merge Cr limit PT">
VaR djconfig = {isdebug: true };
</Scr platinum Pt>
<SCR effecpt type = "text/effeccr effecpt" src = ".../uilib. nsf/dojo-0.4.1-ajax/dojo. js"> </scr effecpt>
<SCR ī PT Language = "javascr ī PT" type = "text/javascr ī PT">
Dojo. Require ("dojo. Io .*");
Dojo. Require ("dojo. widget. Button ");
Function callagent (){
VaR form = dojo. byid ("ABC ");
Alert (form );
VaR bindargs = {
URL: "formula? Createdocument ",
Formnode: form,
Mimetype: "text/html ",
Method: "Post ",
Load: function (type, Data, EVT ){
Dojo. debug (data );
// We coshould just set mimetype: "text/plain Cr partition PT"
// Have it auto-eval, but that's not as interesting
// Dj_eval (data );
}
};
VaR canbind = dojo. Io. BIND (bindargs );
}
</Scr platinum Pt>
</Head>
<Body>
<Form method = "Post" id = "ABC" Action = "">
<Input type = "text" name = "formula" id = "name"/>
<Button dojotype = "button" button nclick = "callagent ()"> OK </button>
</Form>
</Body>
</Html> in DominoThere is a "formula" form in the database, and there is a field called formula. The field value is submitted by the page, and $ return is triggered when createdocument is used to calculate the field, $ return stores the calculation formula. then return to Data.

Syntax: = @ checkformulasyntax (formula );
Eval: = @ if (syntax = "1"; @ eval (formula); Syntax );

@ If (syntax! = "1"; "error-bad syntax": syntax; @ if (@ iserror (eval); "error-runtime error"; @ implode (@ text (eval ); "~~ ")))

Next, paste http://blog.csdn.net/barray2008/archive/2006/08/26/1123012.aspx. use URL commandsdomino to provide the URL Command. We can use the URL Command to implement some clever usage. I. Basic Syntax: http: // host/dominoobject? Action & arguments where host refers to the domain name or IP address of the Domino server, and dominoobject refers to some element objects developed by Domino, such as database, view, form, agent, etc. 2. instance Description:)
Any element in opendomino (including design elements such as view and form) is a document and has its ID. We can open the view in a certain way. For example, to open a view: vwview, we can do this: http: // host/DB. nsf/vwview? Open. If we know the view ID, we can also do this: http: // host/DB. nsf/vwviewunid? Open. Opening a document is slightly different. It needs to know the view of this document: http: // host/DB. nsf/vwview/docunid? The URL to open and run the agent can be: http: // host/DB. nsf/agentname? Open. This provides a way and a possibility for us to process documents in Ajax asynchronous mode in the future, and will be detailed later. B)
Create mainly introduces createdocument. Domino development is different from other web development. In most cases, its design element is concentrated in the Notes database suffixed with MSF. This is different from the Cooperative Development with a clear division of labor, but it is not impossible to carry out cooperative development. You can have a dedicated UI page developer who can use HTML and javascr regular PT to develop beautiful pages. You can use URL Command to process data. For example, if you want to make a form: fmtest, save the title, commons, and other information, you can do this: 1. Page developers develop the UI page

<Form name = "myform" method = "Post" Action = "fmtest? Createdocument "> <Table> <tr> <TD> <input type =" text "name =" title "value =" "> </TD> </tr> <tr> <TD> <textarea name = "commons"> </textarea> </TD> </tr> <TD> <input type = "Submit" name = "btnok "value =" save "> </TD> </tr> </table> </form>
2. The notes developer creates a form: fmtest, which contains the following fields: Title (text type) and commons (RTF type ). 3. create a view: vwtest4. create a page named test.htm to put the HTML created in step 1 into it. Select HTML for the content-tpye attribute of the page so that we can use http: // host/DB. access NSF/test.htm and click Save to see if there are any more records in the view. the design elements in jnotes can be created using the basic HTML elements, except the File Upload control. But we also have a way to deal with it. First, describe how notes processes document uploads. This is my personal understanding. If you have any mistakes, please correct them. Notes can be embedded in the form File Upload control to save the attachment. It is saved in a special default field $ file in the form. We can use http: // host/viewname/documentunid/$ FILE/attachmentname. In our page, you can also use the File Upload control added to HTML to control the page. We can transform test.htm:

<Form name = "myform" method = "Post" Action = "fmtest? Createdocument "> <Table> <tr> <TD> <input type =" text "name =" title "value =" "> </TD> </tr> <tr> <TD> <textarea name = "commons"> </textarea> </TD> </tr> <TD> <input type = "file" name = "% % file.1 "> </TD> </tr> <TD> <input type =" file "name =" % file.2 "> </TD> </tr> <tr> <TD> <input type = "Submit" name = "btnok" value = "save"> </TD> </tr> </table> </Form>
Note that the name of 1. file must start with % file. Followed by a number or letter. 2. Add the following sentence at the bottom of the notes. ini file on the server: dominodisablefileuploadchecks00001. Then we can create a document and upload an attachment using test.htm. C)
After the update operation is successfully created, it is inevitable that it needs to be modified. At present, I have not come up with a particularly good solution. There is a way: Using urlwe can compile the information of the document, generate xml, and place the value of the xmlpeer to the value of the test.html field, but the action needs to be changed to "fmtest? Savedocument "anyone familiar with web development, such as ASP, PHP, or JSP, should know this method. I do not know whether or not Others. D)
Deleteurl: http: // host/DB. nsf/vwview/documentunid? Deletee)
Combined with XML technology, we can develop more flexible programs with the URL commands of notes. Discuss and improve together.

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.