Added: chemistry/parts/trunk/cmis-js/components/library/template.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/components/library/template.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/components/library/template.html (added)
+++ chemistry/parts/trunk/cmis-js/components/library/template.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,515 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+
+ <div id="cmisbrowser-templates">
+
+ <script id="cmis-library-template" type="text/template">
+ <div class="errors"></div>
+ <div style="display: none;" class="login">
+ <div class="cmis-form">
+ <h1>Login<span>Please fill all the texts in the
fields.</span></h1>
+ <p>
+ <label>
+ <span>Username :</span>
+ <input id="username"
type="text" name="username" placeholder="Your User Name" autocomplete="off">
+ </label>
+ <label>
+ <span>Password :</span>
+ <input id="password"
type="password" name="password" placeholder="Your Password">
+ </label>
+ <label>
+ <span>Remember you?</span>
+ <input id="remember"
type="checkbox" name="remember">
+ </label>
+ <label>
+ <span> </span>
+ <input type="button"
class="button" value="Login" id="login">
+ </label>
+ </p>
+ </div>
+ </div>
+ <div style="display: none;" class="library">
+ <div class="action-header">
+ <div class="query">
+ <input autocomplete="off"
id="queryValue" placeholder="Search document(s)..." type="text">
+ <div id="queryButton"></div>
+ <div style="display: none;"
id="queryClean"></div>
+ <div class="advanced-search"></div>
+ </div>
+ <div class="item logout">Logout</div>
+ <div class="item welcome">Welcome<span
class="username"></span>.</div>
+ <div class="uploadDocument">
+ <div class="addDocument">Add new
document.</div>
+ <div class="uploadarea">
+ <div class="uploadform">
+ <div class="container">
+ <label
for="fileselect">Files to upload:</label>
+ <input
multiple="multiple" name="fileselect[]" id="fileselect" autocomplete="off"
type="file">
+ <br>
+ <button
type="submit">Upload Files</button>
+ </div>
+ </div>
+ <div id="filedrag">
+ <div
class="container">or drop files here...</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="documentlist panel">
+ <table class="table" cellspan="0">
+ <thead class="tableHeader"></thead>
+ <tbody class="tableBody"></tbody>
+ </table>
+ <div class="pagination">
+ <div class="label">Page(s): </div>
+ </div>
+ </div>
+ <div class="documentdetail panel"></div>
+ <div class="documentversion panel"></div>
+ <div class="documentpreview panel"></div>
+ <div class="advanced-search-form panel"></div>
+ </div>
+ <div style="display: none;" id="overlay"></div>
+ </script>
+
+ <script id="cmis-library-header-template" type="text/template">
+ <tr class="cmis-library-header">
+ <td class="cmis-library-cell icon"></td>
+ <td class="cmis-library-cell sortable"
field="cmis:name">Name</td>
+ <td class="cmis-library-cell sortable"
field="cmis:lastModificationDate">Modified</td>
+ <td class="cmis-library-cell sortable"
field="cmis:lastModifiedBy">Modifier</td>
+ <td class="cmis-library-cell"></td>
+ </tr>
+ </script>
+
+ <script id="cmis-library-row-template" type="text/template">
+ <tr class="cmis-library-row" id="${cmis:objectId}"
versionSeriesId="${cmis:versionSeriesId}" baseTypeId="${cmis:baseTypeId}"
objectTypeId="${cmis:objectTypeId}" mimetype="${cmis:contentStreamMimeType}">
+ <td class="cmis-library-cell icon"></td>
+ <td class="cmis-library-cell
cmis-name">${cmis:name}</td>
+ <td
class="cmis-library-cell">${cmis:lastModificationDate}</td>
+ <td
class="cmis-library-cell">${cmis:lastModifiedBy}</td>
+ <td class="cmis-library-cell actions">
+ <!-- <div class="icon icon-edit"
enabled="${canUpdateProperties}" title="Edit Properties"></div> -->
+ <!-- <div class="icon icon-applyACL"
enabled="${canApplyACL}" title="Manage Permissions"></div> -->
+ <div class="icon icon-download"
enabled="${canGetContentStream}" title="Download"></div>
+ <div class="icon icon-preview"
enabled="${canGetContentStream}" mimeType=${cmis:contentStreamMimeType}
title="Preview"></div>
+ </td>
+ <td class="cmis-library-cell more-actions">
+ <span class="icon-more" title="More
action(s)">...</span>
+ <div class="more-actions-popup
detail-actions" style="display:none;">
+ <div class="icon icon-close"
enabled="true" title="Close"></div>
+ <div class="icon icon-download"
enabled="${canGetContentStream}" title="Download">Download</div>
+ <div class="icon icon-preview"
enabled="${canGetContentStream}" mimeType=${cmis:contentStreamMimeType}
title="Preview">Preview</div>
+ <div class="icon icon-view"
enabled="${canGetProperties}" title="View Details">View Details</div>
+ <div class="icon icon-version"
enabled="${canGetAllVersions}" title="Check Versions">Check Versions</div>
+ <div class="icon icon-checkin"
enabled="${canCheckIn}" title="Check-In">Check-In</div>
+ <div class="icon
icon-cancel-checkout" enabled="${canCancelCheckOut}" title="Cancel
Check-Out">Cancel Check-Out</div>
+ <div class="icon icon-checkout"
enabled="${canCheckOut}" title="Check-Out">Check-Out</div>
+ <div class="icon icon-update"
enabled="${canSetContentStream}" title="Update">Update</div>
+ <div class="icon icon-delete"
enabled="${canDeleteObject}" title="Delete">Delete</div>
+ </div>
+ </td>
+ </tr>
+ </script>
+
+ <script id="cmis-library-detail-template" type="text/template"
+ cmisType="_global">
+ <div class="detail">
+ <h2>Document Detail</h2>
+ <table>
+ <tr>
+ <td
class="cmis-library-detail-label">Object Type Id</td>
+ <td
class="cmis-library-detail-value">${cmis:objectTypeId}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Object Id</td>
+ <td
class="cmis-library-detail-value">${cmis:versionSeriesId}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Name</td>
+ <td
class="cmis-library-detail-value">${cmis:name}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">MIME Type</td>
+ <td
class="cmis-library-detail-value">${cmis:contentStreamMimeType}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Creation Date</td>
+ <td
class="cmis-library-detail-value date">${cmis:creationDate}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Created By</td>
+ <td
class="cmis-library-detail-value">${cmis:createdBy}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified Date</td>
+ <td
class="cmis-library-detail-value date">${cmis:lastModificationDate}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified By</td>
+ <td
class="cmis-library-detail-value">${cmis:lastModifiedBy}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Is Checked Out?</td>
+ <td
class="cmis-library-detail-value">${cmis:isVersionSeriesCheckedOut}</td>
+ </tr>
+ </table>
+ </div>
+ <div class="detail-actions" id="${cmis:objectId}"
versionSeriesId="${cmis:versionSeriesId}">
+ <div class="icon icon-back icon-back-documents"
enabled="true">Back to documents list</div>
+ <div class="icon icon-download"
enabled="${canGetContentStream}"><a href="${cmis:contentUrl}">Download</a></div>
+ <div class="icon icon-version"
enabled="${canGetAllVersions}">Check Versions</div>
+ <!-- <div class="icon icon-applyACL"
enabled="${canApplyACL}">Manage Permissions</div> -->
+ <div class="icon icon-delete"
enabled="${canDeleteObject}">Delete Document</div>
+ </div>
+ </script>
+
+ <script id="cmis-library-detail-template" type="text/template"
+ cmisType="cmis:folder">
+ <div class="detail">
+ <h2>Document Detail</h2>
+ <table>
+ <tr>
+ <td
class="cmis-library-detail-label">Object Type Id</td>
+ <td
class="cmis-library-detail-value">${cmis:objectTypeId}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Object Id</td>
+ <td
class="cmis-library-detail-value">${cmis:objectId}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Name</td>
+ <td
class="cmis-library-detail-value">${cmis:name}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Creation Date</td>
+ <td
class="cmis-library-detail-value date">${cmis:creationDate}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Created By</td>
+ <td
class="cmis-library-detail-value">${cmis:createdBy}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified Date</td>
+ <td
class="cmis-library-detail-value date">${cmis:lastModificationDate}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified By</td>
+ <td
class="cmis-library-detail-value">${cmis:lastModifiedBy}</td>
+ </tr>
+ </table>
+ </div>
+ <div class="detail-actions" id="${cmis:objectId}"
versionSeriesId="${cmis:versionSeriesId}">
+ <div class="icon icon-back icon-back-documents"
enabled="true">Back to documents list</div>
+ <!-- <div class="icon icon-applyACL"
enabled="${canApplyACL}">Manage Permissions</div> -->
+ <div class="icon icon-delete"
enabled="${canDeleteObject}">Delete Document</div>
+ </div>
+ </script>
+
+ <script id="cmis-library-version-template" type="text/template">
+ <div class="version" id="${cmis:objectId}"
versionSeriesId="${cmis:versionSeriesId}">
+ <table>
+ <tr>
+ <td
class="cmis-library-detail-label">Version</td>
+ <td
class="cmis-library-detail-value">${cmis:versionLabel}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Name</td>
+ <td
class="cmis-library-detail-value">${cmis:name}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified Date</td>
+ <td
class="cmis-library-detail-value date">${cmis:lastModificationDate}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label">Last Modified By</td>
+ <td
class="cmis-library-detail-value">${cmis:lastModifiedBy}</td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-detail-label"></td>
+ <td
class="cmis-library-detail-value download"><div class="icon-download
icon">Download</td>
+ </tr>
+ </table>
+ </div>
+ </script>
+
+ <script id="cmis-library-advanced-search-template-content"
class="cmis-library-advanced-search-template" type="text/template"
cmisType="cmis:document" title="Content">
+ <div class="search-form">
+ <table align="center">
+ <tr>
+ <td
class="cmis-library-search-form-label">Name</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cmis:name" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Title</td>
+ <td
class="cmis-library-search-form-input">
+ <input field="cm:title"
cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Description</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cm:description" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Mimetype</td>
+ <td
class="cmis-library-search-form-input">
+ <select
field="cmis:contentStreamMimeType" cmisPropertyType="string">
+ <option
value="">Unknown</option>
+ <option
value="video/3gpp">3G Video</option>
+ <option
value="video/3gpp2">3G2 Video</option>
+ <option
value="application/vnd.adobe.xdp+xml">Adobe Acrobat XML Data Package</option>
+ <option
value="application/vnd.adobe.aftereffects.project">Adobe AfterEffects
Project</option>
+ <option
value="application/vnd.adobe.aftereffects.template">Adobe AfterEffects
Template</option>
+ <option
value="application/vnd.adobe.air-application-installer-package+zip">Adobe
AIR</option>
+ <option
value="image/x-raw-adobe">Adobe Digital Negative Image</option>
+ <option
value="application/x-zip">Adobe Flex Project File</option>
+ <option
value="application/framemaker">Adobe FrameMaker</option>
+ <option
value="application/illustrator">Adobe Illustrator File</option>
+ <option
value="application/x-indesign">Adobe InDesign Document</option>
+ <option
value="application/pagemaker">Adobe PageMaker</option>
+ <option
value="application/pdf">Adobe PDF Document</option>
+ <option
value="image/vnd.adobe.photoshop">Adobe Photoshop</option>
+ <option
value="image/vnd.adobe.premiere">Adobe Premiere</option>
+ <option
value="audio/vnd.adobe.soundbooth">Adobe SoundBooth</option>
+ <option
value="audio/x-aiff">AIFF Audio</option>
+ <option
value="application/acp">Alfresco Content Package</option>
+ <option
value="application/vnd.android.package-archive">Android Package</option>
+ <option
value="image/x-portable-anymap">Anymap Image</option>
+ <option
value="application/vnd.apple.keynote">Apple iWork Keynote</option>
+ <option
value="application/vnd.apple.numbers">Apple iWork Numbers</option>
+ <option
value="application/vnd.apple.pages">Apple iWork Pages</option>
+ <option
value="image/vnd.dwg">AutoCAD Drawing</option>
+ <option
value="image/x-dwt">AutoCAD Template</option>
+ <option
value="audio/basic">Basic Audio</option>
+ <option
value="application/octet-stream">Binary File (Octet Stream)</option>
+ <option
value="image/bmp">Bitmap Image</option>
+ <option
value="image/x-raw-canon">Canon RAW Image</option>
+ <option
value="image/cgm">CGM Image</option>
+ <option
value="text/csv">Comma Separated Values (CSV)</option>
+ <option
value="application/dita+xml">DITA</option>
+ <option
value="message/rfc822">EMail</option>
+ <option
value="application/eps">EPS Type PostScript</option>
+ <option
value="audio/x-flac">FLAC Audio</option>
+ <option
value="application/x-fla">Flash Source</option>
+ <option
value="video/x-flv">Flash Video</option>
+ <option
value="image/x-raw-fuji">Fuji RAW Image</option>
+ <option
value="image/gif">GIF Image</option>
+ <option
value="image/x-portable-graymap">Greymap Image</option>
+ <option
value="application/x-gzip">GZIP</option>
+ <option
value="application/x-gtar">GZIP Tarball</option>
+ <option
value="image/x-raw-hasselblad">Hasselblad RAW Image</option>
+ <option
value="text/html">HTML</option>
+ <option
value="application/vnd.oasis.opendocument.text-web">HTML Document
Template</option>
+ <option
value="text/calendar">iCalendar File</option>
+ <option
value="image/ief">IEF Image</option>
+ <option
value="application/java">Java Class</option>
+ <option
value="application/x-javascript">Java Script</option>
+ <option
value="image/jp2">JPEG 2000 Image</option>
+ <option
value="image/jpeg">JPEG Image</option>
+ <option
value="application/json">JSON</option>
+ <option
value="image/x-raw-kodak">Kodak RAW Image</option>
+ <option
value="application/x-latex">LaTeX</option>
+ <option
value="image/x-raw-leica">Leica RAW Image</option>
+ <option
value="application/x-troff-man">Man Page</option>
+ <option
value="text/x-markdown">Markdown</option>
+ <option
value="text/mediawiki">MediaWiki Markup</option>
+ <option
value="application/vnd.ms-excel">Microsoft Excel</option>
+ <option
value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">Microsoft
Excel 2007</option>
+ <option
value="application/vnd.ms-excel.addin.macroenabled.12">Microsoft Excel 2007
add-in</option>
+ <option
value="application/vnd.ms-excel.sheet.binary.macroenabled.12">Microsoft Excel
2007 binary workbook</option>
+ <option
value="application/vnd.ms-excel.sheet.macroenabled.12">Microsoft Excel 2007
macro-enabled workbook</option>
+ <option
value="application/vnd.ms-excel.template.macroenabled.12">Microsoft Excel 2007
macro-enabled workbook template</option>
+ <option
value="application/vnd.openxmlformats-officedocument.spreadsheetml.template">Microsoft
Excel template 2007</option>
+ <option
value="application/vnd.ms-outlook">Microsoft Outlook Message</option>
+ <option
value="application/vnd.ms-powerpoint">Microsoft PowerPoint</option>
+ <option
value="application/vnd.ms-powerpoint.addin.macroenabled.12">Microsoft
PowerPoint 2007 add-in</option>
+ <option
value="application/vnd.ms-powerpoint.presentation.macroenabled.12">Microsoft
PowerPoint 2007 macro-enabled presentation</option>
+ <option
value="application/vnd.ms-powerpoint.template.macroenabled.12">Microsoft
PowerPoint 2007 macro-enabled presentation template</option>
+ <option
value="application/vnd.ms-powerpoint.slide.macroenabled.12">Microsoft
PowerPoint 2007 macro-enabled slide</option>
+ <option
value="application/vnd.ms-powerpoint.slideshow.macroenabled.12">Microsoft
PowerPoint 2007 macro-enabled slide show</option>
+ <option
value="application/vnd.openxmlformats-officedocument.presentationml.presentation">Microsoft
PowerPoint 2007 presentation</option>
+ <option
value="application/vnd.openxmlformats-officedocument.presentationml.slide">Microsoft
PowerPoint 2007 slide</option>
+ <option
value="application/vnd.openxmlformats-officedocument.presentationml.slideshow">Microsoft
PowerPoint 2007 slide show</option>
+ <option
value="application/vnd.openxmlformats-officedocument.presentationml.template">Microsoft
PowerPoint 2007 template</option>
+ <option
value="application/vnd.ms-project">Microsoft Project</option>
+ <option
value="application/vnd.visio">Microsoft Visio</option>
+ <option
value="application/msword">Microsoft Word</option>
+ <option
value="application/vnd.openxmlformats-officedocument.wordprocessingml.document">Microsoft
Word 2007</option>
+ <option
value="application/vnd.ms-word.document.macroenabled.12">Microsoft Word 2007
macro-enabled document</option>
+ <option
value="application/vnd.ms-word.template.macroenabled.12">Microsoft Word 2007
macro-enabled document template</option>
+ <option
value="application/vnd.openxmlformats-officedocument.wordprocessingml.template">Microsoft
Word 2007 template</option>
+ <option
value="image/x-raw-minolta">Minolta RAW Image</option>
+ <option
value="audio/mpeg">MPEG Audio</option>
+ <option
value="video/mp2t">MPEG Transport Stream</option>
+ <option
value="video/mpeg">MPEG Video</option>
+ <option
value="video/mpeg2">MPEG2 Video</option>
+ <option
value="audio/mp4">MPEG4 Audio</option>
+ <option
value="video/mp4">MPEG4 Video</option>
+ <option
value="video/x-m4v">MPEG4 Video (m4v)</option>
+ <option
value="video/x-ms-asf">MS ASF Streaming Video</option>
+ <option
value="video/x-msvideo">MS Video</option>
+ <option
value="audio/x-ms-wma">MS WMA Streaming Audio</option>
+ <option
value="video/x-ms-wmv">MS WMV Streaming Video</option>
+ <option
value="image/x-raw-nikon">Nikon RAW Image</option>
+ <option
value="audio/ogg">Ogg Audio</option>
+ <option
value="application/ogg">Ogg Multiplex</option>
+ <option
value="video/ogg">Ogg Video</option>
+ <option
value="audio/vorbis">Ogg Vorbis Audio</option>
+ <option
value="image/x-raw-olympus">Olympus RAW Image</option>
+ <option
value="application/vnd.oasis.opendocument.chart">OpenDocument Chart</option>
+ <option
value="application/vnd.oasis.opendocument.database">OpenDocument
Database</option>
+ <option
value="application/vnd.oasis.opendocument.graphics">OpenDocument
Drawing</option>
+ <option
value="application/vnd.oasis.opendocument.graphics-template">OpenDocument
Drawing Template</option>
+ <option
value="application/vnd.oasis.opendocument.formula">OpenDocument Formula</option>
+ <option
value="application/vnd.oasis.opendocument.image">OpenDocument Image</option>
+ <option
value="application/vnd.oasis.opendocument.text-master">OpenDocument Master
Document</option>
+ <option
value="application/vnd.oasis.opendocument.presentation">OpenDocument
Presentation</option>
+ <option
value="application/vnd.oasis.opendocument.presentation-template">OpenDocument
Presentation Template</option>
+ <option
value="application/vnd.oasis.opendocument.spreadsheet">OpenDocument
Spreadsheet</option>
+ <option
value="application/vnd.oasis.opendocument.spreadsheet-template">OpenDocument
Spreadsheet Template</option>
+ <option
value="application/vnd.oasis.opendocument.text">OpenDocument Text (OpenOffice
2.0)</option>
+ <option
value="application/vnd.oasis.opendocument.text-template">OpenDocument Text
Template</option>
+ <option
value="application/vnd.sun.xml.calc">OpenOffice 1.0/StarOffice6.0 Calc
6.0</option>
+ <option
value="application/vnd.sun.xml.calc.template">OpenOffice 1.0/StarOffice6.0 Calc
6.0 Template</option>
+ <option
value="application/vnd.sun.xml.draw">OpenOffice 1.0/StarOffice6.0 Draw
6.0</option>
+ <option
value="application/vnd.sun.xml.impress">OpenOffice 1.0/StarOffice6.0 Impress
6.0</option>
+ <option
value="application/vnd.sun.xml.impress.template">OpenOffice 1.0/StarOffice6.0
Impress 6.0 Template</option>
+ <option
value="application/vnd.sun.xml.writer">OpenOffice 1.0/StarOffice6.0 Writer
6.0</option>
+ <option
value="application/vnd.sun.xml.writer.template">OpenOffice 1.0/StarOffice6.0
Writer 6.0 Template</option>
+ <option
value="image/x-raw-panasonic">Panasonic RAW Image</option>
+ <option
value="image/x-raw-pentax">Pentax RAW Image</option>
+ <option
value="image/x-portable-pixmap">Pixmap Image</option>
+ <option
value="text/plain">Plain Text</option>
+ <option
value="image/png">PNG Image</option>
+ <option
value="image/x-portable-bitmap">Portable Bitmap</option>
+ <option
value="application/postscript">PostScript</option>
+ <option
value="application/remote-printing">Printer Text File</option>
+ <option
value="video/quicktime">Quicktime Video</option>
+ <option
value="video/x-rad-screenplay">RAD Screen Display</option>
+ <option
value="image/x-cmu-raster">Raster Image</option>
+ <option
value="image/x-raw-red">RED RAW Image</option>
+ <option
value="image/x-rgb">RGB Image</option>
+ <option
value="text/richtext">Rich Text</option>
+ <option
value="application/rtf">Rich Text Format</option>
+ <option
value="application/rss+xml">RSS</option>
+ <option
value="image/svg+xml">Scalable Vector Graphics Image</option>
+ <option
value="video/x-sgi-movie">SGI Video</option>
+ <option
value="text/sgml">SGML (Human Readable)</option>
+ <option
value="application/sgml">SGML (Machine Readable)</option>
+ <option
value="application/x-sh">Shell Script</option>
+ <option
value="application/x-shockwave-flash">Shockwave Flash</option>
+ <option
value="image/x-raw-sigma">Sigma RAW Image</option>
+ <option
value="image/x-raw-sony">Sony RAW Image</option>
+ <option
value="application/vnd.stardivision.chart">StaChart 5.x</option>
+ <option
value="application/vnd.stardivision.calc">StarCalc 5.x</option>
+ <option
value="application/vnd.stardivision.draw">StarDraw 5.x</option>
+ <option
value="application/vnd.stardivision.impress">StarImpress 5.x</option>
+ <option
value="application/vnd.stardivision.impress-packed">StarImpress Packed
5.x</option>
+ <option
value="application/vnd.stardivision.math">StarMath 5.x</option>
+ <option
value="application/vnd.stardivision.writer">StarWriter 5.x</option>
+ <option
value="application/vnd.stardivision.writer-global">StarWriter 5.x
global</option>
+ <option
value="text/css">Style Sheet</option>
+ <option
value="text/tab-separated-values">Tab Separated Values</option>
+ <option
value="application/x-tar">Tarball</option>
+ <option
value="application/x-tex">Tex</option>
+ <option
value="application/x-texinfo">Tex Info</option>
+ <option
value="image/tiff">TIFF Image</option>
+ <option
value="x-world/x-vrml">VRML</option>
+ <option
value="audio/x-wav">WAV Audio</option>
+ <option
value="video/webm">WebM Video</option>
+ <option
value="application/wordperfect">WordPerfect</option>
+ <option
value="image/x-xbitmap">XBitmap Image</option>
+ <option
value="application/xhtml+xml">XHTML</option>
+ <option
value="text/xml">XML</option>
+ <option
value="image/x-xpixmap">XPixmap Image</option>
+ <option
value="image/x-xwindowdump">XWindow Dump</option>
+ <option
value="application/x-compress">Z Compress</option>
+ <option
value="application/zip">ZIP</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Modified Date</td>
+ <td
class="cmis-library-search-form-input">
+ <div><input
field="cmis:lastModificationDate" cmisPropertyType="date" rangeOperator="from"
placeHolder="From (YYYY-MM-DD)"/></div>
+ <div><input
field="cmis:lastModificationDate" cmisPropertyType="date" rangeOperator="to"
placeHolder="To (YYYY-MM-DD)" /></div>
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Modifier</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cmis:lastModifiedBy" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Content Size</td>
+ <td
class="cmis-library-search-form-input">
+ <div><input
field="cmis:contentStreamLength" cmisPropertyType="int" rangeOperator="from"
placeHolder="From"/></div>
+ <div><input
field="cmis:contentStreamLength" cmisPropertyType="int" rangeOperator="to"
placeHolder="To" /></div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button type="button"
class="search-button">Search</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </script>
+
+ <script id="cmis-library-advanced-search-template-folder"
class="cmis-library-advanced-search-template" type="text/template"
cmisType="cmis:folder" title="Folder">
+ <div class="search-form">
+ <table align="center">
+ <tr>
+ <td
class="cmis-library-search-form-label">Name</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cmis:name" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Title</td>
+ <td
class="cmis-library-search-form-input">
+ <input field="cm:title"
cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Description</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cm:description" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td
class="cmis-library-search-form-label">Modifier</td>
+ <td
class="cmis-library-search-form-input">
+ <input
field="cmis:lastModifiedBy" cmisPropertyType="string" />
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button type="button"
class="search-button">Search</button>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </script>
+</div>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/components/library/template.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/lib/README.md
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/lib/README.md?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/lib/README.md (added)
+++ chemistry/parts/trunk/cmis-js/lib/README.md Fri Nov 28 08:44:28 2014
@@ -0,0 +1,12 @@
+CMIS 1.1 JS Library
+-------------------
+
+Version: 1.1 (09-05-2014)
+Developer: Ben Chevallereau ([email protected] /
[email protected])
+
+Description
+-----------
+
+This folder contains only the file cmis.js that provides feature to connect
any CMIS compliant repository based on CMIS 1.1.
+This library is used by the browser and documents UI components.
+A test suite (based on QUnit) has been developed as well to check the
connectivity and the compatibility between this library and your CMIS
repository.
\ No newline at end of file
Added: chemistry/parts/trunk/cmis-js/lib/cmis.js
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/lib/cmis.js?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/lib/cmis.js (added)
+++ chemistry/parts/trunk/cmis-js/lib/cmis.js Fri Nov 28 08:44:28 2014
@@ -0,0 +1,1407 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+
+(function(root, factory) {
+ 'use strict';
+ root.cmis = factory();
+}(this, function() {
+ 'use strict';
+
+ /**
+ * @class cmis global object
+ */
+
+ var lib = {};
+
+ /**
+ * @return {CmisSession}
+ *
+ */
+ lib.createSession = function(url) {
+
+ /**
+ * @class CmisSession
+ *
+ * the session is the enrty point for all cmis requests before
making
+ * any request, session.loadRepository() must be invoked
+ *
+ */
+ var session = {};
+
+ /**
+ * sets token for authentication
+ *
+ * @param {String}
+ * token
+ * @return {CmisSession}
+ */
+ session.setToken = function(token) {
+ _token = token;
+ return session;
+ };
+
+ /**
+ * sets credentials for authentication
+ *
+ * @param {String}
+ * username
+ * @param {String}
+ * password
+ * @return {CmisSession}
+ */
+ session.setCredentials = function(username, password) {
+ _username = username;
+ _password = password;
+ return session;
+ };
+
+ /**
+ * get credentials for authentication
+ *
+ * @return username:password
+ */
+ session.getCredentials = function() {
+ return _username + ":" + _password;
+ };
+
+ /**
+ * get token for authentication
+ *
+ * @return token
+ */
+ session.getToken = function() {
+ return _token;
+ };
+
+ /**
+ * Connects to a cmis server and retrieves repositories, token
or
+ * credentials must already be set
+ *
+ */
+ session.loadRepositories = function(options) {
+ var _options;
+ if (options == null)
+ _options = {
+ request : {}
+ };
+ else
+ _options = $.extend(true, {}, options);
+
+ _options.request.success = function(data) {
+ for ( var repo in data) {
+ session.defaultRepository = data[repo];
+ break;
+ }
+ session.repositories = data;
+
+ if (options != null && options.request != null
&& options.request.success != null)
+ options.request.success(data);
+ };
+
+ new CmisRequest(_get(url, _options));
+ };
+
+ /**
+ * gets an object by objectId
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * returnVersion (if set must be one of 'this',
latest' or
+ * 'latestmajor')
+ * @param {Object}
+ * options (possible options: filter,
renditionFilter,
+ * includeAllowableActions, includeRelationships,
includeACL,
+ * includePolicyIds, succinct, token)
+ */
+ session.getObject = function(objectId, returnVersion, options) {
+ options = _fill(options);
+ options.cmisselector = 'object';
+ options.objectId = objectId;
+ if (returnVersion && returnVersion != 'this') {
+ options.major = (returnVersion ==
'latestmajor');
+ }
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * gets an object by path
+ *
+ * @param {String}
+ * path
+ * @param {Object}
+ * options
+ */
+ session.getObjectByPath = function(path, options) {
+ options = _fill(options);
+ options.cmisselector = 'object';
+
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl + path, options));
+ };
+
+ /**
+ * creates a new folder
+ *
+ * @param {String}
+ * parentId
+ * @param {String/Object}
+ * input if `input` is a string used as the folder
name, if
+ * `input` is an object it must contain required
properties:
+ * {'cmis:name': 'aFolder', 'cmis:objectTypeId':
+ * 'cmis:folder'}
+ */
+ session.createFolder = function(parentId, input, policies,
addACEs, removeACEs, options) {
+ var options = _fill(options);
+ if ('string' == typeof input) {
+ input = {
+ 'cmis:name' : input
+ };
+ }
+ var properties = input || {};
+ if (!properties['cmis:objectTypeId']) {
+ properties['cmis:objectTypeId'] = 'cmis:folder';
+ }
+ options.objectId = parentId;
+ _setProps(properties, options);
+ _setACEs(addACEs, 'add', options);
+ _setACEs(removeACEs, 'remove', options);
+ options.repositoryId =
session.defaultRepository.repositoryId;
+ options.cmisaction = 'createFolder';
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * deletes an object
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * allVersions
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.deleteObject = function(objectId, allVersions, options)
{
+ var options = _fill(options);
+ options.repositoryId =
session.defaultRepository.repositoryId;
+ options.cmisaction = 'delete';
+ options.objectId = objectId;
+ options.allVersions = !!allVersions;
+
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * gets repository informations
+ *
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getRepositoryInfo = function(options) {
+ var options = _fill(options);
+ options.cmisselector = 'repositoryInfo';
+ return new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * gets the types that are immediate children of the specified
typeId,
+ * or the base types if no typeId is provided
+ *
+ * @param {String}
+ * typeId
+ * @param {Boolean}
+ * includePropertyDefinitions
+ * @param {Object}
+ * options (possible options: maxItems, skipCount,
token)
+ */
+ session.getTypeChildren = function(typeId,
includePropertyDefinitions, options) {
+ options = _fill(options);
+ if (typeId) {
+ options.typeId = typeId;
+ }
+ options.includePropertyDefinitions =
includePropertyDefinitions;
+ options.cmisselector = 'typeChildren'
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * gets all types descended from the specified typeId, or all
the types
+ * in the repository if no typeId is provided
+ *
+ * @param {String}
+ * typeId
+ * @param {Integer}
+ * depth
+ * @param {Boolean}
+ * includePropertyDefinitions
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getTypeDescendants = function(typeId, depth,
includePropertyDefinitions, options) {
+ options = _fill(options);
+ if (typeId) {
+ options.typeId = typeId;
+ }
+ options.depth = depth || 1;
+ options.includePropertyDefinitions =
includePropertyDefinitions;
+ options.cmisselector = 'typeDescendants'
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+
+ };
+
+ /**
+ * gets definition of the specified type
+ *
+ * @param {String}
+ * typeId
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getTypeDefinition = function(typeId, options) {
+ options = _fill(options);
+ options.typeId = typeId;
+ options.cmisselector = 'typeDefinition'
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+
+ };
+
+ /**
+ * gets the documents that have been checked out in the
repository
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: filter, maxItems,
skipCount,
+ * orderBy, renditionFilter, includeAllowableActions,
+ * includeRelationships, succinct, token)
+ */
+ session.getCheckedOutDocs = function(objectId, options) {
+ options = _fill(options);
+ if (objectId) {
+ options.objectId = objectId;
+ }
+ options.cmisselector = 'checkedOut'
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+
+ };
+
+ /**
+ * creates a new document
+ *
+ * @param {String}
+ * parentId
+ * @param {String/Buffer/Blob}
+ * content
+ * @param {String/Object}
+ * input if `input` is a string used as the document
name, if
+ * `input` is an object it must contain required
properties:
+ * {'cmis:name': 'docName', 'cmis:objectTypeId':
+ * 'cmis:document'}
+ * @param {String}
+ * mimeType
+ * @param {String}
+ * versioningState (if set must be one of: "none",
"major",
+ * "minor", "checkedout")
+ * @param {Object}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.createDocument = function(parentId, file, input,
mimeType, versioningState, policies, addACEs, removeACEs, options) {
+ var options = _fill(options);
+ if ('string' == typeof input) {
+ input = {
+ 'cmis:name' : input
+ };
+ }
+ var properties = input || {};
+ if (!properties['cmis:objectTypeId']) {
+ properties['cmis:objectTypeId'] =
'cmis:document';
+ }
+ if (versioningState) {
+ options.versioningState = versioningState;
+ }
+
+ options.objectId = parentId;
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+ if (removeACEs) {
+ _removeACEs(removeACEs, 'remove', options);
+ }
+ options.repositoryId =
session.defaultRepository.repositoryId;
+ options.cmisaction = 'createDocument';
+
+ new
CmisRequest(_postMultipart(session.defaultRepository.rootFolderUrl, options,
file, mimeType, properties['cmis:name']));
+ };
+
+ /**
+ * creates a document object as a copy of the given source
document
+ *
+ * @param {String}
+ * parentId
+ * @param {String}
+ * sourceId
+ * @param {String/Buffer/Blob}
+ * content
+ * @param {String/Object}
+ * input if `input` is a string used as the document
name, if
+ * `input` is an object it must contain required
properties:
+ * {'cmis:name': 'docName', 'cmis:objectTypeId':
+ * 'cmis:document'}
+ * @param {Stirng}
+ * mimeType
+ * @param {String}
+ * versioningState (if set must be one of: "none",
"major",
+ * "minor", "checkedout")
+ * @param {Array}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.createDocumentFromSource = function(parentId, sourceId,
content, input, mimeType, versioningState, policies, addACEs, removeACEs,
options) {
+ var options = _fill(options);
+ if ('string' == typeof input) {
+ input = {
+ 'cmis:name' : input
+ };
+ }
+ var properties = input || {};
+ if (!properties['cmis:objectTypeId']) {
+ properties['cmis:objectTypeId'] =
'cmis:document';
+ }
+ if (versioningState) {
+ options.versioningState = versioningState;
+ }
+ options.objectId = parentId;
+ options.sourceId = sourceId;
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (removeACEs) {
+ _removeACEs(removeACEs, 'remove', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+ options.repositoryId =
session.defaultRepository.repositoryId;
+ options.cmisaction = 'createDocumentFromSource';
+
+ new
CmisRequest(_postMultipart(session.defaultRepository.rootFolderUrl, options,
content, mimeType, properties['cmis:name']));
+ };
+
+ /**
+ * Creates a relationship
+ *
+ * @param {Object}
+ * properties
+ * @param {Object}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.createRelationship = function(properties, policies,
addACES, removeACEs, options) {
+ options = _fill(options);
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (removeACEs) {
+ _removeACEs(removeACEs, 'remove', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+ options.cmisaction = 'createRelationship';
+ new
CmisRequest(_post(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * Creates a policy
+ *
+ * @param {String}
+ * folderId
+ * @param {Object}
+ * properties
+ * @param {Object}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.createPolicy = function(folderId, properties, policies,
addACES, removeACEs, options) {
+ options = _fill(options);
+ options.objectId = folderId;
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (removeACEs) {
+ _removeACEs(removeACEs, 'remove', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+ options.cmisaction = 'createPolicy';
+ return new
CmisRequest(_post(session.defaultRepository.rootFolderUrl).send(options));
+ };
+
+ /**
+ * Creates an item
+ *
+ * @param {String}
+ * folderId
+ * @param {Object}
+ * properties
+ * @param {Object}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.createItem = function(folderId, properties, policies,
addACEs, removeACEs, options) {
+ options = _fill(options);
+ options.objectId = folderId;
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (removeACEs) {
+ _removeACEs(removeACEs, 'remove', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+ options.cmisaction = 'createItem';
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Updates properties of specified objects
+ *
+ * @param {Array}
+ * objectIds
+ * @param {Object}
+ * properties
+ * @param {Array}
+ * addSecondaryTypeIds
+ * @param {Array}
+ * removeSecondaryTypeIds
+ * @param {Options}
+ * options (possible options: token)
+ */
+ session.bulkUpdateProperties = function(objectIds, properties,
addSecondaryTypeIds, removeSecondaryTypeIds, options) {
+ var options = _fill(options);
+ for (var i = objectIds.length - 1; i >= 0; i--) {
+ options['objectId[' + i + ']'] = objectIds[i];
+ }
+ options.objectIds = objectIds;
+ _setProps(properties, options);
+ if (addSecondaryTypeIds) {
+ _setSecondaryTypeIds(addSecondaryTypeIds,
'add', options);
+ }
+ if (removeSecondaryTypeIds) {
+ _setSecondaryTypeIds(removeSecondaryTypeIds,
'remove', options);
+ }
+ options.cmisaction = 'bulkUpdate';
+ new
CmisRequest(_post(session.defaultRepository.repositoryUrl, options));
+
+ };
+
+ /**
+ * performs a cmis query against the repository
+ *
+ * @param {String}
+ * statement
+ * @param {Boolean}
+ * searchAllversions
+ * @param {Object}
+ * options (possible options: maxItems, skipCount,
orderBy,
+ * renditionFilter, includeAllowableActions,
+ * includeRelationships, succinct, token)
+ */
+ session.query = function(statement, searchAllversions, options)
{
+ options = _fill(options);
+ options.cmisaction = 'query';
+ options.q = statement;
+ options.searchAllversions = !!searchAllversions;
+ new
CmisRequest(_post(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * gets the changed objects, the list object should contain the
next
+ * change log token.
+ *
+ * @param {String}
+ * changeLogToken
+ * @param {Boolean}
+ * includeProperties
+ * @param {Boolean}
+ * includePolicyIds
+ * @param {Boolean}
+ * includeACL
+ * @param {Object}
+ * options (possible options: maxItems, succinct,
token)
+ */
+ session.getContentChanges = function(changeLogToken,
includeProperties, includePolicyIds, includeACL, options) {
+ options = _fill(options);
+ options.cmisselector = 'contentChanges';
+ if (changeLogToken) {
+ options.changeLogToken = changeLogToken;
+ }
+ options.includeProperties = !!includeProperties;
+ options.includePolicyIds = !!includePolicyIds;
+ options.includeACL = !!includeACL;
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * Creates a new type
+ *
+ * @param {Object}
+ * type
+ * @param {Object}
+ * options (possible options: token)
+ *
+ */
+ session.createType = function(type, options) {
+ options = _fill(options);
+ options.cmisaction = 'createType';
+ options.type = JSON.stringify(type);
+ return new
CmisRequest(_post(session.defaultRepository.repositoryUrl).send(options));
+ };
+
+ /**
+ * Updates a type definition
+ *
+ * @param {Object}
+ * type
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.updateType = function(type, options) {
+ options = _fill(options);
+ options.cmisaction = 'updateType';
+ options.type = JSON.stringify(type);
+ return new
CmisRequest(_post(session.defaultRepository.repositoryUrl).send(options));
+
+ };
+
+ /**
+ * Deletes specified type
+ *
+ * @param {String}
+ * typeId
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.deleteType = function(typeId, options) {
+ options = _fill(options);
+ options.cmisaction = 'deleteType';
+ options.typeId = typeId;
+ return new
CmisRequest(_post(session.defaultRepository.repositoryUrl).send(options));
+ };
+
+ /**
+ * gets last result
+ *
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getLastResult = function(options) {
+ options = _fill(options);
+ options.cmisaction = 'lastResult';
+ new
CmisRequest(_get(session.defaultRepository.repositoryUrl, options));
+ };
+
+ /**
+ * Returns children of object specified by id
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: maxItems, skipCount,
filter,
+ * orderBy, renditionFilter, includeAllowableActions,
+ * includeRelationships, includePathSegment,
succinct, token)
+ */
+ session.getChildren = function(objectId, options) {
+ options = _fill(options);
+ options.cmisselector = 'children';
+ options.objectId = objectId;
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets all descendants of specified folder
+ *
+ * @param {String}
+ * folderId
+ * @param {Integer}
+ * depth
+ * @param {Object}
+ * options (possible options: filter,
renditionFilter,
+ * includeAllowableActions, includeRelationships,
+ * includePathSegment, succinct, token)
+ */
+ session.getDescendants = function(folderId, depth, options) {
+ options = _fill(options);
+ options.cmisselector = 'descendants';
+ if (depth) {
+ options.depth = depth;
+ }
+ options.objectId = folderId;
+ return new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets the folder tree of the specified folder
+ *
+ * @param {String}
+ * folderId
+ * @param {Integer}
+ * depth
+ * @param {Object}
+ * options (possible options: filter,
renditionFilter,
+ * includeAllowableActions, includeRelationships,
+ * includePathSegment, succinct, token)
+ */
+ session.getFolderTree = function(folderId, depth, options) {
+ options = _fill(options);
+ options.cmisselector = 'folderTree';
+ if (depth) {
+ options.depth = depth;
+ }
+ options.objectId = folderId;
+
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets the parent folder of the specified folder
+ *
+ * @param {String}
+ * folderId
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.getFolderParent = function(folderId, options) {
+ options = _fill(options);
+ options.cmisselector = 'parent';
+ options.objectId = folderId;
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets the folders that are the parents of the specified object
+ *
+ * @param {String}
+ * folderId
+ * @param {Object}
+ * options (possible options: filter,
renditionFilter,
+ * includeAllowableActions, includeRelationships,
+ * includePathSegment, succinct, token)
+ */
+ session.getParents = function(objectId, options) {
+ options = _fill(options);
+ options.cmisselector = 'parents';
+ options.objectId = objectId;
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets the allowable actions of the specified object
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: filter, maxItems,
skipCount,
+ * orderBy, renditionFilter, includeAllowableActions,
+ * includeRelationships, succinct, token)
+ */
+ session.getAllowableActions = function(objectId, options) {
+ options = _fill(options);
+ options.cmisselector = 'allowableActions';
+ options.objectId = objectId;
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets the properties of the specified object
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * returnVersion (if set must be one of 'this',
latest' or
+ * 'latestmajor')
+ * @param {Object}
+ * options (possible options: filter, succinct,
token)
+ */
+ session.getProperties = function(objectId, returnVersion,
options) {
+ options = _fill(options);
+ options.cmisselector = 'properties';
+ options.objectId = objectId;
+ if (returnVersion && returnVersion != 'this') {
+ options.major = (returnVersion ==
'latestmajor');
+ }
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Gets document content, WARNING: will not work for binary
files
+ * (images, documents, ecc..)
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * download
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getContentStream = function(objectId, download,
options) {
+ options = _fill(options);
+ options.cmisselector = 'content';
+ options.objectId = objectId;
+ options.download = download;
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options), true);
+ };
+
+ /**
+ * Gets document content URL
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * download
+ * @param {Object}
+ * options (possible options: token)
+ * @return String
+ */
+ session.getContentStreamURL = function(objectId, download,
options) {
+ options = _fill(options);
+ options.cmisselector = 'content';
+ options.objectId = objectId;
+ options.download = download;
+
+ var pairs = [];
+ for ( var key in options) {
+ pairs.push(encodeURIComponent(key) + '=' +
encodeURIComponent(options[key]));
+ }
+ var query = pairs.join('&');
+ return session.defaultRepository.rootFolderUrl + '?' +
query;
+ };
+
+ /**
+ * gets document renditions
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: renditionFilter,
maxItems,
+ * skipCount, token)
+ */
+ session.getRenditions = function(objectId, options) {
+ options = _fill(options);
+ options.cmisselector = 'renditions';
+ options.objectId = objectId;
+ options.renditionFilter = options.renditionFilter ||
'*';
+
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+
+ };
+
+ /**
+ * Updates properties of specified object
+ *
+ * @param {Object}
+ * properties
+ * @param {Options}
+ * options (possible options: changeToken, succinct,
token)
+ */
+ session.updateProperties = function(objectId, properties,
options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ _setProps(properties, options);
+ options.cmisaction = 'update';
+
+ // We first need to get properties to check if there is
a change
+ // token or not
+ session.getProperties(objectId, 'this', {
+ request : {
+ success : function(data) {
+ if (data["cmis:changeToken"] !=
null && data["cmis:changeToken"].value != null) {
+ options.changeToken =
data["cmis:changeToken"].value;
+ }
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl + "?objectId=" +
objectId, options));
+ }
+ }
+ });
+
+ };
+
+ /**
+ * Moves an object
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * targeFolderId
+ * @param {String}
+ * sourceFolderId
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.moveObject = function(objectId, sourceFolderId,
targetFolderId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'move';
+ options.targetFolderId = targetFolderId;
+ options.sourceFolderId = sourceFolderId;
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Deletes a folfder tree
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * allVersions
+ * @param {String}
+ * unfileObjects (if set must be one of 'unfile',
+ * 'deletesinglefiled', 'delete')
+ * @param {Boolean}
+ * continueOnFailure
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.deleteTree = function(objectId, allVersions,
unfileObjects, continueOnFailure, options) {
+ var options = _fill(options);
+ options.repositoryId =
session.defaultRepository.repositoryId;
+ options.cmisaction = 'deleteTree';
+ options.objectId = objectId;
+ options.allVersions = !!allVersions;
+ if (unfileObjects) {
+ options.unfileObjects = unfileObjects;
+ }
+ options.continueOnFailure = !!continueOnFailure;
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+
+ };
+
+ /**
+ * Updates content of document
+ *
+ * @param {String}
+ * objectId
+ * @param {String/Buffer}
+ * content
+ * @param {Boolean}
+ * overwriteFlag
+ * @param {String}
+ * mimeType
+ * @param changeToken
+ * @param {Object}
+ * options (possible options: changeToken, succinct,
token)
+ */
+ session.setContentStream = function(objectId, content,
overwriteFlag, mimeType, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.overwriteFlag = !!overwriteFlag;
+ options.cmisaction = 'setContent';
+
+ // We first need to get properties to check if there is
a change
+ // token or not
+ session.getProperties(objectId, 'this', {
+ request : {
+ success : function(data) {
+ if (data["cmis:changeToken"] !=
null && data["cmis:changeToken"].value != null) {
+ options.changeToken =
data["cmis:changeToken"].value;
+ new
CmisRequest(_postMultipart(session.defaultRepository.rootFolderUrl, options,
content, mimeType));
+ }
+ }
+ }
+ });
+
+ };
+
+ /**
+ * Appends content to document
+ *
+ * @param {String}
+ * objectId
+ * @param {String/Buffer}
+ * content
+ * @param {Boolean}
+ * isLastChunk
+ * @param {Object}
+ * options
+ * @return {CmisRequest} (possible options: changeToken,
succinct,
+ * token)
+ */
+ session.appendContentStream = function(objectId, content,
isLastChunk, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'appendContent';
+ options.isLastChunk = !!isLastChunk;
+ new
CmisRequest(_postMultipart(session.defaultRepository.rootFolderUrl, options,
content));
+ };
+
+ /**
+ * deletes object content
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: changeToken, succinct,
token)
+ */
+ session.deleteContentStream = function(objectId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'deleteContent';
+ return new
CmisRequest(_post(session.defaultRepository.rootFolderUrl).send(options));
+ };
+
+ /**
+ * Adds specified object to folder
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * folderId
+ * @param {Boolean}
+ * allVersions
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.addObjectToFolder = function(objectId, folderId,
allVersions, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'addObjectToFolder';
+ options.allVersions = !!allVersions;
+ options.folderId = folderId;
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * Removes specified object from folder
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * folderId
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.removeObjectFromFolder = function(objectId, folderId,
options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'removeObjectFromFolder';
+ options.folderId = folderId;
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * checks out a document
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options
+ */
+ session.checkOut = function(objectId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'checkOut';
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+
+ };
+
+ /**
+ * cancels a check out
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.cancelCheckOut = function(objectId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisaction = 'cancelCheckOut';
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+
+ };
+
+ /**
+ * checks in a document, if needed mimetype may be specified as
+ * input['cmis:contentStreamMimeType'] or as option.mimeType
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * major
+ * @param {String/Object}
+ * input if `input` is a string used as the document
name, if
+ * `input` is an object it must contain required
properties:
+ * {'cmis:name': 'docName'}
+ * @param {String/Buffer}
+ * content
+ * @param {String}
+ * comment
+ * @param {Array}
+ * policies
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {Object}
+ * options
+ */
+ session.checkIn = function(objectId, major, input, content,
comment, policies, addACEs, removeACEs, options) {
+ var options = _fill(options);
+ if ('string' == typeof input) {
+ input = {
+ 'cmis:name' : input
+ };
+ }
+ var properties = input || {};
+ if (comment) {
+ options.checkInComment = comment;
+ }
+ options.major = !!major;
+ options.objectId = objectId;
+ _setProps(properties, options);
+ if (addACEs) {
+ _setACEs(addACEs, 'add', options);
+ }
+ if (removeACEs) {
+ _setACEs(removeACEs, 'remove', options);
+ }
+ if (policies) {
+ _setPolicies(policies, options);
+ }
+
+ options.cmisaction = 'checkIn';
+
+ new
CmisRequest(_postMultipart(session.defaultRepository.rootFolderUrl, options,
content, options.mimeType || properties['cmis:contentStreamMimeType'],
properties['cmis:name']));
+
+ };
+
+ /**
+ * gets versions of object
+ *
+ * @param {Object}
+ * options (possible options: filter,
+ * includeAllowableActions, succinct, token)
+ */
+ session.getAllVersions = function(objectId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisselector = 'versions';
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+
+ };
+
+ /**
+ * gets object relationships
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * includeSubRelationshipTypes
+ * @param {String}
+ * relationshipDirection
+ * @param {String}
+ * typeId
+ * @param {Object}
+ * options (possible options: maxItems, skipCount,
+ * includeAllowableActions, filter, succinct, token)
+ */
+ session.getObjectRelationships = function(objectId,
includeSubRelationshipTypes, relationshipDirection, typeId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.includeSubRelationshipTypes =
!!includeSubRelationshipTypes;
+ options.relationshipDirection = relationshipDirection
|| 'either';
+ if (typeId) {
+ options.typeId = typeId;
+ }
+ options.cmisselector = 'relationships';
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * gets object applied policies
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * options (possible options: filter, succinct,
token)
+ */
+ session.getAppliedPolicies = function(objectId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.cmisselector = 'policies';
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * applies policy to object
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * policyId
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.applyPolicy = function(objectId, policyId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.policyId = policyId;
+ options.cmisaction = 'applyPolicy';
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * removes policy from object
+ *
+ * @param {String}
+ * objectId
+ * @param {String}
+ * policyId
+ * @param {Object}
+ * options (possible options: succinct, token)
+ */
+ session.removePolicy = function(objectId, policyId, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.policyId = policyId;
+ options.cmisaction = 'removePolicy';
+ return new
CmisRequest(_post(session.defaultRepository.rootFolderUrl).send(options));
+
+ };
+
+ /**
+ * applies ACL to object
+ *
+ * @param {String}
+ * objectId
+ * @param {Object}
+ * addACEs
+ * @param {Object}
+ * removeACEs
+ * @param {String}
+ * propagation
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.applyACL = function(objectId, addACEs, removeACEs,
propagation, options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.propagation = propagation;
+ options.cmisaction = 'applyACL';
+ _setACEs(addACEs, 'add', options);
+ _setACEs(removeACEs, 'remove', options);
+ new
CmisRequest(_post(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * gets object ACL
+ *
+ * @param {String}
+ * objectId
+ * @param {Boolean}
+ * onlyBasicPermissions
+ * @param {Object}
+ * options (possible options: token)
+ */
+ session.getACL = function(objectId, onlyBasicPermissions,
options) {
+ var options = _fill(options);
+ options.objectId = objectId;
+ options.onlyBasicPermissions = !!onlyBasicPermissions;
+ options.cmisselector = 'acl';
+ new
CmisRequest(_get(session.defaultRepository.rootFolderUrl, options));
+ };
+
+ /**
+ * @class CmisRequest jQuery wrapper used to manage async
requests
+ */
+ function CmisRequest(req) {
+ $.ajax(req);
+ }
+
+ // Private members and methods
+ var _url = url;
+ var _token = null;
+ var _username = null;
+ var _password = null;
+ var _afterlogin;
+
+ var _http = function(method, options, url) {
+ var r = {
+ type : method,
+ dataType : "json",
+ url : url,
+ data : options,
+ crossDomain : true
+ };
+
+ // If the basic authentication is configured
+ if (_username && _password) {
+ var tok = _username + ":" + _password;
+ var hash = btoa(tok);
+ if (!r.headers)
+ r.headers = new Object();
+ r.headers["Authorization"] = "Basic " + hash;
+ }
+
+ // If we use the authentication with token
+ if (_token) {
+ var tokenName = Object.keys(_token)[0];
+ var tokenValue = _token[tokenName];
+
+ if (method == "GET")
+ r.data[tokenName] = tokenValue;
+ else {
+ // Append the ticket in the URL
+ if (r.url.indexOf("?") > -1)
+ r.url += "&" + tokenName + "="
+ tokenValue;
+ else
+ r.url += "?" + tokenName + "="
+ tokenValue;
+ }
+ }
+
+ // Merge with options.request
+ if (!(typeof options === 'undefined') && !(typeof
options.request === 'undefined')) {
+ for ( var attrName in options.request) {
+ r[attrName] = options.request[attrName];
+ }
+
+ // Delete request options
+ delete r.data.request;
+ }
+
+ return r;
+ };
+
+ var _get = function(url, options) {
+ return _http('GET', options, url);
+ };
+
+ var _post = function(url, options) {
+ return _http('POST', options, url);
+ };
+
+ var _postMultipart = function(url, options, file, mimeType) {
+ var req = _post(url, options);
+
+ var data = new FormData();
+ if (file)
+ data.append('content', file);
+ for ( var k in options) {
+ data.append(k, options[k]);
+ }
+
+ req.data = data;
+ req.contentType = false;
+ req.processData = false;
+
+ return req;
+ }
+
+ var _defaultOptions = {
+ // succinct : true
+ };
+
+ var _fill = function(options) {
+ var o = {};
+ for ( var k in _defaultOptions) {
+ o[k] = _defaultOptions[k];
+ }
+ if (options === undefined) {
+ return o;
+ }
+ for (k in options) {
+ o[k] = options[k];
+ }
+
+ return o;
+ };
+
+ var _setProps = function(properties, options) {
+ var i = 0;
+ for ( var id in properties) {
+ options['propertyId[' + i + ']'] = id;
+ options['propertyValue[' + i + ']'] =
properties[id];
+ i++;
+ }
+ };
+
+ var _setPolicies = function(policies, options) {
+ for (var i = 0; i < policies.length; i++) {
+ options['policy[' + i + ']'] = policies[i];
+ }
+ };
+
+ // action must be either 'add' or 'remove'
+ var _setACEs = function(ACEs, action, options) {
+ var i = 0;
+ for ( var id in ACEs) {
+ options[action + 'ACEPrincipal[' + i + ']'] =
id;
+ var ace = ACEs[id];
+ for (var j = 0; j < ace.length; j++) {
+ options[action + 'ACEPermission[' + i +
'][' + j + ']'] = ACEs[id][j];
+ }
+ i++;
+ }
+ };
+
+ // action must be either 'add' or 'remove'
+ var _setSecondaryTypeIds = function(secondaryTypeIds, action,
options) {
+ for (var i = 0; i < secondaryTypeIds.length; i++) {
+ options[action + 'SecondaryTypeId[' + i + ']']
= secondaryTypeIds[i];
+ }
+ };
+
+ return session;
+ };
+
+ return lib;
+
+}));
Propchange: chemistry/parts/trunk/cmis-js/lib/cmis.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/browser/browser-01.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/browser/browser-01.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/browser/browser-01.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/browser/browser-01.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,60 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+ <!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Browser</title>
+<style>
+body {
+ font-family: "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
+ font-size: 0.8em;
+ color: #444444;
+}
+
+.cmisbrowser {
+ width: 400px;
+ margin: 10px;
+}
+</style>
+<!-- jQuery Dependency -->
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<!-- CMIS Library -->
+<script src="../../lib/cmis.js"></script>
+<!-- Browser component -->
+<script src="../../components/browser/browser.js"></script>
+<link rel="stylesheet" href="../../components/browser/browser.css" />
+<!-- Config file -->
+<script src="../config.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ var options = {
+ cmis : cmisOptions
+ };
+
+ var browser = $("#browser").cmisbrowser(options);
+ });
+</script>
+</head>
+<body>
+
+ <div id="browser" class="cmisbrowser"></div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/browser/browser-01.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/browser/browser-02.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/browser/browser-02.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/browser/browser-02.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/browser/browser-02.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,65 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Browser</title>
+<style>
+body {
+ font-family: "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
+ font-size: 0.8em;
+ color: #444444;
+}
+
+.cmisbrowser {
+ width: 400px;
+ margin: 10px;
+}
+</style>
+<!-- jQuery Dependency -->
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<!-- CMIS Library -->
+<script src="../../lib/cmis.js"></script>
+<!-- Browser component -->
+<script src="../../components/browser/browser.js"></script>
+<link rel="stylesheet" href="../../components/browser/browser.css" />
+<!-- Config file -->
+<script src="../config.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+
+ $.extend(cmisOptions, {
+ initPath : "/Sites/swsdp/documentLibrary"
+ });
+
+ var options = {
+ cmis : cmisOptions,
+ };
+
+ var browser = $("#browser").cmisbrowser(options);
+ });
+</script>
+</head>
+<body>
+
+ <div id="browser" class="cmisbrowser"></div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/browser/browser-02.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-01.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/bundle/bundle-01.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/bundle/bundle-01.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/bundle/bundle-01.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,145 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CMIS Library</title>
+<!-- jQuery Dependency -->
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<!-- CMIS Library -->
+<script src="../../lib/cmis.js"></script>
+<!-- Library component -->
+<script src="../../components/library/library.js"></script>
+<link rel="stylesheet" href="../../components/library/library.css" />
+<!-- Browser Component -->
+<script src="../../components/browser/browser.js"></script>
+<link rel="stylesheet" href="../../components/browser/browser.css" />
+<!-- Configuration -->
+<script src="../config.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ var browserOptions = {
+ cmis : cmisOptions
+ };
+
+ var documentsOptions = {
+ cmis : cmisOptions,
+ autoLoad : false,
+ display : {
+ search : {
+ "cmis:lastModificationDate" :
function(HTMLElement) {
+ $(HTMLElement).datepicker();
+
$(HTMLElement).datepicker("option", "dateFormat", "yy-mm-dd");
+ }
+ },
+ type : {
+ "datetime" : function(value, data) {
+ var options = {
+ weekday : "long",
+ year : "numeric",
+ month : "short",
+ day : "numeric",
+ hour : "2-digit",
+ minute : "2-digit"
+ };
+ return (new
Date(parseInt(value))).toLocaleDateString("en-US", options);
+ }
+ }
+ },
+ events : {
+ complete : function(library) {
+ console.log("Loaded!");
+
+ // Override the clean credentials
function
+ library._cleanCredentials = function() {
+ // Just store the credentials
as a cookie
+ document.cookie =
"cmiscredentials=; expires=" + (new Date(0)).toGMTString() + "; path=/";
+ };
+
+ // Override the store credentials
function
+ library._storeCredentials =
function(type, credentials) {
+ // Just store the credentials
as a cookie
+ var exdays = 1;
+ var d = new Date();
+ d.setTime(d.getTime() + (exdays
* 24 * 60 * 60 * 1000));
+ var expires = "expires=" +
d.toUTCString();
+ document.cookie =
"cmiscredentials=" + type + "$$" + credentials + ";" + expires + "; path=/";
+ };
+
+ // Override the store credentials
function
+ library._retrieveCredentials =
function() {
+ var credentials = null;
+
+ // Just search the cookie
+ var ca =
document.cookie.split(';');
+ var name = "cmiscredentials=";
+ for (var i = 0; i < ca.length;
i++) {
+ var c = ca[i];
+ while (c.charAt(0) == '
')
+ c =
c.substring(1);
+ if (c.indexOf(name) !=
-1)
+ credentials =
c.substring(name.length, c.length);
+ }
+
+ return credentials;
+ };
+
+ }
+ }
+ };
+
+ var browser = $("#browser").cmisbrowser(browserOptions);
+ var library = $("#library").cmislibrary(documentsOptions);
+ });
+</script>
+<!-- Custom CSS -->
+<style>
+body {
+ font-family: "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
+ font-size: 0.8em;
+ color: #444444;
+}
+
+.cmisbrowser {
+ width: 400px;
+ margin: 10px;
+ float: left;
+}
+
+.cmislibrary {
+ width: 900px;
+ margin: 10px;
+ min-height: 300px;
+ padding: 20px;
+ float: left;
+}
+</style>
+
+<!-- JQUERY UI -->
+
+<link rel="stylesheet"
href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
+<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
+
+</head>
+<body>
+ <div id="browser" class="cmisbrowser"></div>
+ <div id="library" class="cmislibrary"></div>
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-01.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-1.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-1.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-1.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-1.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,60 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+ <!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Browser</title>
+<style>
+body {
+ font-family: "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
+ font-size: 0.8em;
+ color: #444444;
+}
+
+.cmisbrowser {
+ width: 400px;
+ margin: 10px;
+}
+</style>
+<!-- jQuery Dependency -->
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<!-- CMIS Library -->
+<script src="../../lib/cmis.js"></script>
+<!-- Browser component -->
+<script src="../../components/browser/browser.js"></script>
+<link rel="stylesheet" href="../../components/browser/browser.css" />
+<!-- Config file -->
+<script src="../config.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ var options = {
+ cmis : cmisOptions
+ };
+
+ var browser = $("#browser").cmisbrowser(options);
+ });
+</script>
+</head>
+<body>
+
+ <div id="browser" class="cmisbrowser"></div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-1.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-2.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-2.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-2.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-2.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,62 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+ <!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Library</title>
+<style>
+body {
+ font-family: "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
+ font-size: 0.8em;
+ color: #444444;
+}
+
+.cmislibrary {
+ width: 900px;
+ margin: 10px;
+ min-height: 300px;
+ padding: 20px;
+}
+</style>
+<!-- jQuery Dependency -->
+<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
+<!-- CMIS Library -->
+<script src="../../lib/cmis.js"></script>
+<!-- Library component -->
+<script src="../../components/library/library.js"></script>
+<link rel="stylesheet" href="../../components/library/library.css" />
+<!-- Config file -->
+<script src="../config.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ var options = {
+ cmis : cmisOptions
+ };
+
+ var library = $("#library").cmislibrary(options);
+ });
+</script>
+</head>
+<body>
+
+ <div id="library" class="cmislibrary"></div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02-2.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02.html
URL:
http://svn.apache.org/viewvc/chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02.html?rev=1642272&view=auto
==============================================================================
--- chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02.html (added)
+++ chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02.html Fri Nov 28
08:44:28 2014
@@ -0,0 +1,38 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CMIS Library Using IFrame</title>
+<script type="text/javascript" src="js/messageBroadcaster.js"></script>
+</head>
+<body>
+ <table>
+ <tr>
+ <td style="vertical-align: top"><iframe
+ src="./bundle-02-1.html"
+ style="width: 450px; min-height: 500px;
border: none;"></iframe></td>
+ <td style="vertical-align: top"><iframe
+ src="./bundle-02-2.html"
+ style="width: 1000px; min-height:
500px; border: none;"></iframe></td>
+ </tr>
+ </table>
+</body>
+</html>
\ No newline at end of file
Propchange: chemistry/parts/trunk/cmis-js/samples/bundle/bundle-02.html
------------------------------------------------------------------------------
svn:eol-style = native