You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/11/26 14:28:17 UTC
svn commit: r479357 -
/lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
Author: andreas
Date: Sun Nov 26 05:28:17 2006
New Revision: 479357
URL: http://svn.apache.org/viewvc?view=rev&rev=479357
Log:
Always use example content from default pub
Modified:
lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
Modified: lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java?view=diff&rev=479357&r1=479356&r2=479357
==============================================================================
--- lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java (original)
+++ lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java Sun Nov 26 05:28:17 2006
@@ -21,6 +21,7 @@
import org.apache.lenya.cms.cocoon.source.SourceUtil;
import org.apache.lenya.cms.publication.Area;
+import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationException;
import org.apache.lenya.cms.publication.URLInformation;
import org.apache.lenya.cms.usecase.AbstractUsecase;
@@ -32,8 +33,14 @@
protected void initParameters() {
super.initParameters();
- Area area = getArea();
- String pubPath = area.getPublication().getDirectory().getAbsolutePath();
+
+ Publication defaultPub;
+ try {
+ defaultPub = getDocumentFactory().getPublication("default");
+ } catch (PublicationException e) {
+ throw new RuntimeException(e);
+ }
+ String pubPath = defaultPub.getDirectory().getAbsolutePath();
String path = pubPath.replace(File.separatorChar, '/') + "/example-content";
setParameter("path", path);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org
Re: svn commit: r479357 - /lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
Posted by Andreas Hartmann <an...@apache.org>.
Hi Jonathan,
Jonathan Addison schrieb:
> Hi Andreas,
>
> andreas@apache.org wrote:
>> Author: andreas
>> Date: Sun Nov 26 05:28:17 2006
>> New Revision: 479357
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=479357
>> Log:
>> Always use example content from default pub
>>
>
> Are there any plans to extend this to work with custom pubs at some point?
the functionality is quite generic, the only thing specific to the
default publication is the initial directory where the content to
import is located.
The export functionality is still completely missing, but I think
this is not too hard to implement. But since I don't need it, I
won't spend time on it ATM :)
-- Andreas
>
> Jonathan
>
>> Modified:
>>
>> lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
>>
>>
>> Modified:
>> lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
>>
>> URL:
>> http://svn.apache.org/viewvc/lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java?view=diff&rev=479357&r1=479356&r2=479357
>>
>> ==============================================================================
>>
>> ---
>> lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
>> (original)
>> +++
>> lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
>> Sun Nov 26 05:28:17 2006
>> @@ -21,6 +21,7 @@
>>
>> import org.apache.lenya.cms.cocoon.source.SourceUtil;
>> import org.apache.lenya.cms.publication.Area;
>> +import org.apache.lenya.cms.publication.Publication;
>> import org.apache.lenya.cms.publication.PublicationException;
>> import org.apache.lenya.cms.publication.URLInformation;
>> import org.apache.lenya.cms.usecase.AbstractUsecase;
>> @@ -32,8 +33,14 @@
>>
>> protected void initParameters() {
>> super.initParameters();
>> - Area area = getArea();
>> - String pubPath =
>> area.getPublication().getDirectory().getAbsolutePath();
>> + + Publication defaultPub;
>> + try {
>> + defaultPub = getDocumentFactory().getPublication("default");
>> + } catch (PublicationException e) {
>> + throw new RuntimeException(e);
>> + }
>> + String pubPath = defaultPub.getDirectory().getAbsolutePath();
>> String path = pubPath.replace(File.separatorChar, '/') +
>> "/example-content";
>> setParameter("path", path);
>> }
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: commits-help@lenya.apache.org
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r479357 - /lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
Posted by Jonathan Addison <jo...@wyona.com>.
Hi Andreas,
andreas@apache.org wrote:
> Author: andreas
> Date: Sun Nov 26 05:28:17 2006
> New Revision: 479357
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=479357
> Log:
> Always use example content from default pub
>
Are there any plans to extend this to work with custom pubs at some point?
Jonathan
> Modified:
> lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
>
> Modified: lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java
> URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java?view=diff&rev=479357&r1=479356&r2=479357
> ==============================================================================
> --- lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java (original)
> +++ lenya/trunk/src/modules/export/java/src/org/apache/lenya/cms/export/Import.java Sun Nov 26 05:28:17 2006
> @@ -21,6 +21,7 @@
>
> import org.apache.lenya.cms.cocoon.source.SourceUtil;
> import org.apache.lenya.cms.publication.Area;
> +import org.apache.lenya.cms.publication.Publication;
> import org.apache.lenya.cms.publication.PublicationException;
> import org.apache.lenya.cms.publication.URLInformation;
> import org.apache.lenya.cms.usecase.AbstractUsecase;
> @@ -32,8 +33,14 @@
>
> protected void initParameters() {
> super.initParameters();
> - Area area = getArea();
> - String pubPath = area.getPublication().getDirectory().getAbsolutePath();
> +
> + Publication defaultPub;
> + try {
> + defaultPub = getDocumentFactory().getPublication("default");
> + } catch (PublicationException e) {
> + throw new RuntimeException(e);
> + }
> + String pubPath = defaultPub.getDirectory().getAbsolutePath();
> String path = pubPath.replace(File.separatorChar, '/') + "/example-content";
> setParameter("path", path);
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
> For additional commands, e-mail: commits-help@lenya.apache.org
>
>
>
--
Jonathan Addison jon<at>wyona.com
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org