Hello SCP Document Service experts,
we want to use the SCP Document Service from HANA XSJS (XS Classic, XSC). For that I've implemented a Proxy Bridge in Java to be able to call the Document Service via HTTPS and OAuth / Basic authentication. Using this Proxy I can already create a new document and read it from HANA XS.
But before uploading a document I want to check if for this business object already a document exists. Based on the example I've found in the document CMIS Browser Binding Proposal - Oasis I've added the following
<form id="queryForm" action="" method="GET">
<input name="cmisaction" type="hidden" value="query" />
<table>
<tr><td>Query:</td><td><input name="statement" type="text" size="100" maxlength="1000"
value="SELECT * FROM cmis:document
WHERE cmis:name = '00b83148-5d86-aebe-84e0-332ef729a0c3'"></td></tr>
<tr><td>Max Items:</td><td><input name="maxItems" type="text" size="4" maxlength="8" value="100"></td></tr>
<tr><td>Skip Count:</td><td><input name="skipCount" type="text" size="4" maxlength="8" value="0"></td></tr>
<tr><td></td><td><input type="submit" value="Go" /></td></tr>
</table>
</form>
to the sample that is provided in the Documenation Accessing the Document Service from an HTML5 Application. Unfortunately the result that I've got returned isn't filtered by the cmis:name that I'm looking for. All objects in the folder are returned.
Hope someone can guide me in the right direction.
Best regards
Gregor
Request clarification before answering.
You can use the browser binding as well. I do not fully understand what you are trying to achieve. I guess your main problem is that you do not define an action parameter. You have to send your form to your CMIS proxy app. Please try:
<form id="queryForm" action="https://cmisproxy<account>.hana.ondemand.com/<servletpath>/json/<repo-ID>/root" method="GET">
<input name="cmisaction" type="hidden" value="query" />
<table>
<tr><td>Query:</td><td><input name="statement" type="text" size="100" maxlength="1000"
value="SELECT * FROM cmis:document WHERE cmis:name = 'Sprint7.pdf'"></td></tr>
<tr><td>Max Items:</td><td><input name="maxItems" type="text" size="4" maxlength="8" value="100"></td></tr>
<tr><td>Skip Count:</td><td><input name="skipCount" type="text" size="4" maxlength="8" value="0"></td></tr>
<tr><td></td><td>
<input type="submit" value="Go" onclick="doQuery();" /></td></tr>
</table>
</form>
The details of the URL depend on how you configure your proxy app and the landscape/region. To test the URL you can put it in a browser and check if you get a response, like:
Please note that in your example your browser receives the JSON response and displays the result. Usually you would do this in an XMLHttpRequest and process the response in code.
You can look in the CP Document Service documentation in getChildren() for an example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.