<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=043524319-15092006><FONT face=Arial
color=#0000ff size=2>No worries - I just wish <EM>I'd</EM> spotted it!
This is just the kind of thing which eats up hours of my time too. I try
to learn from my mistakes, but always seem to find new kinds to
make...</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Daniel
Rhoden<BR><B>Sent:</B> 15 September 2006 20:39<BR><B>To:</B> The OpenCms mailing
list<BR><B>Subject:</B> Re: [opencms-dev] Tell me if this makes
sense...<BR></FONT><BR></DIV>
<DIV></DIV>There are times in my life that I have never been happier to feel
like an idiot. Your fresh perspective helped me go back and quadruple
check the destination portion of the copy process. I found that I had been
glossing over the ever-so-difficult-to-see-with-my-eyesight space in the
path. ARRRRG!<BR><BR>Now works perfectly.<BR><BR>Thank you very much for
your help and encouragement. <BR><BR>Jonathan Woods wrote:
<BLOCKQUOTE cite=mid050b01c6d8f9$4edd4c60$0500a8c0@COMPUTER2 type="cite">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=023355418-15092006><FONT face=Arial
color=#0000ff size=2>I can't think of a reason why xmpages and images would be
treated differently. But maybe there's some other difference: is there a
difference in the CmsResourceFilter used under the hood by readResource etc
and copyResource? Maybe the resource in question is deleted, expired etc
in one case but not in the other.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=023355418-15092006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=023355418-15092006><FONT face=Arial
color=#0000ff size=2>It's odd that your error message when calling
...copyResource() says "error CREATING <some path>" - it's not saying
that it can't find the source resource, but that it can't create
one. That makes reminds me of the kind of error
messages you get in various environments when trying to create a resource
in a folder which itself doesn't exist - but I don't see how that can be the
case.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=023355418-15092006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=023355418-15092006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=023355418-15092006></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> <A
class=moz-txt-link-abbreviated
href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</A>
[<A class=moz-txt-link-freetext
href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</A>]
<B>On Behalf Of </B>Daniel Rhoden<BR><B>Sent:</B> 15 September 2006
19:40<BR><B>To:</B> The OpenCms mailing list<BR><B>Subject:</B> Re:
[opencms-dev] Tell me if this makes sense...<BR></FONT><BR></DIV>Thanks
Jon.<BR><BR>Sorry for forgetting to state the fact that I am executing this
jsp from within the Root site ( / ) and not a site itself.<BR><BR>But you are
correct that I would have to have the source = "/myImage.jpg" if I were in the
"mySite" site. I would assume if the ob.existsResource() method see the
file (returns true) then the copyResource should see it just as well (my
assumption).<BR><BR>What is odd is how I have used my generic
copy-a-resource.jsp to copy other resources and they worked just fine. I
haven't been able to identify the differences between the circumstances of
when it worked and now. Would the fact that I am copying an image and
not an xmlpage be the problem?<BR><BR>Jonathan Woods wrote:
<BLOCKQUOTE cite=mid04f901c6d8f4$2933fa90$0500a8c0@COMPUTER2 type="cite">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=409162118-15092006><FONT face=Arial
color=#0000ff size=2>The API is sometimes a bit inconsistent about the
meaning of 'resource name' or 'resource path' in method signatures:
sometimes it's relative to the site root, and sometimes it's absolute.
Are you sure you are using the right variant for
CmsObject.copyResource()? I've not used the method, but I imagine it
takes a site-root-relative value.. yet your symbol 'source' is
absolute. Try using the relative equivalent and see if that
helps.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=409162118-15092006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=409162118-15092006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> <A class=moz-txt-link-abbreviated
href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</A>
[<A class=moz-txt-link-freetext
href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</A>]
<B>On Behalf Of </B>Daniel Rhoden<BR><B>Sent:</B> 15 September 2006
19:11<BR><B>To:</B> The OpenCms mailing list<BR><B>Subject:</B>
[opencms-dev] Tell me if this makes sense...<BR></FONT><BR></DIV>I am trying
to copy a large number of files by writing a jsp that uses
CmsObject.copyResource(). Now tell me if this makes sense to you:
<BR>(assume ob is an instance of CmsObject and <B>source</B> =
"/sites/mySite/myImage.jpg") <BR>
<OL>
<LI>When I do ob.existsResource(<B>source</B>) it returns true. <BR>
<LI>I can even CmsResource rec = ob.readResource(<B>source</B>), and
<B>source</B>.equals(rec.getRootPath() ). <BR>
<LI>Looks good, right? </LI></OL>But when I try to
ob.copyResource(<B>source</B>, destination), I get the following
exception:<BR><BR>org.opencms.file.<B>CmsVfsResourceNotFoundException</B>:
Error creating the resource "/sites/mySite/myImage.jpg"<BR><BR>Not
Found??? Not Found?? Then what the heck was it doing with those
previous calls??<TT><BR><BR></TT>My installed OpenCms version is:
6.2.0<BR><SPAN class=small>Running on Sun Microsystems Inc. Java HotSpot(TM)
Client VM 1.5.0_07-b03 mixed mode, sharing with Linux 2.6.9-34.EL
(i386)<BR>MySql<BR><BR><BR></SPAN><BR><BR><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<A class=moz-txt-link-freetext href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</A></PRE></BLOCKQUOTE><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<A class=moz-txt-link-freetext href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</A></PRE></BLOCKQUOTE></BODY></HTML>