|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
How to access frontEndContext from within PartEditorHello I created a part editor and want to add the site name to the URL path for building an editing form. And am now looking for a way to access frontEndContext from within a PartEditor but cannot figure out how. When I do this: Map objectModel = ContextHelper.getObjectModel(context); Is the frontEndContext to be found using any of the objects, which are to found in the objectModel... ? // request = org.apache.cocoon.environment.http.HttpRequest@8c5488 Thank you for any helpful advice. Valerie Nyre _______________________________________________ daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/support.html mail to: daisy@... list information: http://lists.cocoondev.org/mailman/listinfo/daisy |
|
|
Re: How to access frontEndContext from within PartEditorThis is what I am doing in a field editor I created that uses site name. I assume this same code would work in the part editor.
private String getSiteName() { String siteName= "null"; try { Map objectModel = ContextHelper.getObjectModel(context); HttpRequest request = ( HttpRequest ) objectModel.get("request"); SiteConf siteConf = WikiHelper.getSiteConf(request); siteName= siteConf.getName(); } catch (Exception e) { logger.error("Exception getting site name in FunctionalAreaFieldEditor.", e); } logger.info("site name from FunctionalAreaFieldEditor is " + siteName); return siteName; } According to this post http://www.nabble.com/How-to-get-collection-for-field-editor-td25285341.html you can also get the site from the document context but I did not immediately see how to get that so the WikiHelper works for me.
|
|
|
Re: How to access frontEndContext from within PartEditorYes, you can get the frontEndContext via the request. Like this:
FrontEndContext.get(request). Other than that, in the editor you can access the site via javascript, e.g. alert(daisy.site.name); HTH, Karel On Fri, Sep 11, 2009 at 2:55 PM, Lou Parisi<Lou.Parisi@...> wrote: > > This is what I am doing in a field editor I created that uses site name. I > assume this same code would work in the part editor. > > private String getSiteName() { > > String siteName= "null"; > try { > Map objectModel = ContextHelper.getObjectModel(context); > HttpRequest request = ( HttpRequest ) objectModel.get("request"); > SiteConf siteConf = WikiHelper.getSiteConf(request); > siteName= siteConf.getName(); > > } catch (Exception e) { > logger.error("Exception getting site name in > FunctionalAreaFieldEditor.", e); > } > logger.info("site name from FunctionalAreaFieldEditor is " + > siteName); > return siteName; > } > > According to this post > http://www.nabble.com/How-to-get-collection-for-field-editor-td25285341.html > you can also get the site from the document context but I did not > immediately see how to get that so the WikiHelper works for me. > > > Valerie Nyre wrote: >> >> >> Hello I created a part editor and want to add the site name to the URL >> path for building an editing form. >> >> > > -- > View this message in context: http://www.nabble.com/How-to-access-frontEndContext-from-within-PartEditor-tp25396701p25400494.html > Sent from the Daisy - General mailing list archive at Nabble.com. > > _______________________________________________ > daisy community mailing list > Professional Daisy support: http://outerthought.org/en/services/daisy/support.html > mail to: daisy@... > list information: http://lists.cocoondev.org/mailman/listinfo/daisy > daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/support.html mail to: daisy@... list information: http://lists.cocoondev.org/mailman/listinfo/daisy |
| Free embeddable forum powered by Nabble | Forum Help |