Hello,

I try to automatically update a collection of documents in a Hippo repository.
Each document is kept in its own collection within a "main" collection: 
../1/a.xml, ../2/b.xml, etc.
Each update is independent of earlier ones: I don't need caching, no JMS, or 
what more.

So I do a simple scan for old documents (fetchCollection), upload the new and 
delete the old.
Very simple, so I was thinking I could use the Java Adapter directly...

Which works except for the getting the scan. Its function is similar to "ls 
.../*/*.xml".
But my code+DASL gives me a weird response:
- only documents show up that have recently be touched by the CMS (clicked on, 
not necessarily opened)
- the documents I write appear repeated in the list (=duplicates, each write 
cycle one occurrence is added)
- this duplication is reset when I change the DASL query (eg depth to 1, 
returns no documents, and back to 2).
- all documents are listed correctly by CMS and DAVexplorer, no problemo.

I use my own plain WebdavServiceImpl, which I assume does no caching.
Also when I restart my app (tomcat) nothing changes, nor when I restart the 
repo.

Anyway, any help is appreciated? See code below.

Thanks,

Reinier


------------------
Here the code I use:

.....
public void hippoInit (Properties props) {
    try {
        WebdavConfig webdavConfig = new WebdavConfig(props);
        webdavService = new WebdavServiceImpl(webdavConfig);
        rootPath      = webdavService.getBasePath();
    }
    catch (Exception e) {
        error( "Error initializing Hippo repository connection: 
"+e.getMessage());
    }
}

public HashMap hippoScanJobOpenings (String relPath) {
    HashMap jobs = new HashMap();
    jobs.put( "REPO.RELPATH", relPath );

    String query = Interpolation.interpolate( jobsQuery, jobs );
    try {
        DocumentCollection coll = webdavService.fetchCollection( rootPath, 
query, false );
        List docs = coll.getDocuments();

        Iterator iter = docs.iterator();
        while (iter.hasNext()) {
            Document collDoc = (Document) iter.next();
            String   dirPath = ((DocumentPath) 
collDoc.getPath()).getRelativePath();
            message( "Found job: "+dirPath );
        }
    }
    catch (Exception e) {
        error( "Error getting existing job openings: "+e.getMessage());
    }
    return jobs;
}

The DASL query used is:

<d:searchrequest xmlns:d="DAV:" xmlns:S="http://jakarta.apache.org/slide/"; 
xmlns:h="http://hippo.nl/cms/1.0";>
  <d:basicsearch>
    <d:select>
      <d:prop>
        <h:caption/>
        <d:displayname/>
        <h:type/>
        <d:modificationdate/>
      </d:prop>
    </d:select>
    <d:from>
      <d:scope>
        <d:href>${REPO.RELPATH}</d:href>
        <d:depth>2</d:depth>
      </d:scope>
    </d:from>
    <d:where>
      <d:eq>
        <d:prop><h:type/></d:prop>
        <d:literal>jobopening</d:literal>
      </d:eq>
    </d:where>
    <d:orderby>
      <d:order>
        <d:prop><h:modificationDate/></d:prop>
        <d:ascending/>
      </d:order>
    </d:orderby>
  </d:basicsearch>
</d:searchrequest>

Notes:

- props contains the settings to initialise the WebdavConfig object as 
described in ...
- relPath is the path from rootPath to the collection containing the documents.

--

Reinier van den Born
HintTech B.V.

T: +31(0)88 268 25 00
F: +31(0)88 268 25 01
M: +31(0)6 494 171 36

Delftechpark 37i | 2628 XJ Delft | The Netherlands
www.hinttech.com

HintTech is a specialist in eBusiness Technology ( .Net, Java platform, Tridion 
) and IT-Projects.
Chamber of Commerce The Hague nr. 27242282 | Sales Tax nr. NL8062.16.396.B01

begin:vcard
fn:Reinier van den Born
n:van den Born;Reinier
org:HintTech B.V.
adr:;;Delfttechpark 37i ;Delft;;2628 XJ;Netherlands
email;internet:[email protected]
tel;work:+31-88-268 25 00
tel;fax:+31-88-268 25 01
tel;cell:+31-6 494 171 36
note;quoted-printable:KvK Den Haag nr. 27242282 | BTW nr. NL8062.16.396.B01=0D=0A=
	=0D=0A=
	HintTech levert specialisten op het gebied van softwareontwikkeling (.NET=
	en Java), projectmanagement, informatiebeveiliging en business consulting=
	.=0D=0A=
	=0D=0A=
	
url:www.hinttech.com
version:2.1
end:vcard

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to