Use the new features of Domino V8 to develop mashup applications

Source: Internet
Author: User
Tags dname

Domino8. It has been officially released in high profile, except for emails and servers.ManagementIn addition to making great strides in flexibility, performance improvement, and security enhancementDesignTo give the system more openness and interoperability. In the face of the industry's popular new technologies such as SOA and Web 2.0, Domino 8 is integrated into these popular trends, or is it a stop-and-wait process; especially for Domino developers, are the platforms and technologies used widely promising and worth exploring?

The answer is positive.ProgramThe design has been greatly enhanced, especially in Web programming, as follows:

    1. Domino 8 serves both as a Web service user and as a Web service consumer, which means that Domino 8 applications will be able to call Web services that reside on other platforms;
    2. General support for alternative data storage in DB2. The query view and other expected functions involved in this aspect can now be used in web programs;
    3. Blog, wiki, RSS, Atom,AjaxConcepts or technologies such as XML, JSON, and mashup can all be implemented on Domino 8. @ formula and LotusScript. language are all enhanced in these aspects.

There have been many discussions about Ajax and methods implemented on Domino.ArticleFor more information, see related resources. This article uses a group of Domino 8 technologies to build a sample mashup application, which includes JavaScript, Ajax, @ formula, JSON, andGoogleMapAPI. This article will not detail JSON and mashup, nor describe how to design domino in detail. readers of this article need to have some experience in Domino development.

JSON Introduction

JSON (Javascript. Object Notation) is a lighter and more friendly Web Services Client format that attracts the attention of web service providers.

XML-this is a format used to represent the data exchange between the client and the server. This markup language is already dominant in the broad field of software applications. XML is inherently unrelated to the language that holds a unique position in the minds of software architects, but even the most famous XML authority has to admit that in some environments, the use of XML exceeds the limits of its own capabilities. Many Web application updates usually obtain XML data through rest-style Web Services. Once received by the user's browser, they need to be integrated into the overall layout of the HTML page, we usually use Dom to process XML data. The complexity of Dom is derived from its function-based root, which requires countless method calls for simple modification or access to the data tree. In addition, we all know that the implementation details of DOM in various browsers are different. This process leads to more complex programming modes, and the possibility of cross-browser compatibility problems is also greatly increased. Obviously: How can a markup language be easily integrated into HTML pages to meet simple development requirements? The answer to the question is: use JavaScript. engine, a common component in all mainstream browsers.

Let's use a domino view to describe the different structures of XML and JSON representation. We create a mashupdemo on the server.DatabaseIn this database, we create a form named homedata, which is used to enter the geographical location information of the personnel, and then create a view showing the information vhomedata:

Figure 1. Create data forms and standard views

We use the following Domino URL Command

Http: // hostname/MAP/mashuodemo. nsf/vhomedata? Readviewentries & COUNT = 1

Access the vhomedata view to obtain the XML output of a row of data:

<? XML version = "1.0" encoding = "UTF-8"?> <Viewentries toplevelentries = "4"> <viewentry position = "1" unid = "comment" noteid = "97A" Siblings = "4"> <entrydata columnnumber = "0" name = ""locationx"> <number> 24.55 </number> </entrydata> <entrydata columnnumber = "1" name = "locationy"> <number> 116.1 </number> </entrydata> <entrydata columnnumber = "2" name = "dname"> <text> JOHN </text> </entrydata> </viewentry> </viewentries>

This is the familiar Domino XML format data. You can use the domino URL Command.ReadviewentriesThe output view vhomedata is in XML format and contains the location of each row of data (Viewentry position ="1"), Document identifier (Unid ="175c4b37cafa54164825732c002efb9d"), Column position and column value (<Entrydata columnnumber ="2"Name ="Dname">), Data type and value (<Text>Samon</Text>), We generally use Dom when parsing it. Extended Domino 8ReadviewentriesCommand, which includesOutputformat = JSONThis parameter allows the View data to be output in JSON format. For example, use the following Domino URL command:

Http: // hostname/MAP/mashuodemo. nsf/vhomedata? Readviewentries & outputformat = JSON & COUNT = 1

This command outputs the first line of data in the view vhomedata into a JSON file with the following content:

{"@ Toplevelentries": "4", "viewentry": [{"@ position": "1", "@ unid": "175c4b37cafa54164825732c002efb9d", "@ noteid ": "97A", "@ siblings": "4", "entrydata": [{"@ columnnumber": "0", "@ name": "locationx ", "Number": {"0": "24.55" }}, {"@ columnnumber": "1", "@ name": "locationy", "Number ": {"0": "116.1" }},{ "@ columnnumber": "2", "@ name": "dname", "text": {"0 ": "John" }}]}]}

We can see the data in XML format:

<Entrydata columnnumber = "2" name = "dname"> <text> JOHN </text> </entrydata>

Converts JSON data in Domino 8 as follows:

{"@ Columnnumber": "2", "@ name": "dname", "text": {"0": "John "}}

At the syntax level, the difference between JSON and other formats lies in the character that separates data. The separators in JSON are limited to single quotes, Parentheses, braces, braces, colons, and commas. At first glance, the advantages of using JSON data delimiters may not be so obvious, but they simplify data access. JavaScript. the internal representation of the engine on the data structure (such as strings, arrays, and objects) is exactly the same as those of these symbols, so we can access the data in JSON using similar Syntax:Homedata @ dname [0].

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.