Or if you want to store documents via flow use the Webdav facade. 

Add to project.xml 

<dependency>
    <id>webdav-facade:webdav-facade</id>
    <version>1.01.05</version>
    <properties><cocoon.bundle>true</cocoon.bundle></properties>
</dependency>

add webdav-facade.xconf to config dir

<xconf xpath="/cocoon" unless="webdav-facade">
  <webdav-facade>
 
<base-uri>http://localhost:55555/webdav/files/default.preview/content/bu
lk</base-uri>
    <host>localhost</host>
    <realm>Slide Realm</realm>
    <username>root</username>
    <password>password</password>
  </webdav-facade>
</xconf>

add webdav-facade.xroles

<xroles xpath="/role-list"
unless="role[Private:@name='nl.hippo.webdav.facade.WebDAVFacade']">
  <role name="nl.hippo.webdav.facade.WebDAVFacade"
shorthand="webdav-facade"
    default-class="nl.hippo.webdav.facade.WebDAVFacadeImpl"/>
</xroles>

Now in flow you can for example do :

importClass(Packages.nl.hippo.webdav.facade.WebDAVFacade);

function saveDocumentToRepository(source, destination, type) {
  var webdavFacade = null;
  var caption = "myDocumentCaption"

  try{

    webdavFacade = cocoon.getComponent(WebDAVFacade.ROLE);
    webdavFacade.put(source, destination);

    webdavFacade.proppatch(destination, "http://hippo.nl/cms/1.0";,
"caption", caption);
    webdavFacade.proppatch(destination, "http://hippo.nl/cms/1.0";,
"type", type);
  }
  finally {
    if (webdavFacade != null) {
      cocoon.releaseComponent(webdavFacade);
    }
  }
}

-Ard


> 
> Thanks Jeroen,
> 
> I guess I was rather ignorant of WebDAV when I used the 
> SourceWrite transformer. There is also a 
> SourcePropWritingTransformer but using just the 
> WebDAVTransformer would make more sense.
> 
> Thanks again,
> 
> Regards
> 
> On 14/03/2008, Jeroen Reijn <[EMAIL PROTECTED]> wrote:
> >
> > Hi Warrel,
> >
> > as far as I know it's not possible to set webdav properties 
> with the 
> > sourcewrite transformer. You can do this with the webdav 
> transformer 
> > if you want by using the PROPPATCH method.
> >
> > Regards,
> >
> > Jeroen Reijn
> >
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] on behalf of warrell 
> > harries
> > Sent: Thu 3/13/2008 11:27 AM
> > To: Hippo CMS development public mailinglist
> > Subject: [HippoCMS-dev] WebDave type property via SourceWrite 
> > transformer
> >
> > Hi,
> >
> > I am planning to have my Cocoon site put a document into the Hippo 
> > Repository using the WebDav or Source Writer transformer. I 
> can then 
> > use the CMS as a UI to decide whether to publish the 
> contents onto the 
> > site from which they were gathered. I imagine this is a typical 
> > use-case...
> > Currently,
> > I use the property tool to set the type but I imagine there 
> must be a 
> > way to do this when I put the content into the repository 
> from Cocoon? 
> > I'm not using Hippo-Cocoon yet, but I have configured the Cocoon 
> > instance that I am using to use some (one so far) of the Hippo site 
> > modules.
> >
> > I may be missing something obvious here and your help will be 
> > appreciated as ever.
> >
> > Regards
> >
> > Warrell
> >
> > ********************************************
> > Hippocms-dev: Hippo CMS development public mailinglist
> >
> > ********************************************
> > Hippocms-dev: Hippo CMS development public mailinglist
> >
> ********************************************
> Hippocms-dev: Hippo CMS development public mailinglist
> 
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to