[opencms-dev] how to delete a file in OpenCMS with java
Armen Markarian
markarian at inexweb.de
Tue Sep 23 11:09:01 CEST 2003
Hi Jef, you should use the opencms-java api to delete
files/folders/resources. Here an example how i do this:
// resourcepath is the full Path of your resource/file
// cmsObj in an instance of the CmsObject, initialized by the
CmsJspActionElement Class
com.opencms.flex.jsp.CmsJspActionElement cms = new
com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
response);
com.opencms.file.CmsObject cmsObj = cms.getCmsObject();
resourcename = request.getParameter("form_resourcename");
resourcepath = request.getParameter("form_resourcepath");
if(resourcepath!=null && resourcename!=null) resrc =
resourcepath+resourcename;
if(resourcepath!=null) {
try
{
// delete File by given resourcepath
cmsObj.lockResource(resrc);
cmsObj.deleteResource(resrc);
cmsObj.publishResource(resourcepath);
dOK = true;
}
catch (Throwable t){
System.out.println("ERR: DELETE FILE " + t);
}
}
Regards
Armen
-----Ursprüngliche Nachricht-----
Von: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org] Im Auftrag von
opencms-dev-request at opencms.org
Gesendet: Dienstag, 23. September 2003 09:54
An: opencms-dev at opencms.org
Betreff: opencms-dev digest, Vol 1 #453 - 20 msgs
Send opencms-dev mailing list submissions to
opencms-dev at opencms.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
or, via email, send a message with subject or body 'help' to
opencms-dev-request at opencms.org
You can reach the person managing the list at
opencms-dev-admin at opencms.org
When replying, please edit your Subject line so it is more specific than
"Re: Contents of opencms-dev digest..."
Today's Topics:
1. how to delete a file in OpenCMS with java (Biesemans, Jef)
2.
=?iso-8859-1?Q?=BFCan_I_define_variables_or_constants_for_user_in_other_
t?=
=?iso-8859-1?Q?emplates=3F?= (Salvador Santander)
3. opencms compared with other cms tools (Ove Nordstrom)
4.
=?iso-8859-1?Q?_=BFCan_I_define_variables_or_constants_for_use_in_other_
t?=
=?iso-8859-1?Q?emplates=3F?= (Salvador Santander)
5. Re: =?ISO-8859-1?Q?=BFCan?= I define variables or
constants for use in other templates? (M Butcher)
6. how does opencms start (Erik Itter)
7. Re: how does opencms start (Erik Itter)
8. Re: how does opencms start (Erik Itter)
9. retrieving owner and date published (Ian Goldstein)
10. Re: newbie has connection problems with setup
wizard (fixed) (Ray Tayek)
11. Creating a new off-line project (Jonathan Porterfield)
12. scheduled publishing (=?ISO-8859-1?Q?Bj=F6rn=20Schlueter?=)
13. Schedule shuts down tomcat - Urgent!
(=?ISO-8859-1?Q?Bj=F6rn=20Schlueter?=)
14. RE: how does opencms start (Alexander Kandzior)
15. AW: [opencms-dev] opencms compared with other cms tools (Mark
Miller)
16. jsptemplates: How to S/R on element=body??
(hermanhardenbol at zonnet.nl)
--__--__--
Message: 1
From: "Biesemans, Jef" <Jef.Biesemans at eu.fishersci.com>
To: "'opencms-dev at opencms.org'" <opencms-dev at opencms.org>
Date: Mon, 22 Sep 2003 12:33:22 +0200
Subject: [opencms-dev] how to delete a file in OpenCMS with java
Reply-To: opencms-dev at opencms.org
Hi all,
In my project I would like to delete a file in OpenCMS in the folder
Upload. This should be done in a Java-class. I have realy no idea in
which database I could delete the file and don't see it anymore in
OpenCMS. I tought it would work when I deleted the file in the database
CMS_RESOURCE_LINKS but that was incorrect. Can someone please help me
with it.
Thanks,
Jef
The information contained in this message is confidential and is
intended for the addressee only
--__--__--
Message: 2
From: "Salvador Santander" <dominion.salvador.ext at juntadeandalucia.es>
To: "Opencms-Dev at Opencms. Org (E-mail)" <opencms-dev at opencms.org>
Date: Mon, 22 Sep 2003 12:53:21 +0200
Subject: [opencms-dev]
=?iso-8859-1?Q?=BFCan_I_define_variables_or_constants_for_user_in_other_
t?=
=?iso-8859-1?Q?emplates=3F?=
Reply-To: opencms-dev at opencms.org
Hello, list. I want to define a constant or variable called IMAGES_DIR
for use in another templates and, if i change the directory of images, i
haven't to change in all the templates the images directory. ¿Can I
define variables or constants for user in other templates? Thanks.
--__--__--
Message: 3
From: "Ove Nordstrom" <ove.nordstrom at knowit.se>
To: <opencms-dev at opencms.org>
Date: Mon, 22 Sep 2003 13:43:14 +0200
Subject: [opencms-dev] opencms compared with other cms tools
Reply-To: opencms-dev at opencms.org
Hi,
Anyone have read or write an report about opencms compared with other
cms tools (Episerver, polopoly, ...) I really need this information!!!
Best Regards, Ove
--__--__--
Message: 4
From: "Salvador Santander" <dominion.salvador.ext at juntadeandalucia.es>
To: "Opencms-Dev at Opencms. Org (E-mail)" <opencms-dev at opencms.org>
Date: Mon, 22 Sep 2003 14:13:24 +0200
Subject: [opencms-dev]
=?iso-8859-1?Q?_=BFCan_I_define_variables_or_constants_for_use_in_other_
t?=
=?iso-8859-1?Q?emplates=3F?=
Reply-To: opencms-dev at opencms.org
Hello, list. I want to define a constant or variable called IMAGES_DIR
for use in another templates and, if i change the directory of images, i
haven't to change in all the templates the images directory. ¿Can I
define variables or constants for use in other templates? Thanks.
--__--__--
Message: 5
Subject: Re: [opencms-dev] =?ISO-8859-1?Q?=BFCan?= I define variables
or
constants for use in other templates?
From: M Butcher <mbutcher at grcomputing.net>
To: opencms-dev at opencms.org
Date: Mon, 22 Sep 2003 11:57:29 -0600
Reply-To: opencms-dev at opencms.org
Yes, there are lots of ways to do that sort of thing (e.g. using
properties files, etc.). IMHO, the _best_ way to do this is to add a new
tag in the reqistry.xml file and then use the appropriate methods from
A_OpenCms to get the values.
Matt
On Mon, 2003-09-22 at 06:13, Salvador Santander wrote:
> Hello, list. I want to define a constant or variable called IMAGES_DIR
> fo=
r
> use in another templates and, if i change the directory of images, i
> have=
n't
> to change in all the templates the images directory. =C2=BFCan I
> define v=
ariables
> or constants for use in other templates? Thanks.
>=20
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
>visi=
t
> http://mail.opencms.org/mailman/listinfo/opencms-dev
--=20
M Butcher <mbutcher at grcomputing.net>
--__--__--
Message: 6
From: erik.itter at t-online.de (Erik Itter)
To: <opencms-dev at opencms.org>
Date: Mon, 22 Sep 2003 23:06:41 +0200
Subject: [opencms-dev] how does opencms start
Reply-To: opencms-dev at opencms.org
hi currently trying to understand how opencms is working,
my understanding from the web.xml was that processing requests at the
servlet container opencms starts by calling
com.opencms.core.OpenCmsHttpServlet.
i cannot find that class in the project i checked out from the CVS
server.
where is the class or what am i missing?
--__--__--
Message: 7
From: erik.itter at t-online.de (Erik Itter)
To: <opencms-dev at opencms.org>
Subject: Re: [opencms-dev] how does opencms start
Date: Mon, 22 Sep 2003 23:16:05 +0200
Reply-To: opencms-dev at opencms.org
sometimes things solve themselfes - just checked out tonight's version,
seems as if someone had deleted that class before (and a few other
important ones as well, sigh)...
----- Original Message -----
From: "Erik Itter" <erik.itter at t-online.de>
To: <opencms-dev at opencms.org>
Sent: Monday, September 22, 2003 11:06 PM
Subject: [opencms-dev] how does opencms start
hi currently trying to understand how opencms is working,
my understanding from the web.xml was that processing requests at the
servlet container opencms starts by calling
com.opencms.core.OpenCmsHttpServlet.
i cannot find that class in the project i checked out from the CVS
server.
where is the class or what am i missing?
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev
--__--__--
Message: 8
From: erik.itter at t-online.de (Erik Itter)
To: <opencms-dev at opencms.org>
Subject: Re: [opencms-dev] how does opencms start
Date: Mon, 22 Sep 2003 23:28:22 +0200
Reply-To: opencms-dev at opencms.org
sorry, must be leck of sleep but my second post was wrong - the class is
not there - therefor still: where is com.opencms.core.OpenCmsHttpServlet
or what am i missing?
(i think i am using the correct CVS version [head], since it is the only
one i can see [no versions or branches???])
sorry for tripple posting - i'll have some sleep now
------------------------------------------------------------------------
--
----- Original Message -----
From: "Erik Itter" <erik.itter at t-online.de>
To: <opencms-dev at opencms.org>
Sent: Monday, September 22, 2003 11:16 PM
Subject: Re: [opencms-dev] how does opencms start
sometimes things solve themselfes - just checked out tonight's version,
seems as if someone had deleted that class before (and a few other
important ones as well, sigh)...
----- Original Message -----
From: "Erik Itter" <erik.itter at t-online.de>
To: <opencms-dev at opencms.org>
Sent: Monday, September 22, 2003 11:06 PM
Subject: [opencms-dev] how does opencms start
hi currently trying to understand how opencms is working,
my understanding from the web.xml was that processing requests at the
servlet container opencms starts by calling
com.opencms.core.OpenCmsHttpServlet.
i cannot find that class in the project i checked out from the CVS
server.
where is the class or what am i missing?
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev
--__--__--
Message: 9
Date: Mon, 22 Sep 2003 15:22:06 -0700
From: "Ian Goldstein" <iang at bea.com>
To: <opencms-dev at opencms.org>
Subject: [opencms-dev] retrieving owner and date published
Reply-To: opencms-dev at opencms.org
This is a multi-part message in MIME format.
------_=_NextPart_001_01C38157.F4CA5999
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there any way to display the document's owner and date published in =
the document itself by putting something in the jsptemplate, or do I =
have to manually set my own "owner" and "pubdate" properties on each =
document, then get the properties using <cms:property name=3D"..."> in =
the template? =20 Thanks!
------_=_NextPart_001_01C38157.F4CA5999
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR></HEAD> <BODY>
<DIV><FONT face=3DTahoma size=3D2><SPAN class=3D750202322-22092003>Is =
there any way to=20 display the document's owner and date published in
the document itself = by=20 putting something in the jsptemplate, or do
I have to manually set my = own=20 "owner" and "pubdate" properties on
each document, then get the = properties using=20 <cms:property
name=3D"..."> in the template?</SPAN></FONT></DIV> <DIV><FONT
face=3DTahoma size=3D2><SPAN=20
class=3D750202322-22092003></SPAN></FONT> </DIV>
<DIV><FONT face=3DTahoma size=3D2><SPAN=20
class=3D750202322-22092003>Thanks!</SPAN></FONT></DIV></BODY></HTML>
------_=_NextPart_001_01C38157.F4CA5999--
--__--__--
Message: 10
Date: Mon, 22 Sep 2003 15:49:50 -0700
To: opencms-dev at opencms.org
From: Ray Tayek <rtayek at comcast.net>
Subject: Re: [opencms-dev] newbie has connection problems with setup
wizard (fixed)
Reply-To: opencms-dev at opencms.org
At 12:11 AM 9/20/03 -0700, Ray Tayek wrote:
>hi, trying out opnecms. got mysql installed on slak 8.0. added a root
>password (opencms) like the doc says, so i can do a: use mysql; if am
root....
turns out that the password did not take for some reason. i was able to
manually delete the entries with empty user fields and change the
password
for the remaining two fields, so it works fine (got opencms to work).
thanks
---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting
work vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/
--__--__--
Message: 11
Date: Mon, 22 Sep 2003 16:59:22 -0700 (PDT)
From: Jonathan Porterfield <jkeith2 at pacbell.net>
To: opencms-dev at opencms.org
Subject: [opencms-dev] Creating a new off-line project
Reply-To: opencms-dev at opencms.org
--0-337342247-1064275162=:31704
Content-Type: text/plain; charset=us-ascii
Greetings,
A little clarification on off-line project functionality needed also...
a) Can I continually manage files on a files system using an off-line
project? In other words, my off-line project won't become an on-line
project will it?
b) How do I create an off-line project? I have created several on-line
projects, but when I create new projects, I don't see a way to point
OpenCMS to the location on my filesystem where the existing site
resides.
--0-337342247-1064275162=:31704
Content-Type: text/html; charset=us-ascii
<DIV>Greetings, </DIV>
<DIV> </DIV>
<DIV>A little clarification on off-line project functionality needed
also...</DIV>
<DIV>a) Can I continually manage files on a files system using an
off-line project? In other words, my off-line project won't become an
on-line project will it?</DIV> <DIV> </DIV>
<DIV>b) How do I create an off-line project? I have created several
on-line projects, but when I create new projects, I don't see a way to
point OpenCMS to the location on my filesystem where the existing site
resides.</DIV> <DIV> </DIV> <DIV> </DIV>
--0-337342247-1064275162=:31704--
--__--__--
Message: 12
Date: Tue, 23 Sep 2003 09:06:07 +0200
From: "=?ISO-8859-1?Q?Bj=F6rn=20Schlueter?=" <bschlueter at lenord.de>
To: <opencms-dev at opencms.org>
Subject: [opencms-dev] scheduled publishing
Reply-To: opencms-dev at opencms.org
Hello,
did one of you ever develop a kind of scheduled publishing solution?
I am thinking of something like this.
When I create a new objekt loke a html-file it would be neat if I could
= decide when (date + time) this object is to be published. On the other
= hand it would be cool if I could tell opencms when a object needs to
be = depublished i.e. it is not available anymore.
Regards
Bj=F6rn
=20
--__--__--
Message: 13
Date: Tue, 23 Sep 2003 09:10:26 +0200
From: "=?ISO-8859-1?Q?Bj=F6rn=20Schlueter?=" <bschlueter at lenord.de>
To: <opencms-dev at opencms.org>
Subject: [opencms-dev] Schedule shuts down tomcat - Urgent!
Reply-To: opencms-dev at opencms.org
Hello there,
we have troubles with our opencms-installation and I do not have a clue
= how to solve the problem.
It seems as if we use the scheduler to start indexing tomcat brakes
down. = We manually need to restart tomcat. Right now we disabled
scheduling and = everything works fine. That tells me the problem
definitely depends on the = scheduling.
Did this ever happen to you? Do you know what the problem is? Do you
know = how we can fix it? Our OpenCMS is going online on October first.
I really need the scheduling = to stay on time.
This is really important to. If you have any hints, please help!
TIA
Bj=F6rn
--__--__--
Message: 14
From: "Alexander Kandzior" <alex at opencms.org>
To: <opencms-dev at opencms.org>
Subject: RE: [opencms-dev] how does opencms start
Date: Tue, 23 Sep 2003 09:30:37 +0200
Organization: Alexander Kandzior
Reply-To: opencms-dev at opencms.org
Don't look in the HEAD branch, look in the "branch_5_0_x" branch. The =
class in question is deleted in the HEAD.
http://www.opencms.org/cvs/viewcvs.cgi/opencms/src/com/opencms/core/Atti
c=
/Op
enCmsHttpServlet.java?only_with_tag=3Dbranch_5_0_x
Best Regards,
Alex.
Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com
> -----Original Message-----
> From: opencms-dev-admin at opencms.org=20
>[mailto:opencms-dev-admin at opencms.org] On Behalf Of Erik Itter
> Sent: Monday, September 22, 2003 11:28 PM
> To: opencms-dev at opencms.org
> Subject: Re: [opencms-dev] how does opencms start
>=20
>=20
> sorry, must be leck of sleep but my second post was wrong -=20 the
>class is not there - therefor still: where is=20
>com.opencms.core.OpenCmsHttpServlet or what am i missing? =20
> (i think i am using the correct CVS version [head], since it=20
> is the only one i can see [no versions or branches???])
>=20
> sorry for tripple posting - i'll have some sleep now
>=20
> --------------------------------------------------------------
> ------------
>=20
> ----- Original Message -----=20
> From: "Erik Itter" <erik.itter at t-online.de>
> To: <opencms-dev at opencms.org>
> Sent: Monday, September 22, 2003 11:16 PM
> Subject: Re: [opencms-dev] how does opencms start
>=20
>=20
> sometimes things solve themselfes - just checked out=20
> tonight's version, seems as if someone had deleted that class=20
> before (and a few other important ones as well, sigh)...
>=20
>=20
>=20
> ----- Original Message -----=20
> From: "Erik Itter" <erik.itter at t-online.de>
> To: <opencms-dev at opencms.org>
> Sent: Monday, September 22, 2003 11:06 PM
> Subject: [opencms-dev] how does opencms start
>=20
>=20
> hi currently trying to understand how opencms is working,
>=20
> my understanding from the web.xml was that processing=20
> requests at the servlet container opencms starts by calling=20
> com.opencms.core.OpenCmsHttpServlet.
>=20
> i cannot find that class in the project i checked out from=20
> the CVS server.
>=20
> where is the class or what am i missing?
>=20
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,=20
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>=20
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,=20
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>=20
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,=20
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>=20
>=20
--__--__--
Message: 15
From: "Mark Miller" <mark.miller at hema.ch>
To: <opencms-dev at opencms.org>
Subject: AW: [opencms-dev] opencms compared with other cms tools
Date: Tue, 23 Sep 2003 09:42:04 +0200
Reply-To: opencms-dev at opencms.org
Not sure about OpenCMS ... but here is a link I was using when I was
looking
http://www.cmsreview.com/
at the moment I would not change from OpenCMS as it has so many
possibilities. But that is just a personal choice.
All the best,
mark
-----Urspr=FCngliche Nachricht-----
Von: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org] Im Auftrag von Ove Nordstrom
Gesendet: 22 September 2003 13:43
An: opencms-dev at opencms.org
Betreff: [opencms-dev] opencms compared with other cms tools
Hi,
Anyone have read or write an report about opencms compared with other
cms tools (Episerver, polopoly, ...) I really need this information!!!
Best Regards, Ove
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev
--__--__--
Message: 16
Date: Tue, 23 Sep 2003 10:26:51 +0200
From: hermanhardenbol at zonnet.nl
To: opencms-dev at opencms.org
Subject: [opencms-dev] jsptemplates: How to S/R on element=body??
Reply-To: opencms-dev at opencms.org
Dear all,
In a JSPTemplate I would like to do a Search/Replace on the body of a=20
page, with a tag of my own, in the following way:
<my_tag:sr>
<cms:include element=3D"body"/>
</mytag:sr>
But the result of <cms:include element=3D"body/> seems to be inserted
AFT= ER=20 the JSP of the template has run. So <my_tag:sr> encounters
an empty body= .
Can anyone suggest how to do a search/replace on the element=3D"body" ?
Hope you can help me, Herman.
--=20
_____________________________________________________________________
Snel en voordelig ADSL nu voor iedereen bereikbaar.
Zon Breedband Budget vanaf EUR 14,95 per maand.
Nu tijdelijk geen aansluitkosten. Bestel snel op zonnet.nl/breedband
--__--__--
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
End of opencms-dev Digest
More information about the opencms-dev
mailing list