I my example a valid thing to do in apache sling? Because nothing there is a JCR resource node.. So I probably need to write a custom resource resolver which resolves my application urls to resources and then write a servlet which acts on these resources. The tricky bit is I do not get any support for DI the way MVC frameworks like spring-mvc or struts provide. So I need to write custom servlets for all the resources and somehow integrate with Dependency injection framework.
If I have an existing application that uses spring-mvc or struts.. There is no way to fit that on Day CQ then? On Sat, Dec 4, 2010 at 11:12 AM, Unmesh Joshi <[email protected]> wrote: > I want to try following example, which is in nutshell how our application is > > User Login And Profile > > 1. User sends a GET request to http://sample.com/login > 2. System renders a login form > I expect to write a JSP using some tag libraries. Do I put it > in /apps folder? > BTW.. where is the /apps folder in sling installation? I am > missing some very basic thing here. > 3. User makes a POST request to http://sample.com/login with her login > credentials. > 4. System validates user by comparing password in the database. > I expect to write some spring/hibernate code here to validate > user against database. How do I package that with sling? > 5. If its a valid user system sends a Redirect (HTTP 303) to > http://sample.com/profile/{userid} > How do I send redirects in sling? > 6 Browser sends a GET request to http://sample.com/profile/{userid} > (This is typical POST-REDIRECT-GET) > 7 System makes a external web service call to fetch user profile > We have a central system which stores user profiles etc. I need to > use something like CXF to make this call. > 8. System renders profile html. > > Step 8 might have some more interesting issue in our case. We might > want some part of the profile page to be content managed. So all the > profile information will come from backend system, but I want a > portion of the page to be content managed in Day CQ. > > I will get great if someone can help me understand how do I fit above > use case in sling.. > > Thanks, > Unmesh > > On Fri, Dec 3, 2010 at 2:36 PM, Vidar Ramdal (Kolibri) > <[email protected]> wrote: >> On Fri, Dec 3, 2010 at 7:50 AM, Unmesh Joshi <[email protected]> wrote: >>> I am trying to learn apache sling and have following questions to start with >>> >>> I assume that resource resolvers need to be added as OSGI bundles. >>> Where does the view part (JSPs etc) fit in? I am not clear on few >>> things yet. >>> >>> 1. One a resource is resolved by resource resolver. How the final >>> representation (HTML in our case) is rendered? Where do you place >>> actual JSPs etc? >> >> They are placed in the resource tree (either in the JCR repository) or >> as bundle resources, under /apps. >> The resource type of the requested resource is used to determine which >> script/servlet to use for rendering. >> See the Request Handling section at >> http://sling.apache.org/site/the-sling-engine.html, and especially the >> "Servlets and Scripts" page. >> >>> 2. If I have to submit some information.. How is POST handled? >> >> By default POST requests are handled by the SingPostServlet, which >> takes care of persisting the changes. >> See >> http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html >> >>> 3. How are Day CQ and Sling related? Because we are unable to get dev >>> licenses for Day CQ. Is it worth doing spikes on Apache sling and >>> assume that the same thing will fit in Day CQ? >> >> I don't work for Day, so I'll leave this to someone who can better >> answer your question. >> >>> Do we have any sample source code that you can share for these things? >> >> -- >> Vidar S. Ramdal <[email protected]> - http://www.idium.no >> Sommerrogata 13-15, N-0255 Oslo, Norway >> + 47 22 00 84 00 / +47 22 00 84 76 >> Quando omni flunkus moritatus! >> >
