AEM Forms提供REST型搜尋API,網頁開發人員可使用此API來查詢及擷取符合搜尋條件的一組表單。 您可以使用API根據各種篩選條件來搜尋表單。 回應物件包含表單屬性、屬性,以及轉譯表單端點。
若要使用REST API搜尋表單,請傳送GET要求至 https://[server]:[port]/libs/fd/fm/content/manage.json
搭配查詢參數,如下所述。
屬性名稱 |
說明 |
func |
指定要呼叫的函式。 若要搜尋表單,請設定 例如, 注意: 此參數為必填項。 |
appPath |
指定要搜索表單的應用程式路徑。 依預設, appPath屬性會搜尋根節點層級上可用的所有應用程式。 您可以在單一搜尋查詢中指定多個應用程式路徑。 以垂直號(|)字元分隔多個路徑。 |
cutPoints |
指定要使用資產擷取的屬性。 您可以使用星號(*)一次擷取所有屬性。 使用垂直號(|)運算子來指定多個屬性。 例如, 注意:
|
關係 |
指定要擷取的相關資產以及搜尋結果。 您可以選擇下列其中一個選項來擷取相關資產:
|
maxSize | 指定要擷取的表單數量上限。 |
偏移 | 指定從頭開始要略過的表單數。 |
returnCount | 指定是否返回與給定條件匹配的搜索結果。 |
語句 | 指定語句清單。 查詢會在JSON格式中指定的陳述式清單上執行。 例如,
在上述範例中,
|
排序 |
指定搜索結果的順序標準。 條件以JSON格式定義。 您可以對多個欄位上的搜尋結果進行排序。 查詢中顯示的欄位會依序排序結果。 例如, 若要以升序擷取依標題屬性排序的查詢結果,請新增下列參數:
|
includeXdp | 指定是否檢索二進位內容。 此 includeXdp 屬性適用於類型的資產 FORM , PDFFORM ,和 PRINTFORM . |
assetType | 指定要從所有已發佈資產中擷取的資產類型。 使用垂直號(|)運算子來指定多個資產類型。 有效的資產類型包括FORM、PDFFORM、PRINTFORM、RESOURCE和GUIDE。 |
func : searchForms
appPath : /content/dam/formsanddocuments/MyApplication23
cutPoints : title|description|author|status|creationDate|lastModifiedDate|activationDate|expiryDate|tags|allowedRenderFormat|formmodel
relation : NO_RELATION
includeXdp : false
maxSize : 10
offset : 0
returnCount : true
statements: [{"name":"name","value":"*Claim.xdp","operator":"CONTAINS"},
{"name":"","value":"Expense","operator":"FULLTEXT"},
{"name":"description","value":"ABCD*","operator":"CONTAINS"},
{"name":"status","value":"false","operator":"EQ"},
{"name":"lastModifiedDate","value":"01/09/2013","operator":"GTEQ"},
{"name":"lastModifiedDate","value":"01/18/2013","operator":"LTEQ"}]
orderings:[{"name" :“lastModifiedDate“:”order”:”ASC”}]
[
{"resultCount":2},
{"assetType":"FORM","name":"ExpenseClaim.xdp","id":"509fa2d5-e3c9-407b-b8dc-fa0ba08eb0ce",
"path":"/content/dam/formsanddocuments/MyApplication23/1.0/ExpenseClaim.xdp",
"title":"Expense Report","description":"ABCDEFGIJK","author":"Frank Bowman",
"tags":[],"formUrl":"/content/dam/formsanddocuments/MyApplication23/1.0/ExpenseClaim.xdp/jcr:content",
"pdfUrl":"/content/dam/formsanddocuments/MyApplication23/1.0/ExpenseClaim.xdp/jcr:content?type=pdf",
"references":[],"images":[{"assetType":"resource","name":"Image.gif","id":"5477a127-8bbf-4cec-8f81-2689e5cb4a15",
"path":"/content/dam/formsanddocuments/MyApplication23/1.0/Image.gif","resourceSize":0}],
"status":false,"creationDate":1358429845623,"lastModifiedDate":1358429846771},
{"assetType":"FORM","name":"ExpenseClaim.xdp","id":"4312239b-b666-4d36-95bc-641b3a39ddd4",
"path":"/content/dam/formsanddocuments/MyApplication23/ExpenseClaim.xdp",
"title":"Expense Report","description":"ABCDefghijklm","author":"Frank Bowman",
"tags":[],"formUrl":"/content/dam/formsanddocuments/MyApplication23/ExpenseClaim.xdp/jcr:content",
"pdfUrl":"/content/dam/formsanddocuments/MyApplication23/ExpenseClaim.xdp/jcr:content?type=pdf",
"references":[],"images":[{"assetType":"resource","name":"Image.gif","id":"118a2e3f-7097-4d8c-85d1-651306de284a",
"path":"/content/dam/formsanddocuments/MyApplication23/Image.gif","resourceSize":0}],"status":false,
"creationDate":1358429856690,"lastModifiedDate":1358430109023}
]