<?xml version="1.0" encoding="UTF-8"?>
<editor id="editor.imagick" enabled="false" openable="true" order="10" iconClass="mdi mdi-camera-burst" previewProvider="true"
        text="328" title="329" className="PydioImagick"
        mimes="pdf,svg,tif,tiff,psd,xcf,eps,xls,xlsx,ods,doc,docx,odt,ppt,pptx,odp,rtf,cr2,ai" label="CONF_MESSAGE[Image Magick]"
        description="CONF_MESSAGE[Image Magick viewer supports PDF and various images formats preview. Requires external library to be installed on the server.]"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <class_definition filename="plugins/editor.imagick/IMagickPreviewer.php" classname="Pydio\Editor\Image\IMagickPreviewer"/>
    <client_settings>
        <resources>
            <js file="plugins/editor.imagick/res/build/PydioImagick.js" className="PydioImagick" depends="PydioDiaporama"/>
            <i18n namespace="imagick_editor" path="plugins/editor.imagick/res/i18n"/>
        </resources>
    </client_settings>
	<server_settings>
        <global_param name="ONTHEFLY_THRESHOLD" type="integer" label="CONF_MESSAGE[Pregeneration Threshold]" description="CONF_MESSAGE[Threshold (in MegaByte) under which the pages are all generated when opening the document, and over which pages are generated on-demand only]" default="5"/>
        <global_param name="IMAGE_MAGICK_CONVERT" type="legend" label="CONF_MESSAGE[Convert Path]" description="CONF_MESSAGE[IMAGE_MAGICK_CONVERT: use CONF_DIR/conf.editor.imagick.inc to set full path on the server to the 'convert' binary (/opt/local/bin/convert) by default]"/>
        <global_param name="IM_THUMB_QUALITY" type="legend" label="CONF_MESSAGE[Thumbs Options]" description="CONF_MESSAGE[IM_THUMB_QUALITY; Imagick Options used for generating the thumbnails (use CONF_DIR/conf.editor.imagick.inc)]" />
        <global_param name="IM_VIEWER_QUALITY" type="legend" label="CONF_MESSAGE[Images Options]" description="CONF_MESSAGE[IM_VIEWER_QUALITY: Imagick Options used for generation the high scale images (use CONF_DIR/conf.editor.imagick.inc)]" />
        <global_param name="IM_CUSTOM_OPTIONS" type="legend" label="CONF_MESSAGE[Shared Options]" description="CONF_MESSAGE[IM_CUSTOM_OPTIONS: You can add any Image Magick options you want here, applied to both thumbs and big images (use CONF_DIR/conf.editor.imagick.inc)]" />
        <global_param name="ADDITIONAL_ENV_PATH" type="legend" label="CONF_MESSAGE[Environment Path]" description="CONF_MESSAGE[ADDITIONAL_ENV_PATH: you can set additional path to put in the environment PATH variable before calling the command. Can be necessary for Ghostscript on Mac for example. Edit CONF_DIR/conf.editor.imagick.inc]" default=""/>
		<global_param name="UNOCONV" type="legend" label="CONF_MESSAGE[Unoconv Path]" description="CONF_MESSAGE[UNOCONV: use CONF_DIR/conf.editor.imagick.inc to set full path on the server to the 'unoconv' binary (see docs)]"/>
	</server_settings>
	<registry_contributions>
		<hooks>
			<serverCallback hookName="node.change" methodName="deleteImagickCache" defer="true"/>
		</hooks>
		<actions>
			<action name="imagick_data_proxy" contentTypedProvider="true">
				<processing>
					<serverCallback methodName="switchAction" restParams="/file+" developerComment="Serve JPG previews for a PDF or imagick-compatible file.">
                        <input_param name="file" type="AJXP_NODE" description="Path to the file"/>
                        <input_param name="all" type="boolean" description="Whether to pre-extract all pages or pass them one by one"/>
                        <output type="json|jpg" description="Depending on the mode, will return either directly an image (thumbnail), or a json structure containing links to all pages."/>
					</serverCallback>
				</processing>
			</action>
			<action name="delete_imagick_data">
				<processing>
					<serverCallback methodName="switchAction"/>
				</processing>
			</action>
			<action name="get_extracted_page">
				<processing>
					<serverCallback methodName="switchAction" restParams="/file/src_file+" developerComment="Server a prefetched thumbnail for a PDF or imagick compatible file. See imagick_data_proxy.">
                        <input_param name="file" type="string"
                                     description="Name of the page thumbnail, as returned by imagick_data_proxy request"/>
                        <input_param name="src_file" type="AJXP_NODE" description="Path to the original file, if the given page was not yet generated"/>
					</serverCallback>
				</processing>
			</action>
		</actions>
	</registry_contributions>
	<dependencies>
		<pluginResources pluginName="editor.diaporama"/>
		<!-- Stream Wrapper must be implemented -->
		<activePlugin pluginName="access.AJXP_STREAM_PROVIDER"/>
	</dependencies>
</editor>
