<?xml version="1.0" encoding="UTF-8"?>
<editor id="editor.diaporama" order="-1" openable="true"
        iconClass="mdi mdi-image" previewProvider="true" text="186"
        title="136" actions="PydioDiaporama.Actions" className="PydioDiaporama" mimes="png,jpg,jpeg,gif"
        label="CONF_MESSAGE[Image viewer]"
        description="CONF_MESSAGE[Image viewer, used for previewing images and browsing them in a diaporam. Generates a thumbnail version of the images.]"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
	<server_settings>
		<global_param name="META_EXTRACTION_REMOTEWRAPPERS" type="array" label="CONF_MESSAGE[Remote Wrappers]" description="CONF_MESSAGE[When connected to a remote server, metadata extraction can make the listing action very long, as it must first copy each file locally. For plugins using the defined wrappers and files whose size is greater than this threshold, the image type and dimension will be skipped.]" default="FtpAccessWrapper"/>
		<global_param name="META_EXTRACTION_THRESHOLD" type="string" label="CONF_MESSAGE[Size Threshold]" description="CONF_MESSAGE[Threshold]" default="50000"/>
		<global_param name="GENERATE_THUMBNAIL" type="boolean" label="CONF_MESSAGE[Thumbnails]" description="CONF_MESSAGE[Generate thumbnails or not]" default="true"/>
		<global_param name="PREVIEWER_LOWRES_SIZES" type="string" label="CONF_MESSAGE[Low-res Sizes]" description="CONF_MESSAGE[Threshold for low-res versions of images]" default="300,700,1000,1300" expose="true"/>
		<global_param name="THUMBNAIL_QUALITY" type="integer" label="CONF_MESSAGE[Quality]" description="CONF_MESSAGE[Thumbs quality]" default="2"/>
    <global_param name="EXIF_ROTATION" type="boolean" label="CONF_MESSAGE[Exif Rotation]" description="CONF_MESSAGE[Rotate image using exif rotation]" default="true"/>
	</server_settings>
	<class_definition filename="plugins/editor.diaporama/ImagePreviewer.php" classname="Pydio\Editor\Image\ImagePreviewer"/>
    <client_settings>
        <resources>
            <js file="plugins/editor.diaporama/res/build/PydioDiaporama.js" className="PydioDiaporama"/>
            <i18n namespace="diaporama" path="plugins/editor.diaporama/res/i18n"/>
            <css file="plugins/editor.diaporama/res/rotator.css"/>
        </resources>
    </client_settings>
    <dependencies>
        <!-- Image proxy must be implemented -->
        <activePlugin pluginName="access.AJXP_STREAM_PROVIDER"/>
        <activePlugin pluginName="access.ajxp_home"/>
    </dependencies>
	<registry_contributions>
		<hooks>
			<serverCallback hookName="node.change" methodName="removeThumbnail" defer="true"/>
		</hooks>
		<actions>
			<action name="slideshow_sel">
				<gui text="234" title="234" accessKey="" hasAccessKey="false">
					<context selection="true" dir="" recycle="hidden"
						actionBar="false" infoPanel="true" actionBarGroup="get">
					</context>
					<selectionContext dir="true" file="true" recycle="true" unique="false" multipleOnly="true" allowedMimes="AJXP_MIMES_IMAGE" behaviour="hidden"/>
                </gui>
				<rightsContext noUser="true" userLogged="only" read="true" write="false" adminOnly=""/>
				<processing>
					<clientCallback><![CDATA[
						var selectedMime = getAjxpMimeType(ajaxplorer.getUserSelection().getUniqueNode());
						var editors = pydio.Registry.findEditorsForMime(selectedMime);
						var editorData;
						if(editors.length){
							editorData = editors[0];
						}
						if(editorData){
							pydio.Registry.loadEditorResources(editorData.resourcesManager);
							modal.openEditorDialog(editorData);
						}else{
							alert('no data found!');
						}
						]]></clientCallback>
					</processing>
			</action>
			<action name="preview_data_proxy" skipSecureToken="true" contentTypedProvider="true">
				<processing>
					<serverCallback methodName="switchAction" restParams="/file+" sdkMethodName="imagePreview" developerComment="Server an image with correct mimetype, eventually rendered as thumb.">
                        <input_param name="file" type="AJXP_NODE" description="Path to the node" mandatory="true"/>
                        <input_param name="get_thumb" type="boolean" description="Whether to get a thumb version of the image" mandatory="true"/>
                        <input_param name="dimension" type="integer" description="If get_thumb is true, max dimension of the thumb" default="200" mandatory="false" />
					</serverCallback>
				</processing>
			</action>
		</actions>
		<hooks>
			<serverCallback hookName="node.info" methodName="extractImageMetaData" applyCondition="$apply=($args[2]!='minimal');"/>
		</hooks>
		<client_configs>
			<component_config component="FilesList">
				<columns>
					<additional_column messageId="135" attributeName="readable_dimension" sortType="String" defaultVisibilty="hidden"/>
				</columns>
			</component_config>
		</client_configs>
	</registry_contributions>
</editor>
