Klipfolio Dashboard 5 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 running with developer mode enabled 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.

In order to use this object without the Developer Mode 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.html to c:\temp\test.xml on your computer.
<klip>
   <identity>
      <title>
         API: File contentsource example
      </title>
   </identity>
   <locations>
   
      <!--
      	Place the contents of 
      		
      		http://support.klipfolio.com/files/demo/demo.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;

         label: 'Date';
      }

      category {
         noterow: 3;

         label: 'Category';
      }


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

      url {
         type: link;
      }
            
      id {
         key: override;
      }

   </style>
</klip>

     	



 
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 5 API

© 2009 Klipfolio Inc. All Rights Reserved.