Using @Functions in Web Applications

@Functions are predefined formulas that perform specific tasks and return a value. Some @Functions do not work at all on the Web, others are restricted, and still others are particularly useful. The following sections describe each of these types of @Functions.

@Functions That Work in Web Applications

In Table 16.8 is a list of @Functions that could prove to be quite useful in Web applications.

Table 16.8. @Functions
@FunctionDescription
@ClientTypeRetrieves client information to allow designers to make decisions based on client. Returns:
  • Web from a browser client

  • Notes from Notes client

  • None from an agent

Knowing which client is accessing your Web application would be useful when using hide-when formulas or computed subforms.
@BrowserInfo(property)Retrieves browser information to allow designers to make decisions based on browser type. @BrowserInfo cannot be used in view selection and view column formulas. The syntax is @BrowserInfo(“property”) Properties associated with @BrowserInfo are described in Table 16.9, “@BrowserInfo Properties,” following this table.
@URLOpen(urlstring)Retrieves Web site specified in the URL. The following code opens LDD: @URLOpen(http://www.lotus.com/ldd)
@WebDbNameRetrieves the name of the current database in URL format. It replaces a backslash with a forward slash and a space with a %20(hexadecimal 20). @WebDbName is new to ND6 and replaces an equivalent formula that would need a combination of @DbName, @Subset, and @ReplaceString.
@GetHTTPHeader(“requestHeader”)Returns the value of an HTTP request-header field, suchas “From,” “Host,” or “User-Agent.” @GetHTTPHeader(“Host”)
@SetHTTPHeader (“responseHeader”;value)Sets the value of an HTTP response-header field, such as, “Content-Encoding”, “Content-Length”, “Set-Cookie”. Value can be text, number, or date to which you want to set the field. Return value is True (1) or False (0) and the Notes client always returns False (0). @SetHTTPHeader(“Set-Cookie”; ”COOKIE1=4646”)
@UrlQueryString(parameterName)Returns the URL command and parameters, or just the value of one parameter.

http://www.your.com/dbname.nsf?OpenForm&ID=995764&FirstName=Deborah

@UrlQueryString

The preceding URL returns the list:

OpenForm : ID=995764 : FirstName=Deborah

@UrlQueryString(FirstName)

Returns the text: Deborah

Notes clients always return null with this function.
@DbCommand(“Domino”;parameter)When used with “Domino” as the first parameter, creates links to Previous or Next page.

@DbCommand(“Domino”;”ViewNextPage”)

@DbCommand(“Domino”;”ViewPreviousPage”)

This is the only syntax where @DbCommand will work on the Web, and it is used for an embedded view when accessed from an action on a page or document.
@Command([Viewcommand])Expands or collapses all categories in a view.

@Command([ViewExpandAll])

@Command([ViewCollapseAll])

Works on the Web if Use Applet in the Browser is checked in the View properties.
@UrlEncode(encodingFormat;token)Translates into a URL-safe format. Two encoding formats are
  • Domino— standard character set used by Domino Web server ND6.

  • Platform— the current system's native character set.

@UrlEncode(“Domino”;”Manager/By Dept”)

Above code would return “Manager%2FBy%20Dept”.

Don't use this function to encode an entire URL because it wouldn't link successfully.
@UrlDecode(decodeType;token)This function is the reverse of the preceding one: It decodes URL strings into regular text. Decode types are the same as the preceding function.

@URLDecode(“Domino”; ”Manager%2FBy%20Dept”)

Above code returns “Manager/By Dept”.
@Success and @FailureInput validation formulas work on the Web. The message specified in the @Failure appears on a new page. HTML can be embedded in the message to provide a customized message and possibly a return link. These require a roundtrip to the server.

For the exam, remember that the code

@SetHTTPHeader("Set-Cookie";"COOKIE1=4646")

sets the response-header field “Set-Cookie” to “COOKIE1=4646” and appends it to the end of the standard HTTP response. This function registers a cookie for the server with this name and value with the Web client.


Table 16.9. @BrowserInfo Properties
PropertyBrowser ReturnsNotes Returns
BrowserType
  • “Microsoft,”

  • “Netscape,”

  • “Compatible” (compatible with Netscape, including Notes Navigator 5.0),

  • “Unknown”

“Notes”
Cookies1 (True) supports cookies 0 (False) doesn't.0 (False)
DHTML1 (True) supports dynamic HTML; 0 (False) if not.0 (False)
FileUpload1 (True) supports file upload; 0 (False) if not.0 (False)
Frames1 (True) supports HTML <FRAME> tag; 0 (False) if not.1 (True)
Java1 (True) if the browser supports Java applets; otherwise 0 (False).1 (True)
JavaScript1 (True) if the browser supports JavaScript; otherwise 0 (False).1 (True)
Iframe1 (True) if supports the Microsoft HTML <IFRAME> tag; 0 (False) if not.0 (False)
PlatformOperating System platform of the browser:

“Win95,”

“Win98,”

“WinNT,”

“MacOS,”

“Unknown.”
“Unknown”
Robot1 (True) if browser is possibly a Web robot; 0 (False) if not.0 (False)
SSL1 (True) if supports SSL; 0 (False) if not. 
Tables1 (True) if supports HTML <TABLE> tag; 0 (False) if not. 
VBScript1 (True) if supports VBScript; 0 (False) if not. 
VersionThe browser version number; -1 for unrecognized browsers.Notes client build number

@BrowserInfo and all of its properties offer a lot of functionality to designers. Be prepared to answer questions regarding @BrowserInfo on the exam.


@Functions That Don't Work on the Web

Sometimes knowing what doesn't work on the Web is just as important as knowing what does work. Exam 612 will test your knowledge of both. Table 16.10 lists the @Functions that do not work (or work only with exceptions) on the Web.

Table 16.10. @Functions That Don't Work on the Web
@Certificate@Unique@DDEExecute@DDEInitiate@DDEPoke
@DDETerminate@DocMark@DeleteDocument@DocChildren
@DocDescendants@DocLevel@DocNumber@DocParentNumber
@DocSiblings@IsCategory@IsExpandable@Responses
@DialogBox@PickList@Prompt@IsModalHelp
@GetPortsList@Environment; @SetEnvironment; ENVIRONMENT keyword (use CGI environment variables)@IsDocBeingMailed@MailEncryptSendPreference
@MailSend@Domain@MailDbName@MailEncryptSavedPreference
@URLGetHeader@MailSavePreference@MailSignPreference@Platform returns user's platform only
@URLHistory@UserPrivileges@IsAgentEnabled 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.106.149