You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "Gregor J. Rothfuss" <gr...@apache.org> on 2005/03/09 16:05:34 UTC

Re: Global Asset Management

Lee Carroll wrote:

> Has anyone had experience of integrating this sort of asset library into 
> lenya??

someone sent me some prototype code he wrote to achieve some of this. 
i'd be happy to share it (although it is a far from perfect solution ;)



-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: Global Asset Management

Posted by Lee Carroll <le...@aol.com>.
Wolfgang wrote:

> Lee,
> buildDocument can throw an exception (the DocumentBuildException), see
> http://lenya.apache.org/apidocs/1.2/org/apache/lenya/cms/publication/DefaultDocumentBuilder.html#buildDocument(org.apache.lenya.cms.publication.Publication,%20java.lang.String)
>
> You must catch this exception in the xsp.
>
>
> Wolfgang

Wolfgang, I am the worlds laziest coder ever. Add this sloth with my lack of 
java and we have a receipe for a very poor question to the lenya user list. 
On re-reading my posted question (it was late) I realised that it's pretty 
awful. What I meant to ask was:
What resources are available for someone who needs to understand the lenya 
src code. Primarily to implement small customizations to the workings of the 
cms. For example I'm trying to implement a change to info/assets.xsp to 
allow the sharing of assets between pages within a publication. (See 
previous posts in the thread, basically i'm struggling with documentBuilder 
etc)

I've searched resources on the web , google, lenya site , wiki but have 
found little. The java api docs are clearly key but some concrete examples 
with discussion would be a great.

Thanks Lee C

(ps I added the exception catch!)



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


Re: Global Asset Management

Posted by "J. Wolfgang Kaltz" <ka...@interactivesystems.info>.
Lee Carroll schrieb:
 > (...)
> // start error (lines 176-176) "Unhandled exception type 
> DocumentBuildException"
>      Document globalDoc = (Document) defBuilder.buildDocument(pub, 
> "/default/authoring/globalAssetBin.html");
> 
> // end error

Lee,
buildDocument can throw an exception (the DocumentBuildException), see
http://lenya.apache.org/apidocs/1.2/org/apache/lenya/cms/publication/DefaultDocumentBuilder.html#buildDocument(org.apache.lenya.cms.publication.Publication,%20java.lang.String)

You must catch this exception in the xsp.


Wolfgang

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


Re: Global Asset Management

Posted by Lee Carroll <le...@aol.com>.
Okay I'm failing here with asset.xsp

I'm trying to hack info/asset.xsp to (just for now) display assets 
associated with a global page for all pagesin a publication.

I'm doing the following (note my java is pretty poor hence the hacking)
<!-- get globalassets as well -->
AbstractPublication pub = (AbstractPublication) <input:get-attribute 
module="page-envelope" as="object" name="publication"/>;
DefaultDocumentBuilder defBuilder = (DefaultDocumentBuilder) 
pub.getDocumentBuilder();
Document globalDoc = (Document) defBuilder.buildDocument(pub, 
"/default/authoring/globalAssetBin.html");
ResourcesManager globalResourceMgr = new ResourcesManager(globalDoc);
File[] globalResources = globalResourceMgr.getResources();


But my globalDoc fails to be created with the stack trace

org.apache.cocoon.components.language.LanguageException: Error compiling 
AuthenticAssets_xsp:
ERROR 1 (org\apache\cocoon\www\lenya\content\info\AuthenticAssets_xsp.java):
...

        (this._xsp_module_helper.getAttribute(objectModel, 
"page-envelope","publication",""))
      ;
      DefaultDocumentBuilder defBuilder = (DefaultDocumentBuilder) 
pub.getDocumentBuilder();

// start error (lines 176-176) "Unhandled exception type 
DocumentBuildException"
      Document globalDoc = (Document) defBuilder.buildDocument(pub, 
"/default/authoring/globalAssetBin.html");

// end error
      ResourcesManager globalResourceMgr = new ResourcesManager(globalDoc);
      File[] globalResources = globalResourceMgr.getResources();



...

I'm sure i'm doing something horribly wrong if anyone can putme right I'd be 
very gratefull

Lee C



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


Re: Global Asset Management

Posted by Lee Carroll <le...@aol.com>.
> 
> someone sent me some prototype code he wrote to achieve some of this. 
> i'd be happy to share it (although it is a far from perfect solution ;)
> 
> 
> 
> -- 
> Gregor J. Rothfuss

Hello Gregor,

Yes I'd be interested in this code!

I've began to hack the info/assets.xsp to list not only the local resorces for a particular page, but also the resources for a "hardcoded" global resources page.
However I'm struggling with working with the Document obj. I can't seem to replicate the magic of
Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;

for the global resources document. Any hints would be greatly appreciated

Cheers Lee C