Hi Arjan,
On May 2, 2010, at 17:31, Arjan wrote: > > > Hi all, > > I am surely missing something obvious, but I am still trying to figure out > what is the best/cleanest way to hook my Java controllers into Magnolia. > > >> I've seen info.magnolia.module.admininterface.PageMVCHandler being (a)bused > > As for "abuse" versus "good use" of PageMVCHandler: > > I just noticed that AbstractUserRegistrationPage [1] in the Public User > Registration module also uses that class. So, maybe that *is* a supported way > to create a controller? So: despite of it being part of package > "admininterface", and despite the need to grant anonymous visitors access to > URI paths such as "/.magnolia/pages/password-reminder*", > "/.magnolia/pages/user-validation*" and "/.magnolia/pages/register*"? Yes, that's generic mvc-ish mechanism you can use; it's been introduced first in the admininterface module a long time ago, hence the package name; and yes, that requires tweaking the anonymous role if this needs to be available for anonymous users. > > >> with Magnolia 4.3 is allowed requests to paragraphs (snipped/ajax) >> in terms that URI to a paragraph renders the paragraph (without any >> page rendering) by extending the AggregatorFilter > > Any hint about how to get started with that? In the pre-4.3.x "Filters" at > http://documentation.magnolia-cms.com/reference/filters.html#AggregatorFilter > I see the filter listed, but I can't find anything in Magnolia core that > seems to act on derived classes. > > Or: maybe all I need to know is the URL through which I can request a > paragraph directly? Example: http://demopublic.magnolia-cms.com/demo-project/about/subsection-articles/article/extras/extras1/0.html Wether it "works" or not is highly dependent on the paragraph being rendered of course: this fails miserably because it depends on the parent (the page) being rendered too: http://demoauthor.magnolia-cms.com/demo-project/about/subsection-articles/article/main/00.html > Forgotten in my earlier list: > > 5- I see examples such as "Magnolia and Axis" at > http://wiki.magnolia-cms.com/display/WIKI/Magnolia+and+Axis that hook their > own filter servlet into the chain. That's fine, but it sounds like the 4.3 > release notes claim such is no longer needed? It really depends how much and what you want to do. For simple rendered content retrieval, getting the url right is enough. (provided your templates support it). If you need other things, a filter, or simpler yet, a servlet can be enough: For a simple example, register this servlet under /server/filters/servlets: http://pastebin.com/SAU9eJc1 (or, to be complete: either register it before the cache filter, or add it's mapped url to the deny list of the cache configuration) ... and this bit to your templates: http://pastebin.com/2U8xWZmK HTH, -g > > Thanks! > Arjan. > > [1] > http://dev.magnolia-cms.com/modules/magnolia-module-public-user-registration/1.1.2/magnolia-module-public-user-registration/apidocs/info/magnolia/module/publicuserregistration/frontend/AbstractUserRegistrationPage.html > > > > On Apr 26, 2010, at 10:59 PM, Arjan wrote: > >> >> >> The 4.3 release notes at >> http://documentation.magnolia-cms.com/releases/4-3.html state: >> >>> Paragraphs can be rendered independently via the URL; opens >>> door for integration with other systems by allowing to get and >>> render content snippets. (Ajax, REST, ...) >> >> A comment at that page also claims: >> >>> with Magnolia 4.3 is allowed requests to paragraphs (snipped/ajax) >>> in terms that URI to a paragraph renders the paragraph (without any >>> page rendering) by extending the AggregatorFilter >> >> That makes me wonder about best practices for server-side Ajax controllers >> (for magnoliaPublic). >> >> 1- I've seen JSPs being put in the document root, to be invoked by Ajax >> calls (just like at >> http://wiki.magnolia-cms.com/display/WIKI/Add+Magnolia+MainBar+functionalities+with+Ajax >> ). >> >> 2- In 4.2.3, one can create pure Java controllers using Blossom, but as far >> as I know this still requires one to include a Blossom-managed Paragraph in >> some dummy page, to get a URL one can actually invoke (a bit like described >> at http://www.mail-archive.com/[email protected]/msg00165.html ). >> >> 3- I've seen info.magnolia.module.admininterface.PageMVCHandler being >> (a)bused (in combination with relaxing the Anonymous Role to allow web site >> visitors requesting some "/.magnolia/pages/myAjaxResponder" URL). >> >> 4- I've tried to use plain Spring MVC, but even when adding bypasses (to >> Configuration, server, filters, cms), my controller just doesn't get invoked >> (though I can see Spring registering the URL I specified using @Controller >> and @RequestMapping). >> >> Any ideas on the best or better ways to do this? >> >> Thanks again, >> Arjan. >> ---------------------------------------------------------------- >> For list details see >> http://www.magnolia-cms.com/home/community/mailing-lists.html >> To unsubscribe, E-mail to: <[email protected]> >> ---------------------------------------------------------------- >> > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
