You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/05/30 23:01:56 UTC
Re: [1.4] Code in opendocument module depends on content-dir configuration
Thorsten Scherler wrote:
[...]
>> Can you remember why the condition was introduced?
>> Maybe it was a workaround for the source extension problem?
>
> Yes, it was an extension and external content dir workaround. The
> problem was when writing the code that I needed to know where to create
> the odt document.
I took a closer look at the code and didn't find any differences
to the base classes apart from the source extension. So I stripped
the class down to this, resulting in
public class CreateOpenDocument extends CreateDocument {
protected static final String ODT_EXTENSION = "odt";
protected String getSourceExtension() {
return ODT_EXTENSION;
}
}
I can create ODT documents this way. Would you mind giving it a try?
Thanks!
BTW, we should consider handling the source extension in another
way (configuration?). It's not very convenient to add a class just
for a different source extension.
And IMO the resource type shouldn't be passed from the menu item as a
request parameter, but rather be configured in cocoon.xconf.
-- Andreas
--
Andreas Hartmann
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
andreas.hartmann@wyona.com andreas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Source extensions and resource types
Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner schrieb:
[...]
>> I don't see a relation between extensions and resource types.
>
> agreed, but the resource type implementation should be able to
> initialize a NodeImplementation which
> can handle extensions.
I guess you mean that it adds extensions to the files in which
documents are stored?
Like I already mentioned, this is not possible with the current
architecture. To allow this, the document must handle meta
data, not the node. This cannot be implemented using a custom
NodeFactory, it requires changes to some classes above the
repository API.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Source extensions and resource types
Posted by so...@apache.org.
On 6/6/06, Michael Wechner <mi...@wyona.com> wrote:
> Andreas Hartmann wrote:
> > I still think that extensions should be orthogonal to resource types.
> > The extension belongs to the actual document and should be provided
> > when the document is created.
> >
> > - "image" resources can have different extensions
> > - the ".xml" or ".txt" extensions can be used by different resource types
> >
> > I don't see a relation between extensions and resource types.
>
> agreed, but the resource type implementation should be able to
> initialize a NodeImplementation which
> can handle extensions.
> >
> > The resource type's concern is how documents are handled.
> > The document's concern is how it is named.
In Lenya1.3, extensions are maintained at the Revision level.
Resource: UNID="0160", Title="websitetitle", type="file"
Translation: language="en", liveRevision="20060602075920"
Revision: UNID="20060602075920", extension="gif"
"websitetitle.gif" would display the correct file.
The expectation is the link (in documents and XSL) will be stored as
something like <LINK UNID="0160" TAG="img"/> so Lenya can replace it
with the appropriate anchor or img tag for display. That allows the
graphic Resource to be changed to "websitetitle.png" or
"websitetitle.jpg" without changing any documents or XSL.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Source extensions and resource types
Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:
> Thorsten Scherler wrote:
>
> [...]
>
>> I tested it on the default pub and another pub that was using an
>> external content dir. It works for both so I committed the changes.
>
> OK, cool!
>
>>
>> http://svn.apache.org/viewvc?rev=410503&view=rev
>>
>> Thanks for the headsup and the slim fast solution.
>
> No problem :)
>
>>> BTW, we should consider handling the source extension in another
>>> way (configuration?). It's not very convenient to add a class just
>>> for a different source extension.
>>
>> Yeah, you are totally right. Maybe it is time to talk again about the
>> register extension with resource type on a global basis.
>>
>> http://marc.theaimsgroup.com/?t=114258900800004&r=1&w=2
>>
>> wdyt?
>
> I still think that extensions should be orthogonal to resource types.
> The extension belongs to the actual document and should be provided
> when the document is created.
>
> - "image" resources can have different extensions
> - the ".xml" or ".txt" extensions can be used by different resource types
>
> I don't see a relation between extensions and resource types.
agreed, but the resource type implementation should be able to
initialize a NodeImplementation which
can handle extensions.
Michi
>
> The resource type's concern is how documents are handled.
> The document's concern is how it is named.
>
> -- Andreas
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
+41 44 272 91 61
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Source extensions and resource types (was: [1.4] Code in opendocument
module depends on content-dir configuration)
Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:
[...]
> I tested it on the default pub and another pub that was using an
> external content dir. It works for both so I committed the changes.
OK, cool!
>
> http://svn.apache.org/viewvc?rev=410503&view=rev
>
> Thanks for the headsup and the slim fast solution.
No problem :)
>> BTW, we should consider handling the source extension in another
>> way (configuration?). It's not very convenient to add a class just
>> for a different source extension.
>
> Yeah, you are totally right. Maybe it is time to talk again about the
> register extension with resource type on a global basis.
>
> http://marc.theaimsgroup.com/?t=114258900800004&r=1&w=2
>
> wdyt?
I still think that extensions should be orthogonal to resource types.
The extension belongs to the actual document and should be provided
when the document is created.
- "image" resources can have different extensions
- the ".xml" or ".txt" extensions can be used by different resource types
I don't see a relation between extensions and resource types.
The resource type's concern is how documents are handled.
The document's concern is how it is named.
-- Andreas
--
Andreas Hartmann
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
andreas.hartmann@wyona.com andreas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [1.4] Code in opendocument module depends on content-dir
configuration
Posted by Thorsten Scherler <th...@wyona.com>.
El mar, 30-05-2006 a las 23:01 +0200, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
>
> [...]
>
> >> Can you remember why the condition was introduced?
> >> Maybe it was a workaround for the source extension problem?
> >
> > Yes, it was an extension and external content dir workaround. The
> > problem was when writing the code that I needed to know where to create
> > the odt document.
>
> I took a closer look at the code and didn't find any differences
> to the base classes apart from the source extension. So I stripped
> the class down to this, resulting in
>
> public class CreateOpenDocument extends CreateDocument {
>
> protected static final String ODT_EXTENSION = "odt";
>
> protected String getSourceExtension() {
> return ODT_EXTENSION;
> }
> }
>
>
> I can create ODT documents this way. Would you mind giving it a try?
>
> Thanks!
I tested it on the default pub and another pub that was using an
external content dir. It works for both so I committed the changes.
http://svn.apache.org/viewvc?rev=410503&view=rev
Thanks for the headsup and the slim fast solution.
>
> BTW, we should consider handling the source extension in another
> way (configuration?). It's not very convenient to add a class just
> for a different source extension.
Yeah, you are totally right. Maybe it is time to talk again about the
register extension with resource type on a global basis.
http://marc.theaimsgroup.com/?t=114258900800004&r=1&w=2
wdyt?
salu2
> And IMO the resource type shouldn't be passed from the menu item as a
> request parameter, but rather be configured in cocoon.xconf.
>
> -- Andreas
>
--
Thorsten Scherler
COO Spain
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
thorsten.scherler@wyona.com thorsten@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org