chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r787233 - in /websites/staging/chemistry/trunk/content/dotnet: dotcmis.html powershell-example.html
Date Sat, 19 Mar 2011 20:19:18 GMT
Author: buildbot
Date: Sat Mar 19 20:19:18 2011
New Revision: 787233

Log:
Staging update by buildbot

Added:
    websites/staging/chemistry/trunk/content/dotnet/powershell-example.html
Modified:
    websites/staging/chemistry/trunk/content/dotnet/dotcmis.html

Modified: websites/staging/chemistry/trunk/content/dotnet/dotcmis.html
==============================================================================
--- websites/staging/chemistry/trunk/content/dotnet/dotcmis.html (original)
+++ websites/staging/chemistry/trunk/content/dotnet/dotcmis.html Sat Mar 19 20:19:18 2011
@@ -207,8 +207,8 @@ Apache Chemistry - DotCMIS
 </table>
 <p><a name="DotCMIS-Documentation"></a></p>
 <h2 id="documentation">Documentation</h2>
-<p>There are starter code snippets on the <a href="getting-started-with-dotcmis.html">Getting
started with DotCMIS</a> page
-and the API documentation is available as a <a href="https://builds.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/doc/DotCMISDoc.chm">CHM
Help file</a>.</p>
+<p>There are starter code snippets on the <a href="getting-started-with-dotcmis.html">Getting
started with DotCMIS</a> page and the <a href="powershell-example.html">PowerShell
Example</a> page.
+The API documentation is available as a <a href="https://builds.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/doc/DotCMISDoc.chm">CHM
Help file</a>.</p>
 <p>The interfaces are very similar to the <a href="/java/opencmis.html">OpenCMIS</a>
client API. Please see the
 OpenCMIS documentation for more insights.</p>
 <p><a name="DotCMIS-Sourcecodeanddependencies"></a></p>
@@ -216,8 +216,8 @@ OpenCMIS documentation for more insights
 <p>The DotCMIS source code is here: <a href="https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/">https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/</a>.</p>
 <p>DotCMIS requires the .NET Framework version 3.5 or higher. It does not depend on
anything else.</p>
 <p>The DotCMIS unit tests require NUnit 2.5.</p>
-<p>Nighty builds can be obtained from here: <a href="https://hudson.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/bin/Debug/">Debug
DLL</a>
- and <a href="https://hudson.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/bin/Release/">Release
DLL</a>.</p></div>
+<p>Nighty builds can be obtained from here: <a href="https://builds.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/bin/Debug/">Debug
DLL</a>
+ and <a href="https://builds.apache.org/hudson/job/Chemistry%20-%20DotCMIS/ws/bin/Release/">Release
DLL</a>.</p></div>
              <!-- Content -->
            </td>
           </tr>

Added: websites/staging/chemistry/trunk/content/dotnet/powershell-example.html
==============================================================================
--- websites/staging/chemistry/trunk/content/dotnet/powershell-example.html (added)
+++ websites/staging/chemistry/trunk/content/dotnet/powershell-example.html Sat Mar 19 20:19:18
2011
@@ -0,0 +1,330 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    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.
+
+-->
+<html>
+  <head>
+    <link type="text/css" rel="stylesheet" href="/resources/site.css" />
+    <script src="/resources/space.js" type="text/javascript"></script>
+    <meta name="keywords" content="CMIS, Content Management Interoperability Service,
ECM, Enterprise Content Management, OASIS, integration standards, Chemistry, OpenCMIS, cmislib,
DotCMIS" />
+    <meta name="description" content="Apache Chemistry, CMIS Implementation" />
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>
+Apache Chemistry - PowerShell Examples
+    </title>
+  </head>
+<body onload="init()">
+  <table width="100%" cellpadding="0" cellspacing="0">
+    <tr width="100%">
+      <td id="cell-0-0">&nbsp;</td>
+      <td id="cell-0-1">&nbsp;</td>
+      <td id="cell-0-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-1-0">&nbsp;</td>
+      <td id="cell-1-1">
+        <div style="padding: 0px;">
+          <div id="banner">
+          <!-- Banner -->
+<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
+<TR>
+<TD align="left" class="topbardiv" nowrap="">
+  <A href="http://chemistry.apache.org/" title="Apache Chemistry">
+    <IMG border="0" src="/images/chemistry_tm_logo_small.png"/>
+  </A>
+</TD>
+<TD align="right" nowrap="">
+  <A href="http://www.apache.org/" title="The Apache Software Foundation">
+    <IMG border="0" src="/images/asf-logo.png"/>
+  </A>
+</TD>
+</TR>
+</TABLE>
+          <!-- Banner -->
+          </div>
+        </div>
+        <div id="top-menu">
+          <table border="0" cellpadding="1" cellspacing="0" width="100%">
+            <tr>
+              <td>
+                <div align="left">
+                <!-- Breadcrumbs -->
+<a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/dotnet">Dotnet</a>&nbsp;&raquo&nbsp;<a
href="/dotnet/powershell-example.html">PowerShell Examples</a>
+                <!-- Breadcrumbs -->
+                </div>
+              </td>
+              <td>
+                <div align="right">
+                <!-- Quicklinks -->
+<P>
+<A href="http://www.apache.org/" class="external-link" rel="nofollow">Apache</A>
+|
+<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A>
+|
+<A href="sitemap.html" title="SiteMap">Site Map</A>
+</P>
+                <!-- Quicklinks -->
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+      </td>
+      <td id="cell-1-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-2-0">&nbsp;</td>
+      <td id="cell-2-1">
+        <table>
+          <tr height="100%" valign="top">
+            <td height="100%">
+              <div id="wrapper-menu-page-right">
+                <div id="wrapper-menu-page-top">
+                  <div id="wrapper-menu-page-bottom">
+                    <div id="menu-page">
+                    <!-- NavigationBar -->
+                    <H3><A name="Navigation-Overview"></A>Overview</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="/project/cmis.html" title="What's CMIS">What is CMIS?</A></LI>
+   <LI><A href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A></LI>
+   <LI><A href="/project/community.html" title="Community">Community</A></LI>
+   <LI><A href="http://mail-archives.apache.org/mod_mbox/chemistry-dev/" class="external-link"
rel="nofollow">Mailing List</A></LI>
+   <LI><A href="https://issues.apache.org/jira/browse/CMIS" class="external-link"
rel="nofollow">Issue Tracking</A></LI>
+   <LI><A href="http://www.apache.org/security/" class="external-link" rel="nofollow">Security</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Search"></A>Search</H3>
+
+<DIV style="padding: 0px 0px 0px 20px;">
+<FORM action="http://www.google.com/search" method="get" style="font-size: 10px;">
+<INPUT name="ie" type="hidden" value="UTF-8"></INPUT>
+<INPUT name="oe" type="hidden" value="UTF-8"></INPUT>
+  <INPUT maxlength="255" name="q" size="12" type="text" value=""></INPUT>
+  <INPUT name="btnG" type="submit" value="Search"></INPUT>
+  <INPUT name="domains" type="hidden" value="chemistry.apache.org"></INPUT>
+  <INPUT name="sitesearch" type="hidden" value="chemistry.apache.org"></INPUT>
+</FORM>
+</DIV>
+
+
+<H3><A name="Navigation-CMISforJava"></A>CMIS for Java</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/java/overview.html" title="OpenCMIS Overview and Index">Overview</A></LI>
+  <LI><A href="/java/download.html" title="Downloads">Downloads</A></LI>
+  <LI><A href="/java/developing/dev-index.html" title="">Developing with OpenCMIS</A></LI>
+  <LI><A href="/java/examples/example-index.html" title="Example Code">Example
Code</A></LI>
+  <LI><A href="/java/how-to/how-to-index.html" title="OpenCMIS HowTos">OpenCMIS
HowTos</A></LI>
+  <LI><A href="http://incubator.apache.org/chemistry/javadoc/index.html" class="external-link"
rel="nofollow">JavaDoc</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/" class="external-link"
rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISforPython"></A>CMIS for Python</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/python/cmislib.html" title="cmislib">cmislib</A></LI>
+   <LI><A href="http://incubator.apache.org/chemistry/cmislib-doc/" class="external-link"
rel="nofollow">cmislib Documentation</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/cmislib/trunk/" class="external-link"
rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISforPHP"></A>CMIS for PHP</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/php/phpclient.html" title="phpclient">CMIS PHP Client</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/phpclient/trunk/" class="external-link"
rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISfor.NET"></A>CMIS for .NET</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/dotnet/dotcmis.html" title="DotCMIS">DotCMIS</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/" class="external-link"
rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Sponsorship"></A>Sponsorship</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="http://www.apache.org/foundation/thanks.html" class="external-link"
rel="nofollow">Thanks</A></LI>
+   <LI><A href="http://www.apache.org/foundation/sponsorship.html" class="external-link"
rel="nofollow">Sponsoring Apache</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Internal"></A>Internal Docs</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="/internal/internal-index.html"> Internal Documentation</A></LI>
+</UL>
+                    <!-- NavigationBar -->
+                    </div>
+                </div>
+              </div>
+            </div>
+           </td>
+           <td height="100%">
+             <!-- Content -->
+             <div class="wiki-content"><h1 id="powershell_examples">PowerShell
Examples</h1>
+<p>The DotCMIS DLL can be used in PowerShell scripts. Here is a simple example.</p>
+<div class="codehilite"><pre><span class="c1"># load DotCMIS DLL</span>
+<span class="p">[</span><span class="n">Reflection</span><span
class="o">.</span><span class="n">Assembly</span><span class="p">]</span><span
class="o">::</span><span class="n">LoadFile</span><span class="p">(</span><span
class="s">&quot;X:\path\to\DotCMIS.dll&quot;</span><span class="p">)</span>
+
+<span class="c1"># -----------------------------------------------------------------</span>
+
+<span class="c1"># helper functions</span>
+<span class="n">function</span> <span class="n">New</span><span
class="o">-</span><span class="n">GenericDictionary</span><span class="p">([</span><span
class="n">type</span><span class="p">]</span> <span class="nv">$keyType</span><span
class="p">,</span> <span class="p">[</span><span class="n">type</span><span
class="p">]</span><span class="nv">$valueType</span><span class="p">)</span>
<span class="p">{</span>  
+   <span class="nv">$base</span> <span class="o">=</span> <span
class="p">[</span><span class="n">System</span><span class="o">.</span><span
class="n">Collections</span><span class="o">.</span><span class="n">Generic</span><span
class="o">.</span><span class="n">Dictionary</span><span class="sb">``</span><span
class="mi">2</span><span class="p">]</span>  
+   <span class="nv">$ct</span> <span class="o">=</span> <span
class="nv">$base</span><span class="o">.</span><span class="n">MakeGenericType</span><span
class="p">((</span><span class="nv">$keyType</span><span class="p">,</span>
<span class="nv">$valueType</span><span class="p">))</span>  
+   <span class="n">New</span><span class="o">-</span><span class="n">Object</span>
<span class="nv">$ct</span>
+<span class="p">}</span>
+
+<span class="n">function</span> <span class="n">New</span><span
class="o">-</span><span class="n">ContentStream</span><span class="p">([</span><span
class="n">string</span><span class="p">]</span> <span class="nv">$file</span><span
class="p">,</span> <span class="p">[</span><span class="n">string</span><span
class="p">]</span> <span class="nv">$mimetype</span><span class="p">)</span>
<span class="p">{</span>
+   <span class="nv">$fileinfo</span> <span class="o">=</span> <span
class="p">([</span><span class="n">System</span><span class="o">.</span><span
class="n">IO</span><span class="o">.</span><span class="n">FileInfo</span><span
class="p">]</span><span class="nv">$file</span><span class="p">)</span>
+
+   <span class="nv">$contentStream</span> <span class="o">=</span>
<span class="n">New</span><span class="o">-</span><span class="n">Object</span>
<span class="s">&quot;DotCMIS.Data.Impl.ContentStream&quot;</span>
+   <span class="nv">$contentStream</span><span class="o">.</span><span
class="n">Filename</span> <span class="o">=</span> <span class="nv">$fileinfo</span><span
class="o">.</span><span class="n">Name</span>
+   <span class="nv">$contentStream</span><span class="o">.</span><span
class="n">Length</span> <span class="o">=</span> <span class="nv">$fileinfo</span><span
class="o">.</span><span class="n">Length</span>
+   <span class="nv">$contentStream</span><span class="o">.</span><span
class="n">MimeType</span> <span class="o">=</span> <span class="nv">$mimetype</span>
+   <span class="nv">$contentStream</span><span class="o">.</span><span
class="n">Stream</span> <span class="o">=</span> <span class="nv">$fileinfo</span><span
class="o">.</span><span class="n">OpenRead</span><span class="p">()</span>
+
+   <span class="nv">$contentStream</span>
+<span class="p">}</span>
+
+<span class="n">function</span> <span class="n">Download</span><span
class="o">-</span><span class="n">ContentStream</span><span class="p">([</span><span
class="n">DotCMIS</span><span class="o">.</span><span class="n">Client</span><span
class="o">.</span><span class="n">IDocument</span><span class="p">]</span>
<span class="nv">$document</span><span class="p">,</span> <span
class="p">[</span><span class="n">string</span><span class="p">]</span>
<span class="nv">$file</span><span class="p">)</span> <span class="p">{</span>
+   <span class="nv">$contentStream</span> <span class="o">=</span>
<span class="nv">$document</span><span class="o">.</span><span
class="n">GetContentStream</span><span class="p">()</span>   
+   <span class="nv">$fileStream</span> <span class="o">=</span> <span
class="p">[</span><span class="n">System</span><span class="o">.</span><span
class="n">IO</span><span class="o">.</span><span class="n">File</span><span
class="p">]</span><span class="o">::</span><span class="n">OpenWrite</span><span
class="p">(</span><span class="nv">$file</span><span class="p">)</span>
+
+   <span class="nv">$buffer</span> <span class="o">=</span> <span
class="n">New</span><span class="o">-</span><span class="n">Object</span>
<span class="n">byte</span><span class="o">[]</span> <span class="mi">4096</span>
 
+   <span class="k">do</span> <span class="p">{</span>  
+      <span class="nv">$b</span> <span class="o">=</span> <span
class="nv">$contentStream</span><span class="o">.</span><span class="n">Stream</span><span
class="o">.</span><span class="n">Read</span><span class="p">(</span><span
class="nv">$buffer</span><span class="p">,</span> <span class="mi">0</span><span
class="p">,</span> <span class="mi">4096</span><span class="p">)</span>
 
+      <span class="nv">$fileStream</span><span class="o">.</span><span
class="n">Write</span><span class="p">(</span><span class="nv">$buffer</span><span
class="p">,</span> <span class="mi">0</span><span class="p">,</span>
<span class="nv">$b</span><span class="p">)</span>  
+   <span class="p">}</span>  
+   <span class="k">while</span> <span class="p">(</span><span
class="nv">$b</span> <span class="o">-</span><span class="ow">ne</span>
<span class="mi">0</span><span class="p">)</span>
+
+   <span class="nv">$fileStream</span><span class="o">.</span><span
class="n">Close</span><span class="p">()</span>
+   <span class="nv">$contentStream</span><span class="o">.</span><span
class="n">Stream</span><span class="o">.</span><span class="n">Close</span><span
class="p">()</span>
+<span class="p">}</span>
+
+<span class="c1"># -----------------------------------------------------------------</span>
+
+<span class="c1"># create session</span>
+<span class="nv">$sp</span> <span class="o">=</span> <span class="n">New</span><span
class="o">-</span><span class="n">GenericDictionary</span> <span class="n">string</span>
<span class="n">string</span>
+<span class="nv">$sp</span><span class="p">[</span><span class="s">&quot;org.apache.chemistry.dotcmis.binding.spi.type&quot;</span><span
class="p">]</span> <span class="o">=</span> <span class="s">&quot;atompub&quot;</span><span
class="p">;</span>
+<span class="nv">$sp</span><span class="p">[</span><span class="s">&quot;org.apache.chemistry.dotcmis.binding.atompub.url&quot;</span><span
class="p">]</span> <span class="o">=</span> <span class="s">&quot;http://localhost:8080/alfresco/service/cmis&quot;</span>
+<span class="nv">$sp</span><span class="p">[</span><span class="s">&quot;org.apache.chemistry.dotcmis.user&quot;</span><span
class="p">]</span> <span class="o">=</span> <span class="s">&quot;admin&quot;</span><span
class="p">;</span>
+<span class="nv">$sp</span><span class="p">[</span><span class="s">&quot;org.apache.chemistry.dotcmis.password&quot;</span><span
class="p">]</span> <span class="o">=</span> <span class="s">&quot;admin&quot;</span><span
class="p">;</span>
+
+<span class="nv">$factory</span> <span class="o">=</span> <span
class="p">[</span><span class="n">DotCMIS</span><span class="o">.</span><span
class="n">Client</span><span class="o">.</span><span class="n">Impl</span><span
class="o">.</span><span class="n">SessionFactory</span><span class="p">]</span><span
class="o">::</span><span class="n">NewInstance</span><span class="p">()</span>
+<span class="nv">$session</span> <span class="o">=</span> <span
class="nv">$factory</span><span class="o">.</span><span class="n">GetRepositories</span><span
class="p">(</span><span class="nv">$sp</span><span class="p">)[</span><span
class="mi">0</span><span class="p">]</span><span class="o">.</span><span
class="n">CreateSession</span><span class="p">()</span>
+
+<span class="c1"># print the repository infos</span>
+<span class="nv">$session</span><span class="o">.</span><span
class="n">Repositoryinfo</span><span class="o">.</span><span class="n">Id</span>
+<span class="nv">$session</span><span class="o">.</span><span
class="n">Repositoryinfo</span><span class="o">.</span><span class="n">Name</span>
+<span class="nv">$session</span><span class="o">.</span><span
class="n">Repositoryinfo</span><span class="o">.</span><span class="n">Vendor</span>
+<span class="nv">$session</span><span class="o">.</span><span
class="n">Repositoryinfo</span><span class="o">.</span><span class="n">ProductName</span>
+<span class="nv">$session</span><span class="o">.</span><span
class="n">Repositoryinfo</span><span class="o">.</span><span class="n">ProductVersion</span>
+
+<span class="c1"># get root folder</span>
+<span class="nv">$root</span> <span class="o">=</span> <span class="nv">$session</span><span
class="o">.</span><span class="n">GetRootFolder</span><span class="p">()</span>
+
+<span class="c1"># print root folder children</span>
+<span class="nv">$children</span> <span class="o">=</span> <span
class="nv">$root</span><span class="o">.</span><span class="n">GetChildren</span><span
class="p">()</span>
+<span class="k">foreach</span> <span class="p">(</span><span class="nv">$object</span>
<span class="n">in</span> <span class="nv">$children</span><span
class="p">)</span> <span class="p">{</span>
+   <span class="nv">$object</span><span class="o">.</span><span
class="n">Name</span> <span class="o">+</span> <span class="s">&quot;
    (&quot;</span> <span class="o">+</span> <span class="nv">$object</span><span
class="o">.</span><span class="n">ObjectType</span><span class="o">.</span><span
class="n">Id</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span>

+<span class="p">}</span>
+
+<span class="c1"># run a quick query</span>
+<span class="nv">$queryresult</span> <span class="o">=</span> <span
class="nv">$session</span><span class="o">.</span><span class="n">Query</span><span
class="p">(</span><span class="s">&quot;SELECT * FROM cmis:document&quot;</span><span
class="p">,</span> <span class="nv">$false</span><span class="p">)</span>
+<span class="k">foreach</span> <span class="p">(</span><span class="nv">$object</span>
<span class="n">in</span> <span class="nv">$queryresult</span><span
class="p">)</span> <span class="p">{</span>
+   <span class="k">foreach</span> <span class="p">(</span><span
class="nv">$item</span> <span class="n">in</span> <span class="nv">$object</span><span
class="o">.</span><span class="n">Properties</span><span class="p">)</span>
<span class="p">{</span>
+      <span class="nv">$item</span><span class="o">.</span><span
class="n">QueryName</span> <span class="o">+</span> <span class="s">&quot;:
&quot;</span> <span class="o">+</span> <span class="nv">$item</span><span
class="o">.</span><span class="n">FirstValue</span>
+   <span class="p">}</span>
+   <span class="s">&quot;----------------------------------&quot;</span>
+<span class="p">}</span>
+
+<span class="c1"># create a folder</span>
+<span class="nv">$folderProperties</span> <span class="o">=</span>
<span class="n">New</span><span class="o">-</span><span class="n">GenericDictionary</span>
<span class="n">string</span> <span class="n">object</span>
+<span class="nv">$folderProperties</span><span class="p">[</span><span
class="s">&quot;cmis:name&quot;</span><span class="p">]</span>
<span class="o">=</span> <span class="s">&quot;myNewFolder&quot;</span>
+<span class="nv">$folderProperties</span><span class="p">[</span><span
class="s">&quot;cmis:objectTypeId&quot;</span><span class="p">]</span>
<span class="o">=</span> <span class="s">&quot;cmis:folder&quot;</span>
+
+<span class="nv">$folder</span> <span class="o">=</span> <span
class="nv">$root</span><span class="o">.</span><span class="n">CreateFolder</span><span
class="p">(</span><span class="nv">$folderProperties</span><span class="p">)</span>
+
+<span class="c1"># create a document </span>
+<span class="nv">$documentProperties</span> <span class="o">=</span>
<span class="n">New</span><span class="o">-</span><span class="n">GenericDictionary</span>
<span class="n">string</span> <span class="n">object</span>
+<span class="nv">$documentProperties</span><span class="p">[</span><span
class="s">&quot;cmis:name&quot;</span><span class="p">]</span>
<span class="o">=</span> <span class="s">&quot;myNewDocument&quot;</span>
+<span class="nv">$documentProperties</span><span class="p">[</span><span
class="s">&quot;cmis:objectTypeId&quot;</span><span class="p">]</span>
<span class="o">=</span> <span class="s">&quot;cmis:document&quot;</span>
+
+<span class="nv">$source</span> <span class="o">=</span> <span
class="nv">$home</span> <span class="o">+</span> <span class="s">&quot;\source.txt&quot;</span>
+<span class="nv">$mimetype</span> <span class="o">=</span> <span
class="s">&quot;text/plain&quot;</span>
+<span class="nv">$contentStream</span> <span class="o">=</span> <span
class="n">New</span><span class="o">-</span><span class="n">ContentStream</span>
<span class="nv">$source</span> <span class="nv">$mimetype</span>
+
+<span class="nv">$doc</span> <span class="o">=</span> <span class="nv">$folder</span><span
class="o">.</span><span class="n">CreateDocument</span><span class="p">(</span><span
class="nv">$documentProperties</span><span class="p">,</span> <span
class="nv">$contentStream</span><span class="p">,</span> <span class="nv">$null</span><span
class="p">)</span>
+
+<span class="c1"># download a document</span>
+<span class="nv">$target</span> <span class="o">=</span> <span
class="nv">$home</span> <span class="o">+</span> <span class="s">&quot;\target.txt&quot;</span>
+<span class="n">Download</span><span class="o">-</span><span class="n">ContentStream</span>
<span class="nv">$doc</span> <span class="nv">$target</span>
+
+<span class="c1"># clean up</span>
+<span class="nv">$doc</span><span class="o">.</span><span class="n">Delete</span><span
class="p">(</span><span class="nv">$true</span><span class="p">)</span>
+<span class="nv">$folder</span><span class="o">.</span><span class="n">Delete</span><span
class="p">(</span><span class="nv">$true</span><span class="p">)</span>
+</pre></div></div>
+             <!-- Content -->
+           </td>
+          </tr>
+        </table>
+     </td>
+     <td id="cell-2-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-3-0">&nbsp;</td>
+      <td id="cell-3-1">&nbsp;</td>
+      <td id="cell-3-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+     <td id="cell-3-0">&nbsp;</td>
+     <td id="cell-3-1">
+       <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+          
+          Apache Chemistry, Apache, the Apache feather logo, and the Apache 
+          Chemistry project logo are trademarks of The Apache Software 
+          Foundation.
+          <BR />
+          Content Management Interoperability Services (CMIS) is an
+          <a href="http://www.oasis-open.org/committees/cmis/">OASIS</a>
+          specification.
+          
+       </div>
+       <!-- Footer -->
+       </div>
+     </td>
+     <td id="cell-3-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-4-0">&nbsp;</td>
+      <td id="cell-4-1">&nbsp;</td>
+      <td id="cell-4-2">&nbsp;</td>
+    </tr>
+  </table>
+</body>
+</html>



Mime
View raw message