Fork me on GitHub

Plugin's description

Introduction

This module handles file data, in WebService REST, of the plugin BlobStore

Installation

Configure the private keys for the signature in the file blobstore-rest.xml :

<filters>
	<filter>
		<filter-name>CRMRestSecurity</filter-name>
		<url-pattern>/rest/blobstore/*</url-pattern>
		<filter-class>fr.paris.lutece.util.signrequest.servlet.HeaderHashRequestFilter</filter-class>

		<init-param>
			<param-name>elementsSignature</param-name>
			<param-value>blob_key</param-value>
		</init-param>

		<init-param>
			<param-name>validityTimePeriod</param-name>
			<param-value>0</param-value>
		</init-param>

		<init-param>
			<param-name>privateKey</param-name>
			<param-value>change me</param-value>
		</init-param>
	</filter>
</filters>

Usage - Test JSP

There is a JSP that allow to run test on the module-blobstore-rest. It is accessible through the following link :

jsp/admin/plugins/blobstore/modules/rest/TestBlobStoreRest.jsp

Note : To access to this JSP, one must be authenticated in the Back-Office. The filter tags must also be commented in the file blobstore-rest.xml so the module won't use the security, otherwise, an HTTP 401 response will be returned.

URLs syntax

Creation of a blob

To create a blob, a form using the method POST and having an entype multipart/form-data and with the following parameters are needed :

Parameter's name Parameter's type Description
blobstore text Name of the BlobStore Service
blob file File to upload

http://myhost/mywebapps/rest/blobstore/create

Removeing a blob

To remove a blob, a form using the method POST and with the following parameters are needed :

Parameter's name Parameter's type Description
blob_key text ID blob
blobstore text Name of the BlobStore Service

http://myhost/mywebapps/rest/blobstore/delete