You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alexander Berezhnoy <al...@splc.ru> on 2005/06/20 15:43:45 UTC

Creatable source

Hi!
Maybe, this is an Excalibur question, but I've got it because I want to 
write my own SourceFactory for my Cocoon app.

In Excalibur there are such interfaces as Source and ModifiableSource 
(if I want to modify the content of the URI).
But is there something like "CreatableSource", with method like create() ?

Thanks,
Alexander.

-- 
Alexander Berezhnoy,
Chief Architect
SmartPhone Labs, LLC
http://www.smartphonelabs.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Alexander Berezhnoy <al...@splc.ru>.
Geert Josten wrote:

That's not transparent to the user of a Source.

///

>
> Alexander Berezhnoy wrote:
>
>> Yes, but, for example, FileSource in Excalibur can't be created if 
>> the file is abscent.
>
>
> Create an empty file and open that with FileSource? (just guessing)
>
> G.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Alexander Berezhnoy,
Chief Architect
SmartPhone Labs, LLC
http://www.smartphonelabs.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Geert Josten <Ge...@daidalos.nl>.
Alexander Berezhnoy wrote:

> Yes, but, for example, FileSource in Excalibur can't be created if the 
> file is abscent.

Create an empty file and open that with FileSource? (just guessing)

G.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Alexander Berezhnoy <al...@splc.ru>.
Oooops. That's my DNA exception, I've really misread the sources.
Sorry.

///////

> Alexander Berezhnoy wrote:
>
>> Yes, but, for example, FileSource in Excalibur can't be created if 
>> the file is abscent.
>
>
> Really? I can't believe that. In fact, I've used it (via the 
> sourcewritingtransformer) to do exactly that. Excalibur wouldn't get 
> away with a 'feature' like that.
>
> What is telling you that you can't create the file? I suspect you are 
> misreading some signs.
>
> After all, all that ModifiableSource exposes really is a plain old 
> Java getOutputStream(), and there isn't much that can go wrong there.
>
> Regards, Upayavira
>
>> What can I use instead?
>> The problem is that I want to use several SourceFactories for several 
>> environments transparent to the application. i.e. I want  by the only 
>> change in the cocoon.xconf change the persistence type (from flat 
>> files to the DB and back).
>>
>> //////
>>
>>> Alexander Berezhnoy wrote:
>>>
>>>> Hi!
>>>> Maybe, this is an Excalibur question, but I've got it because I 
>>>> want to write my own SourceFactory for my Cocoon app.
>>>>
>>>> In Excalibur there are such interfaces as Source and 
>>>> ModifiableSource (if I want to modify the content of the URI).
>>>> But is there something like "CreatableSource", with method like 
>>>> create() ?
>>>
>>>
>>>
>>>
>>> Er, just open and use a ModifiableSource. Isn't that enough?
>>>
>>> Regards, Upayavira
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Alexander Berezhnoy,
Chief Architect
SmartPhone Labs, LLC
http://www.smartphonelabs.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Upayavira <uv...@odoko.co.uk>.
Alexander Berezhnoy wrote:
> Yes, but, for example, FileSource in Excalibur can't be created if the 
> file is abscent.

Really? I can't believe that. In fact, I've used it (via the 
sourcewritingtransformer) to do exactly that. Excalibur wouldn't get 
away with a 'feature' like that.

What is telling you that you can't create the file? I suspect you are 
misreading some signs.

After all, all that ModifiableSource exposes really is a plain old Java 
getOutputStream(), and there isn't much that can go wrong there.

Regards, Upayavira

> What can I use instead?
> The problem is that I want to use several SourceFactories for several 
> environments transparent to the application. i.e. I want  by the only 
> change in the cocoon.xconf change the persistence type (from flat files 
> to the DB and back).
> 
> //////
> 
>> Alexander Berezhnoy wrote:
>>
>>> Hi!
>>> Maybe, this is an Excalibur question, but I've got it because I want 
>>> to write my own SourceFactory for my Cocoon app.
>>>
>>> In Excalibur there are such interfaces as Source and ModifiableSource 
>>> (if I want to modify the content of the URI).
>>> But is there something like "CreatableSource", with method like 
>>> create() ?
>>
>>
>>
>> Er, just open and use a ModifiableSource. Isn't that enough?
>>
>> Regards, Upayavira
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Alexander Berezhnoy <al...@splc.ru>.
Yes, but, for example, FileSource in Excalibur can't be created if the 
file is abscent.
What can I use instead?
The problem is that I want to use several SourceFactories for several 
environments transparent to the application. i.e. I want  by the only 
change in the cocoon.xconf change the persistence type (from flat files 
to the DB and back).

//////

> Alexander Berezhnoy wrote:
>
>> Hi!
>> Maybe, this is an Excalibur question, but I've got it because I want 
>> to write my own SourceFactory for my Cocoon app.
>>
>> In Excalibur there are such interfaces as Source and ModifiableSource 
>> (if I want to modify the content of the URI).
>> But is there something like "CreatableSource", with method like 
>> create() ?
>
>
> Er, just open and use a ModifiableSource. Isn't that enough?
>
> Regards, Upayavira
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Alexander Berezhnoy,
Chief Architect
SmartPhone Labs, LLC
http://www.smartphonelabs.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Creatable source

Posted by Upayavira <uv...@odoko.co.uk>.
Alexander Berezhnoy wrote:
> Hi!
> Maybe, this is an Excalibur question, but I've got it because I want to 
> write my own SourceFactory for my Cocoon app.
> 
> In Excalibur there are such interfaces as Source and ModifiableSource 
> (if I want to modify the content of the URI).
> But is there something like "CreatableSource", with method like create() ?

Er, just open and use a ModifiableSource. Isn't that enough?

Regards, Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org