-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemplate_fpi.txt
83 lines (67 loc) · 3.39 KB
/
template_fpi.txt
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FPI Template design document:
<------------------Principles of FPI creation (TODO later):------------>
=>give examples of good case and bad case"
=>give reasons why exploiting content using contains: etc.
=>give examples of effectively using the child div.
--> look at delta example.
<-----------------------------ATTRIBUTES-------------------------------->
1. Attribute "type" for <div> indicates if that div is scalar or vector.
By default, every <div> is scalar.
For fields that could have multiple values such as addresses, ccns etc,
create a parent <div> element that has a selector that will collect
all these element and with a - type='vector'.
e.g.
<div name="addresses" type="vector">
<action type="fetch-dom-element">body table.address
</action>
<div name="address">
<action type="store">td:eq(2)
</action>
</div>
</div>
<--------- <div> attributes ------------->
2. Attribute "can_be_a_null" for a <div> tells if that field can be
empty. Each FPI should have at least one - can_be_a_null='no'
to indicate whether PI download was successful or not.
Usually these fields are Name and/or Email.
In case of vector elements, put this attribute (can_be_a_null='no')
in the parent <div> element where you mention (type="vector")
(See point 1).
<--------- <action "type" attributes ------------->
3. Currently supported type-attributes for any <action> are:
fetch-url: Fetches the actual URL. Store the resulting HTML page
as a DOM document as current node's value.
fetch-href: Applies the CSS selector in <action>'s text to
the parent node's value. It reads the href of
resulting element.
Then fetches that href. Store the resulting HTML page
as a DOM document as current node's value.
fetch-dom-element: Applies the CSS selector in <action>'s text to
the parent node's value. Store the resulting
element(s) as current node's value.
simulate-click: Applies the CSS selector in <action>'s text to
the parent node's value. Simulate a mouse-click
on resulting element(s). Then read the HTML page.
Store that HTML page as DOM document in current
node's value.
combine-n-store: Applies the CSS selector in <action>'s text to
the parent node's value. Assuming that there are
multiple elements generated, it combines the
text contained in those elements with a comma.
This is particularly useful for addresses.
One needs to combine Address line 1, line 2,
city, state, zip and country.
store: This action can only be associated with a leaf node.
It apply the CSS selector in <action>'s text to parent
node's value. Store the resulting element's text
as final value of the PI field. The PI field is
mentioned in the "name" attribute of leaf <div>
One important thing is the result of applying
the CSS selector + filter for this leaf node
must be an HTML element which can be passed to
jQuery and can be applied a .text() method on.
(i.e. it should not be a string like "xyz").
<--------- <action> attributes ------------->
combine_operator : current default is " ," but with this attribute this
can be changed to anything such as "-", "" , etc. This useful for
feids such as phonenumber and/or ccn. Where the comma is not effective.