Auto-tools/Projects/CrossWeave/Test Format/Bookmarks: Difference between revisions

 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Overview ==
A bookmark asset list is an object with one or more key-value pairs.  Each key is the full path for the array of contents specified in the key's value.  For example:
A bookmark asset list is an object with one or more key-value pairs.  Each key is the full path for the array of contents specified in the key's value.  For example:


  "bookmark-list": {
  bookmark-list:
   "menu": [
   menu:
     { "uri": "http://www.google.com" },
     * uri: http://www.google.com
     { "folder": "folder1" }
     * folder: folder1
   ],
   menu/folder1:
  "menu/folder1": [
     * uri: http://www.mozilla.com
     { "uri": "http://www.mozilla.com" }
  ]
}


This describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu".
This describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu".
Line 23: Line 22:
Sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". CrossWeave does not support forward slashes as part of a folder name.
Sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". CrossWeave does not support forward slashes as part of a folder name.


=== Folder Contents ===
== Folder Contents ==


The contents for a folder are given as an array of objects, representing various bookmark types, described below.
The contents for a folder are given as an array of objects, representing various bookmark types, described below.


==== Bookmark Object ====
=== Bookmark Object ===


Valid properties are:
Valid properties are:
Line 44: Line 43:
Example:
Example:


   { "uri": "http://www.google.com", "loadInSidebar": true,
   uri: http://www.google.com
    "tags": ["google", "computers", "internet", "www"],
  loadInSidebar: true
    "title": "Google" }
  tags:
    * google
    * computers
    * internet
    * www
  title: Google


==== Livemark Object ====
=== Livemark Object ===


Valid properties are:
Valid properties are:
Line 62: Line 66:
Example:
Example:


  { "livemark": "Livemark1", "feedUri": "http://rss.wunderground.com/blog/JeffMasters/rss.xml",
  livemark: Livemark1
  "siteUri": "http://www.wunderground.com/blog/JeffMasters/show.html" }
feedUri: http://rss.wunderground.com/blog/JeffMasters/rss.xml
siteUri: http://www.wunderground.com/blog/JeffMasters/show.html


==== Folder Object ====
=== Folder Object ===


Valid properties are:
Valid properties are:
Line 78: Line 83:
Example:
Example:


  { "folder": "folderb",
  folder: folderb
  "changes": { "location": "menu/foldera", "folder": "Folder B", "description": "folder description" } }
changes:
  location: menu/foldera
  folder: Folder B
  description: folder description
 
=== Separator Object ===
 
Valid properties are:
* '''separator: true''', always set for separators
* '''before''': the title of the bookmark item expected to be found BEFORE this separator; used only in '''verify''' and '''modify''' actions.
* '''changes''': an object containing new properties to be set for this separator when this asset list is used in a '''modify''' action.  The properties for this object are:
** '''location''':  the full path of the folder that this separator should be moved to
** '''position''':  the title of the existing bookmark item, in the current folder, where this separator should be moved to (i.e., this separator would be inserted into the bookmark list at the position of the named bookmark, causing that bookmark to be positioned below this separator)
 
Example:
 
separator: true
 
== Bookmark Lists and Phase Actions ==
 
This section describes how bookmark lists are processed during various phase actions.
 
=== add action ===
 
The bookmark items in the list are added to the end of their parent folder in the specified order.  That is, the first item is appended to its parent folder, then the second, and so forth.  '''after''' and '''before''' properties are ignored.
 
=== verify action ===
 
The bookmark items in the list are verified to be present.  Within each folder, the second item in the list is assumed to be immediately after the first item, and so forth.  If the second item in a given folder is not directly after the first item in that folder, it's an error.  '''after''' and '''before''' properties, if specified, are also used to verify an item's position.  However, because CrossWeave verifies that bookmark items appear in the order that they are given in the asset list, '''after''' and '''before''' are not very useful except in verifying the position of the first item in the list.
 
=== verify-not action ===
 
The bookmark items in the list are verified NOT to be present.
 
=== modify action ===
 
The '''changes''' properties of the bookmark items are applied, after the items have been verified to exist.  If a '''location''' property exists inside the '''changes''' object, it is applied before the '''position''' property.  If '''location''' is specified without '''position''', then the bookmark is moved to the end of the specified folder.  If '''position''' is specified without '''location''', then the bookmark is moved to the specified position within the current folder.
 
=== delete action ===
 
The bookmarks in this list are deleted from the browser.
 
== Examples ==
 
For more detailed examples, please see the [http://hg.mozilla.org/automation/crossweave/file/f35c4dd23dea/sync.test CrossWeave example test].
Confirmed users
1,905

edits