Hi Jonathan,

Jonathan Addison schrieb:
> Hi Andreas,
> 
> [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>   
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to