You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Dan Stromberg <ds...@gmail.com> on 2007/12/14 00:43:08 UTC
Automatic addition of and modification to Lenya pages?
I have an established lenya CMS to work with. I need to update it semi-
regularly with new information that is pretty similar.
The click-click-paste-click-click-paste-click-click-click thing is
getting kind of old.
Is there an automatic way I can add new pages and modify preexisting
pages?
Our lenya server is running on a Linux host, if it matters.
I found a directory that contains the pages I want to add to - can I just
stick some fresh HTML in there from a bash or python script, and find
where it's linked from and modify that with some sort of HTML parser
(probably from python)? Or do I need to study a bunch of stuff first and
work in java and/or XSLT? If I make changes to the HTML directly, will
they be lost next time someone uses the CMS via a browser?
If somebody has an example of doing something that's similar to this,
that'd get me going quickly. Java (and XSLT?) would be fine.
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Automatic addition of and modification to Lenya pages?
Posted by Dan Stromberg <ds...@gmail.com>.
On Fri, 14 Dec 2007 15:45:11 +0100, Andreas Hartmann wrote:
> Hi Dan,
>
> Dan Stromberg schrieb:
>> I have an established lenya CMS to work with. I need to update it
>> semi- regularly with new information that is pretty similar.
>
> I assume you are using Lenya 1.2.x?
Yes, lenya 1.2.5.
>> The click-click-paste-click-click-paste-click-click-click thing is
>> getting kind of old.
>>
>> Is there an automatic way I can add new pages and modify preexisting
>> pages?
>
> There is no standard mechanism, but this is a quite typical usage
> scenario. Basically there are two approaches:
>
> (a) use the Lenya API to import the documents (b) modify the repository
> directly
>
> Approach (a) should be preferred in virtually any cases, since (b) has
> many drawbacks. You have to
>
> - be absolutely familiar with the storage internals - update your code
> when the storage internals change - shutdown the application to avoid
> concurrent modification issues
>
> If you modify existing documents, you bypass the versioning, workflow
> etc. which will lead to inconsistent states of the documents.
>
> Especially if you want to run the import while the server is running,
> I'd strongly recommend to implement it using the Java API, properly
> checking out the involved documents etc.
OK, I think approach (a) sounds much better then, though it'd probably be
quicker for me in the short term to do approach (b).
>> Our lenya server is running on a Linux host, if it matters.
>>
>> I found a directory that contains the pages I want to add to - can I
>> just stick some fresh HTML in there from a bash or python script, and
>> find where it's linked from and modify that with some sort of HTML
>> parser (probably from python)? Or do I need to study a bunch of stuff
>> first and work in java and/or XSLT? If I make changes to the HTML
>> directly, will they be lost next time someone uses the CMS via a
>> browser?
>>
>> If somebody has an example of doing something that's similar to this,
>> that'd get me going quickly. Java (and XSLT?) would be fine.
>
> Lenya 2.0-dev contains some code which imports external data. It can't
> be ported to 1.2.x without changes, but maybe it helps to get started:
>
> http://svn.apache.org/viewvc/lenya/trunk/src/modules/export/java/src/
org/apache/lenya/cms/export/Importer.java?view=log
Backporting that sounds more time consuming than what I was hoping for.
Does anyone have an example of automatic document addition and automatic
document modification with 1.2.x?
Thanks for the response. :)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Automatic addition of and modification to Lenya pages?
Posted by Andreas Hartmann <an...@apache.org>.
Hi Dan,
Dan Stromberg schrieb:
> I have an established lenya CMS to work with. I need to update it semi-
> regularly with new information that is pretty similar.
I assume you are using Lenya 1.2.x?
> The click-click-paste-click-click-paste-click-click-click thing is
> getting kind of old.
>
> Is there an automatic way I can add new pages and modify preexisting
> pages?
There is no standard mechanism, but this is a quite typical usage
scenario. Basically there are two approaches:
(a) use the Lenya API to import the documents
(b) modify the repository directly
Approach (a) should be preferred in virtually any cases, since (b) has
many drawbacks. You have to
- be absolutely familiar with the storage internals
- update your code when the storage internals change
- shutdown the application to avoid concurrent modification issues
If you modify existing documents, you bypass the versioning, workflow
etc. which will lead to inconsistent states of the documents.
Especially if you want to run the import while the server is running,
I'd strongly recommend to implement it using the Java API, properly
checking out the involved documents etc.
> Our lenya server is running on a Linux host, if it matters.
>
> I found a directory that contains the pages I want to add to - can I just
> stick some fresh HTML in there from a bash or python script, and find
> where it's linked from and modify that with some sort of HTML parser
> (probably from python)? Or do I need to study a bunch of stuff first and
> work in java and/or XSLT? If I make changes to the HTML directly, will
> they be lost next time someone uses the CMS via a browser?
>
> If somebody has an example of doing something that's similar to this,
> that'd get me going quickly. Java (and XSLT?) would be fine.
Lenya 2.0-dev contains some code which imports external data. It can't
be ported to 1.2.x without changes, but maybe it helps to get started:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Importer.java?view=log
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org