Klipfolio Dashboard API

Object Engines.File

Object
   |
   +--Klip
         |
         +--Engines
               |
               +--Engines.File

The Engines.File object enables a Klip to monitor changes to any file accessible through a Windows UNC (Universal Naming Convention) path. A UNC path may point to a file on the local file system or to a file on a local-area network (LAN).

Here are some examples of valid UNC paths:

Klip Security Model

Using the API call below requires Klipfolio Dashboard Developer Edition and having the XML <scriptmode>extended</scriptmode> within the Klip's <setup> block, as shown below.

   <setup>
     <scriptmode>
       extended
     </scriptmode>
   </setup>
 
In developer mode, select "Allow Blocked Script to Run" from the Klip's Developer Tools menu.

Note: In order to use this object without the Developer Tools turned on, you must have your Klip digitally signed by Klipfolio Inc.

Example Klip: Using UNC path in <contentsource>

You don't have to use the File API in a Klip if you just want to access a file. You can use a UNC path in <contentsource> by prefixing the path with file:///.

For example, following Klip uses a <contentsource> on the local file system.

  <locations>
     <contentsource>
       file:///c:\temp\test.xml
     </contentsource>
   </locations>
 

Before running this Klip, save a copy of demo-static.xml to c:\temp\test.xml on your computer, and turn on the Developer Tools.

<klip>
	<identity>
		<title>
			API: Engines.File contentsource example
		</title>
	</identity>
	<locations>

	<!--
	Place the contents of 

	http://www.klipfolio.com/static/support/demo/demo-static.xml
	at

	c:\temp\test.xml

	and reload this Klip.
	-->

		<contentsource>
			file:///c:\temp\test.xml
		</contentsource>
		<icon>
			http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
		</icon>
		<banner>
			http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png   
		</banner>
	</locations>
	<setup>
		<scriptmode>
			extended
		</scriptmode>
	</setup>
	<style>
		alert {
			type: item;
		}

		sender {
			itemcol: 2;
			noterow: 1;
			label: 'Sender';
			emphasis: strong;
		}

		summary {
			itemcol: 3;
			noterow: 4;
			wrap: false;
			notelabel: false;
		}

		date {
			itemcol: 4;
			noterow: 2;
			format: "nolocaltime";
			label: 'Date';
		}

		category {
			noterow: 3;
			label: 'Category';
		}

		level {
			itemcol: 1;
			noterow: 5;
			notelabel: false;
			type: image;
		}

		url {
			type: link;
		}

		id {
			key: override;
		}

   </style>

</klip>

     	

See also:
File


 
Function Summary
 File open( <String> UNC_path )
           Creates a File object to query the contents of a file.

Function Detail

open

File open( <String> UNC_path )

Klipfolio Dashboard API

© 2011 Klipfolio Inc. All Rights Reserved.