cancel
Showing results for 
Search instead for 
Did you mean: 

jsp site

gidion
Champ in-the-making
Champ in-the-making
Hi,

We have a JSP site.
We want this site to link with wcm content features.

We need the admin interface to be easy to use so people can create specific content items (profiles) which will then always be pulled into the same jsp page.
we need a similar feature for advice pages.

we also need the structure of the tree that leads to advice pages to form the structure of links (so spaces and files becomes links).

We need these advice and profile pages to be searchable via the website too.

What is the best solution for this?

We have seen how xslt or freemarker can be used to wrap around content but we want to be able to link our content items to specific jsp templates.
Ie profiles goto jsp template 1 and advice items goto jsp template 2.

Do we create the templates in wcm and then link these to content items within a specific space (ie. so that new content created in that space uses the template specified) or do we put code within the jsp pages to always look for its content in the same space (ie. working from the coed side).

Thanks,
Luke
7 REPLIES 7

gundakiran
Champ in-the-making
Champ in-the-making
Hi, I also have very similar requirement.. I have Struts2 site based on JSPs, but I want to control all the static content, and uploading/downloading the documents through Afresco.. Any pointers greatly appreciated..

Thanks
Kiran

gidion
Champ in-the-making
Champ in-the-making
Hi,

I have been reading documents until my eyes bleed.   :shock:

We have decided to use a jsp page to call in a ftl template as and where we need it in the page.
This ftl template will specify a very simple layout (width height) and populate with the "content" of the content type.

My confusion lies with the forms.
The ftl specifies which properties of the content type you require so where do forms come into play?
I know that in the WCM when i have a form i can then create content within that form.

So…. are the form and the ftl one and the same thing or are the content and the form one and the same (ie. the form wraps the content type).

a simple diagram (as best as i can do here):

JSP —-pulls in—-> FTL ——references——>CONTENT TYPE

where does the FORM go?


Another question is. When i create a content type of profile page (a default type i made) outside of the WCM (ie. in normal spaces) after creating the content my default meta-data fields are displayed ready for population.
When i click create (next to a form element within WCM) it allows me to create the content but my meta-data fields are then not displayed for population. Any ideas why this is and how i can resolve this?

Thanks in advance for anyone who tackles this large ramble Smiley Happy

gidion
Champ in-the-making
Champ in-the-making
After some more looking it seems the form (xsd) holds meta data fields itself.
If this is the case then what is the benefit of pulling in different content types into a form?  
Should i instead just be pulling the default content type in and creating all meta data within the forms?  As a result this would mean instead of multiple content types (to deal with difrerent meta-data requirements) i would need to build multiple forms……

Any clarification would be great.

Thanks,
Luke


ps. If i do have to create my new meta-data requirements as forms then can forms also deal with contraints (ie. so that i can build up a list that will populate a drop down menu item)?

kvc
Champ in-the-making
Champ in-the-making
Luke:


Awesome.

Actually, I'd recommend one change to your approach:  I would have the JSP page callout to a web script, which can execute any server-side Javascript to marshall the data you need and then use a Freemarker template to generate the output.  This is the direction we'll be taking for our library of pre-built web components (of course, what you are doing is just fine too).

For your other questions:

*  A Web Form is a defined type managed within the Data Dictionary.  A
    Web Form is an XSD we use to generate on-the-fly an XForm for data
    capture; it is associated with 0 to n output templates (for static content
    pre-compilation).  Web Forms are subscribed to by one or more
    Web Projects, which customize the Web Form for use as part of their
    site (what templates to apply, what workflow rules to enforce, etc.)

*  A Web Form accessed in a Web Project is designed to solely generate
    XML.  That generated XML should include both your content and
    your metadata.  If you have common metadata across XSDs, you can
    use an xs:include to have shared metadata definition across all your
    content types.

*  In your case, you are not statically pre-compiling any pages or
    fixed assets (other XML flavors or a PDF).   Thus, the Freemarker
    template you call directly from your web page (or ideally via a
    web script) is responsible for generating your content dynamically
    at run-time.

If you do use web scripts, do note our new support in 2.1.0 Community Final for indexing specific field and metadata values from within an XML using an XMLMetadataExtractor.  This enables data within the XML itself to be queryable via our Lucene Search index.  You'll also want to browse up on Web Scripts in general, our JavaScript and Templating API, and our XMLMetadataExtractor support.

Cheers.  Keep us posted of your progress!


Kevin

gidion
Champ in-the-making
Champ in-the-making
Hi Kevin

Thanks for the lengthy reply.

Is it possible to pull back the content just as an array of values or would i need to pull back an xml file and then decipher that file back within my jsp page?

Ie. Do we need the .ftl file to complete this process or is it possible to use a GET <url> call within my jsp to retrieve the data (by triggering the webscript/javascript and returning the model (results) direct.

Am i correct in thinking the way we would call these webscripts from our jsp pages would be to use:
GET http://mydomain.me.com/alfresco/services/uniqueID
This way there is no page refreshing and no user link clicking needed.

The result stream that is then returned is dealt with and displayed in the same jsp page.


Thanks,
Luke

kvc
Champ in-the-making
Champ in-the-making
Luke:


Yes, in this case, your Javascript would simple fetch the node (store.lookupNode(path)), and then your Freemarker template would simply write out the content of that node, in this case, as XML (document.content).

With a web script, you will always need a Freemarker template to write out the response to return to the browser.  In this case, however, the response is very simple:  you just stream out content associated with the node.

Hope that helps.

Kevin

gidion
Champ in-the-making
Champ in-the-making
Thanks again Kevin,

Very helpful indeed.

Cheers,
Luke