Månadens Expert-tips – URLer (del 1 av 2)

Månadens Expert-tips – URLer (del 1 av 2)

Hur kommer jag åt en file resource via URL?
Kunskap om Dominos olika URL-kommandon kan underlätta avsevärt.

Nedan kan, bland annat, göras via URL-kommandon.

  • Open databases and views
  • Open framesets
  • Open forms, navigators, and agents
  • Open, edit, create, save, and delete documents
  • Open documents by key name from a view
  • Open pages
  • Open resources
  • Open attachments, image files, and OLE objects
  • Open Web preferences
  • Create search queries
  • Require authentication
  • Process SSL certificates
  • Specify a character encoding

Domino URL commands have the following syntax:
http://Host/Database/DominoObject?Action&Arguments

Where:

  • Database is the database in which the DominoObject resides.
  • Action is the action you want on the specified DominoObject (for example, ?OpenDocument).
  • Arguments are the qualifiers for the action (for example, Count=10 combined with ?OpenView limits the number of rows displayed in a view to 10).

For additional information on URL syntax, see the Syntax guidelines sidebar.

Opening databases and views

The following commands access databases, views, About and Using documents, and database icons.

Redirect
Syntax:

http://Host/Database.nsf?Redirect&Name=Notesserver&Id=To=Encodedurl

Where:

  • http: //Host refers to the Web server that is generating the URL.
  • Name= Notesserver specifies a Domino server name in its common or abbreviated form. This is optional when the “By Database” setting on the server is on.
  • Id= indicates the replica ID of the database to be located. This is an optional argument.
  • To= Encodedurl specifies the rest of the URL.

Example:

http://www.acme.com/database.nsf?Redirect&Name=Mail&Id=0525666D0060ABBF& To=%FAView%3FOpenView

OpenDatabase

Syntax:

http://Host/DatabaseFileName?OpenDatabase http://Host/_DatabaseReplicaID?OpenDatabase

Examples:

http://www.acme.com/leads.nsf?OpenDatabase
http://www.acme.com/sales/discussion.nsf?OpenDatabase
http://www.acme.com/_852562F3007ABFD6?OpenDatabase

OpenView

Syntax:

http://Host/Database/ViewName?OpenView
http://Host/Database/ViewUniversalID?OpenView
http://Host/Database/$defaultview?OpenView

Examples:

http://www.acme.com/leads.nsf/By+Salesperson?Open/View
http://www.acme.com/leads.nsf/DDC087A8ACE170F8852562F300702264?OpenView
http://www.acme.com/leads.nsf/$defaultview?OpenView

Optional arguments for OpenView

Append these optional arguments to refine the OpenView URL. Combine any of the following arguments for the desired result.

Start= n

Where n is the row number to start with when displaying the view. The row number in a hierarchical view can include sub indexes (for example, Start=3.5.1 means the view will start at the third main topic, subtopic 5, document 1).

Count= n

Where n is the number of rows to display.

ExpandView displays the view in expanded format.

CollapseView displays the view in collapsed format.

Expand= n

Where n is the row number to display in expanded format in a hierarchical view. Do not combine this argument with the ExpandView or CollapseView arguments.

Collapse= n

Where n is the row number to display in col lapsed format in a hierarchical view. Do not combine this argument with the ExpandView or CollapseView arguments.

RestrictToCategory= category

Sets the category for “Show Single Category” object, where category is the category to be displayed in the view.

StartKey= string

Where string is a key to a document in the view. The view displays at that document.

Examples:

http://www.acme.com/leads.nsf/By+Category?OpenView&CollapseView
http://www.acme.com/leads.nsf/By+Category?OpenView&ExpandndView
http://www.acme.com/leads.nsf/By+Category?OpenView&RestrictToCategory=pricing
http://www.acme.com/leads.nsf/By+Category?OpenView&Start=3&Count=15
http://www.acme.com/leads.nsf/By+Category?OpenView&StartKey=F

OpenAbout

Use the $about?OpenAbout command to access the About This Database document.

Syntax:

http://Host/Database/$about?OpenAbout

Example:

http://www.acme.com/leads.nsf/$about?OpenAbout

OpenHelp

Use the $help?OpenHelp command to access the Using This Database document.

Syntax:

http://Host/Database/$help?OpenHelp

Example:

http://www.acme.com/leads.nsf/$help?Open/Help

OpenIcon

Use the $icon?OpenIcon command to access the database icon.

Syntax:

http://Host/Database/$icon?OpenIcon

Example:

http://www.acme.com/leads.nsf/$icon?OpenIcon

ReadViewEntries

Use this command to access view data in XML form without appearance attributes such as fonts, list separators, date formats, HTML settings, view templates and frame redirections.

Syntax:

http://Host/Database/ViewName?ReadViewEntries
http://Host/Database/ViewUniversalID?ReadViewEntries
http://Host/Database/$defaultview?ReadViewEntries

Examples:

http://www.acme.com/leads.nsf/By+Salesperson?ReadViewEntries
http://www.acme.com/leads.nsf/DDC087A8ACE170F8852562F300702264?ReadViewEntries
http://www.acme.com/leads.nsf/$defaultview?ReadViewEntries

Optional arguments for ReadViewEntries

Append optional arguments to refine the URL. Combine any of the following arguments for the desired result.

Collapse= n

Where n is the row number to display in collapsed format in a hierarchical view. Do not combine this argument with the ExpandView or CollapseView arguments. CollapseView displays the view in collapsed format

Count= n

Where n is the number of rows to display

Expand= n

Where n is the row number to display in expanded format in a hierarchical view. Do not combine this argument with the ExpandView or CollapseView arguments. ExpandView displays the view in expanded format

KeyType= text or time

Specifies the StartKey type of either text or time. If no argument is specified, the default is text. When you specify &KeyType=time, you can specify a time value, like ISO date t ime value, for both the &S tartKey and &UntilKey arguments.

PreFormat causes all data types to be converted to text on the server. Text lists, numbers, dates and lists of numbers are converted to text before being sent. The server’s locale is used for all formatting. Without this argument, the XML output stream contains information in structured, locale-neutral formats.

ResortAscending= column number
ResortDescending= column number

Where column number is a 0-based number of a column in a view that you want to resort either ascending or descending in alphanumeric order.

RestrictToC ategory= category

Sets the category for the “Show Single Category” object, where category is the category to be displayed in the view

Start= n

Where n is the row number to start with when displaying the view. The row number in a hierarchical view can include sub indexes (for example, Start=3.5.1 means the view will start at the third main topic, sub-topic 5, document 1).

StartKey= string

Where string is a key to a document in the view. The view displays at that document.

UntilKey= string

Displays a range of view entries that begin with the document specified by the StartKey and end with the document specified by the UntilKey. The &UntilKey argument is only valid with the &StartKey argument. You can use the &Count argument to limit the number of entries returned by the range.

Example:

http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&CollapseView
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&ExpandView
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&KeyType=time&StartKey=20020715&UntilKey=20020714
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&KeyType=text&StartKey=Aa&UntilKey=Ab
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&PreFormat
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&ResortAscending=3
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&ResortDescending=3
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&RestrictToCategory=pricing
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&Start=3&Count=15
http://www.acme.com/leads.nsf/By+Category?ReadViewEntries&StartKey=F


Opening framesets

This command opens framesets.

OpenFrameset

Syntax:

http://Host/Database/FramesetName?OpenFrameset
http://Host/Database/FramesetUNID?OpenFrameset

Examples:

http://www.acme.com/discussion.nsf/main?OpenFrameset
http://www.acme.com/discussion.nsf/35AE8FBFA573336A852563D100741784?OpenFrameset


Opening forms, navigators, and agents

The following commands open forms, navigators, and agents in a database.

OpenForm

Syntax:

http://Host/Database/FormName?OpenForm
http://Host/Database/FormUniversalID?OpenForm
http://Host/Database/$defaultform?OpenForm

Examples:

http://www.acme.com/produ cts.nsf/Product?Openform
http://www.acme.com/pr oducts.nsf/625E6111C597A11B852563DD00724CC2?OpenForm
http://www.acme.com/products.nsf/$defaultform?OpenForm

Optional arguments for OpenForm

ParentUNID = UniqueIDNumber

Where UniqueIDNumber is the document ID of the parent document, which is used in response forms or when the form property “Formulas inherit values from selected document” is selected.

Syntax:

http://Host/Database/FormUniversalID?OpenForm&ParentUNID=UniqueIDNumber

Example:

http://www.acme.com/products.nsf/40aa91d55cle4c8285256363004dc9e0?OpenForm &ParentUNID=6bc72a92613fd6bf852563de001f1a25

OpenNavigator
Syntax:

http://Host/Database/NavigatorName?OpenNavigator
http://Host/Database/NavigatorUniversallID?OpenNavigator
http://Host/Database/$defaultNav?OpenNavigator

Examples:

http://www.acme.com/products.nsf/Main+Navigator?OpenNavigator
http://www.acme.com/products.nsf/7B5BC17C7DC9EB7E85256207005F8862?OpenNavigator
http://www.acme.com/products.nsf/$defaultnav?OpenNavigator

Note: $defaultnav opens the folders pane in a database

Ope nAgent
Syntax:

http://Host/Database/AgentName?OpenAgent

Example:

http://www.acme.com/sales/leads.nsf/Process+New+Leads?OpenAgent

Note: Agents may only be referred to by name. The use of UNID is not supported when referring to an agent.

ReadForm
Use the ReadForm command to display a form without showing its editable fields. ReadForm is useful for displaying a form as a simple Web page.

Syntax:

http://Host/Database/FormName?ReadForm
http://Host/Database/FormUniversalID?ReadForm
http://Host/Database/$defaultform?ReadForm

Examples:

http://www.acme.com/home.nsf/Welcome?ReadForm
http://www.acme.com/products.nsf/625E6111C597A11B852563DD00724CC2?ReadForm
http://www.acme.com/products.nsf/$defaultform?ReadForm

Tags:
,