You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Thorsten Scherler <th...@wyona.com> on 2006/03/02 13:13:18 UTC

Implementing custom mapping for resources

Hi all,

I am looking into customizing lenya regarding the internal mapping of
assets in 1.4.

I see that in our interface ResourcesManager we define the
RESOURCES_PREFIX.
final String RESOURCES_PREFIX = "resources";

I assumed that I would set it in the DefaultResourcesManager 
ResourcesManager.RESOURCES_PREFIX = "";
but no, since we use getResourcesURI() from package
org.apache.lenya.cms.publication; 
public class Resource.

protected String getResourcesURI() {
        String resourcesUri = document.getPublication().getSourceURI() +
"/"
                + ResourcesManager.RESOURCES_PREFIX + "/" +
document.getArea() + document.getId();
        return resourcesUri;
    }

Meaning I need to implement a custom implementation of ResourcesManager,
where I will as well implement getResourcesURI().

Further since we started to make the location configurable I would
suggest to add in publication.xconf:
<resource-dir src="/home/thorsten/resources"/>

...but on the other hand I think it really would make sense to treat
resources and content as the same since resources (img, pdf,...) in the
end *are* content.

That means we just reuse <content-dir
src="/home/USERNAME/data/default"/>

wdyt?

salu2
-- 
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


Re: Implementing custom mapping for resources

Posted by Edith Chevrier <ed...@wyona.com>.
Thorsten Scherler wrote:

>Hi all,
>
>I am looking into customizing lenya regarding the internal mapping of
>assets in 1.4.
>
>I see that in our interface ResourcesManager we define the
>RESOURCES_PREFIX.
>final String RESOURCES_PREFIX = "resources";
>
>I assumed that I would set it in the DefaultResourcesManager 
>ResourcesManager.RESOURCES_PREFIX = "";
>but no, since we use getResourcesURI() from package
>org.apache.lenya.cms.publication; 
>public class Resource.
>
>protected String getResourcesURI() {
>        String resourcesUri = document.getPublication().getSourceURI() +
>"/"
>                + ResourcesManager.RESOURCES_PREFIX + "/" +
>document.getArea() + document.getId();
>        return resourcesUri;
>    }
>
>Meaning I need to implement a custom implementation of ResourcesManager,
>where I will as well implement getResourcesURI().
>
>Further since we started to make the location configurable I would
>suggest to add in publication.xconf:
><resource-dir src="/home/thorsten/resources"/>
>
>...but on the other hand I think it really would make sense to treat
>resources and content as the same since resources (img, pdf,...) in the
>end *are* content.
>
>That means we just reuse <content-dir
>src="/home/USERNAME/data/default"/>
>
>wdyt?
>
>salu2
>  
>
+1

Edith

-- 
Edith Chevrier
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                          http://lenya.apache.org
edith.chevrier@wyona.com                         edith@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Implementing custom mapping for resources

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

> Thorsten Scherler wrote:
>
> [...]
>
>> ...but on the other hand I think it really would make sense to treat
>> resources and content as the same since resources (img, pdf,...) in the
>> end *are* content.
>
>
> +1


+1

Michi

>
> -- 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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Implementing custom mapping for resources

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:

[...]

> ...but on the other hand I think it really would make sense to treat
> resources and content as the same since resources (img, pdf,...) in the
> end *are* content.

+1

-- 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: Implementing custom mapping for resources

Posted by Thorsten Scherler <th...@apache.org>.
El jue, 02-03-2006 a las 11:59 -0500, Doug Chestnut escribió:
> 
> Thorsten Scherler wrote:
> > Hi all,
> > 
> > I am looking into customizing lenya regarding the internal mapping of
> > assets in 1.4.
> > 
> > I see that in our interface ResourcesManager we define the
> > RESOURCES_PREFIX.
> > final String RESOURCES_PREFIX = "resources";
> > 
> > I assumed that I would set it in the DefaultResourcesManager 
> > ResourcesManager.RESOURCES_PREFIX = "";
> > but no, since we use getResourcesURI() from package
> > org.apache.lenya.cms.publication; 
> > public class Resource.
> > 
> > protected String getResourcesURI() {
> >         String resourcesUri = document.getPublication().getSourceURI() +
> > "/"
> >                 + ResourcesManager.RESOURCES_PREFIX + "/" +
> > document.getArea() + document.getId();
> >         return resourcesUri;
> >     }
> > 
> > Meaning I need to implement a custom implementation of ResourcesManager,
> > where I will as well implement getResourcesURI().
> > 
> > Further since we started to make the location configurable I would
> > suggest to add in publication.xconf:
> > <resource-dir src="/home/thorsten/resources"/>
> > 
> > ...but on the other hand I think it really would make sense to treat
> > resources and content as the same since resources (img, pdf,...) in the
> > end *are* content.
> > 
> > That means we just reuse <content-dir
> > src="/home/USERNAME/data/default"/>
> > 
> > wdyt?
> +1
> This would be really handy, one could have an image module, pdf module, 
> opendoc module (already exists), ..., and an asset module as a catch all 
> for other resource types.
> 
> Documents could easily be linked to as assets, Assets could easily be 
> linked to by the site nav, and we only need one system of maintaining 
> the relationships between the lot.

:)

Yeah.

I just tested by patching the ResourcesManager and setting the 
ResourcesManager.RESOURCES_PREFIX = "content";

Now all resources go into the content dir to the related document. As
well what you wrote is write about documents now being assets. 

If I go to the assets tab in the site area I now can see all files in
the content doc-id dir. :)

The only thing that is not working anymore is the display of the assets
(besides the documents). I assume that is because we have hardcoded
matches (trigger on resources) in global-sitemap and resources. :(

I am right now trying to refactor this.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Implementing custom mapping for resources

Posted by Doug Chestnut <dh...@virginia.edu>.

Thorsten Scherler wrote:
> Hi all,
> 
> I am looking into customizing lenya regarding the internal mapping of
> assets in 1.4.
> 
> I see that in our interface ResourcesManager we define the
> RESOURCES_PREFIX.
> final String RESOURCES_PREFIX = "resources";
> 
> I assumed that I would set it in the DefaultResourcesManager 
> ResourcesManager.RESOURCES_PREFIX = "";
> but no, since we use getResourcesURI() from package
> org.apache.lenya.cms.publication; 
> public class Resource.
> 
> protected String getResourcesURI() {
>         String resourcesUri = document.getPublication().getSourceURI() +
> "/"
>                 + ResourcesManager.RESOURCES_PREFIX + "/" +
> document.getArea() + document.getId();
>         return resourcesUri;
>     }
> 
> Meaning I need to implement a custom implementation of ResourcesManager,
> where I will as well implement getResourcesURI().
> 
> Further since we started to make the location configurable I would
> suggest to add in publication.xconf:
> <resource-dir src="/home/thorsten/resources"/>
> 
> ...but on the other hand I think it really would make sense to treat
> resources and content as the same since resources (img, pdf,...) in the
> end *are* content.
> 
> That means we just reuse <content-dir
> src="/home/USERNAME/data/default"/>
> 
> wdyt?
+1
This would be really handy, one could have an image module, pdf module, 
opendoc module (already exists), ..., and an asset module as a catch all 
for other resource types.

Documents could easily be linked to as assets, Assets could easily be 
linked to by the site nav, and we only need one system of maintaining 
the relationships between the lot.

> 
> salu2

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org