template: instantiate a template with new items based on new data

Description Usage Arguments Details Value Examples

View source: R/template.R

Description

creates several items based on data passed to template

Usage

1
template(templateId, items, ...)

Arguments

templateId

id of the template to instantiate

items

list of items to create (attr or item id and layerId)

...

extra params to pass to checkAuth

Details

This can be used to either create new items from a template or replace existing items under a template

Value

TRUE if it worked FALSE otherwise

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 # replace existing children items
 items <- list(children=list(
   list(
     id="DvwQhQEH",
     layerId="DvwcwCrK"
   ),
   list(
     id="DvwQjFYJ",
     layerId="DvwcwCrK"
   )
 ))
 # create new children from template
 items <- list(children=list(
   list(
     attr="MEAN",
     layerId="DvwcwCrK"
   ),
   list(
     attr="RUNUP",
     layerId="DvwcwCrK"
   )
 ))
## Not run: 
#templateID is manually created on the publish page
 template("CAQw7M1", items, authenticateUser(username))

## End(Not run)

USGS-R/hazardItems documentation built on Aug. 15, 2020, 11:28 a.m.