You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Pankaj Mandaliya <pa...@gmail.com> on 2008/07/10 12:28:00 UTC

Lenya customization - split main region area into two

Hi All,

I am new to lenya and XML world, but comfortable in Java.

Just recently, I have started exploring Lenya. Initially I found it a bit
difficult, but after going through online demo on Apache lenya site, I
started feeling comfortable somewhat.
Still technically, it is somewhat difficult. I need some guidance/help from
you who can help me in customizing the layouts.

In Lenya, we have the main body region, where we create XHTML document in
authoring mode and create articles. I want to create article which contains
a link, and clicking on this link, that article should be divided into two
separate parts. Here left part will still contain original document, and the
right part will contain the article referenced by left side document.

If in my article, there are some difficult words, which requires some
explanation, then instead of redirecting user to another page for that
word-reference-link, I want to present that information on the same page, by
splitting the original page into two and word reference information on the
right side. And I want my user to build such pages and create
word-reference-link like this.

I understand a bit of Cocoon architecture, and think that it should be
possible by using some kind of Transformer. Can you provide me reference to
such article or provide some guideline for achieving this.

I have download Lenya 2.0 and installed on local machine. Still I am getting
some error. It says contact System administrator, but does not give me
detail of the error. Even not available in the log4j log file. Which version
is currently stable for Lenya?

I am all ears to learn about Lenya!

Thanks,
 Pankaj

Re: Lenya customization - split main region area into two

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2008-07-10 at 15:58 +0530, Pankaj Mandaliya wrote:
> Hi All,

Please do not crosspost!

This kind of question should be ask on the user list (and only there). 

salu2

> 
> I am new to lenya and XML world, but comfortable in Java.
> 
> Just recently, I have started exploring Lenya. Initially I found it a
> bit difficult, but after going through online demo on Apache lenya
> site, I started feeling comfortable somewhat.
> Still technically, it is somewhat difficult. I need some guidance/help
> from you who can help me in customizing the layouts.
> 
> In Lenya, we have the main body region, where we create XHTMLdocument
> in authoring mode and create articles. I want to create article which
> contains a link, and clicking on this link, that article should be
> divided into two separate parts. Here left part will still contain
> original document, and the right part will contain the article
> referenced by left side document. 
> 
> If in my article, there are some difficult words, which requires some
> explanation, then instead of redirecting user to another page for that
> word-reference-link, I want to present that information on the same
> page, by splitting the original page into two and word reference
> information on the right side. And I want my user to build such pages
> and create word-reference-link like this.
> 
> I understand a bit of Cocoon architecture, and think that it should be
> possible by using some kind of Transformer. Can you provide me
> reference to such article or provide some guideline for achieving
> this.
> 
> I have download Lenya 2.0 and installed on local machine. Still I am
> getting some error. It says contact System administrator, but does not
> give me detail of the error. Even not available in the log4j log file.
> Which version is currently stable for Lenya?
> 
> I am all ears to learn about Lenya!
> 
> Thanks,
> Pankaj
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


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


Re: Lenya customization - split main region area into two

Posted by Andreas Hartmann <an...@apache.org>.
Hi Pankaj,

Pankaj Mandaliya schrieb:

[…]

> My actual requirement is to display the page in splitted area when the 
> link for it is coming from main page. This glossary type page is 
> actually not as small as glossary, but itself is an another page, which 
> may be generated by CMS user as a new small article. I am planning to 
> put these reference articles under a separate folder. This folder will 
> not be visible in the navigation links, when the site is live.
> 
> Now when user/editor creates the link from this special folder, it 
> should create the link for the current page by adding some parameter to 
> url generated for the link saying that - split the page and in splitted 
> page, display the article for which the user has created the link.
> 
> So, there are two main things.
> 1) When link is created in editor, it should put some parameter in link 
> creation, such that when its clicked, we can identify that.
> 2) When such link is pressed, we should know what is requested and do 
> the necessary action.

how about this?

The author designates the term in the editor using some special markup. 
In XHTML, this could be for instance

   <span class="glossaryTerm">Foo</span>

An XSLT replaces the <span> with a link:

   <a href="lenya-document:?glossaryTerm=Foo">Foo</a>

Another XSLT checks for the glossaryTerm request parameter and includes 
the glossary document accordingly (in the example the node name is the 
same as the term, you'd have to find a convention for spaces and other 
special characters):

   <xsl:if test="$glossaryTerm != ''">
     <div class="glossaryColumn">
       <ci:include src="site:/{$lang}/glossary/$glossaryTerm"/>
     </div>
   </xsl:if>


HTH,

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


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


Re: Lenya customization - split main region area into two

Posted by Pankaj Mandaliya <pa...@gmail.com>.
Hi Andreas,

Thanks a lot for helpful reply! I will try your suggestion.

My actual requirement is to display the page in splitted area when the link
for it is coming from main page. This glossary type page is actually not as
small as glossary, but itself is an another page, which may be generated by
CMS user as a new small article. I am planning to put these reference
articles under a separate folder. This folder will not be visible in the
navigation links, when the site is live.

Now when user/editor creates the link from this special folder, it should
create the link for the current page by adding some parameter to url
generated for the link saying that - split the page and in splitted page,
display the article for which the user has created the link.

So, there are two main things.
1) When link is created in editor, it should put some parameter in link
creation, such that when its clicked, we can identify that.
2) When such link is pressed, we should know what is requested and do the
necessary action.
I do not have much idea for these areas.

Appreciate any help in this regard.
Hope I am making myself clear.

Thanks,
Pankaj

On Thu, Jul 10, 2008 at 6:03 PM, Andreas Hartmann <an...@apache.org>
wrote:

> Hi Pankaj,
>
> Pankaj Mandaliya schrieb:
>
> […]
>
>  In Lenya, we have the main body region, where we create XHTML document in
>> authoring mode and create articles. I want to create article which contains
>> a link, and clicking on this link, that article should be divided into two
>> separate parts. Here left part will still contain original document, and the
>> right part will contain the article referenced by left side document.
>>
>> If in my article, there are some difficult words, which requires some
>> explanation, then instead of redirecting user to another page for that
>> word-reference-link, I want to present that information on the same page, by
>> splitting the original page into two and word reference information on the
>> right side. And I want my user to build such pages and create
>> word-reference-link like this.
>>
>
> so you want to maintain a glossary? I'd recommend something like this:
>
> - Use a glossary document containing all terms and explanations, e.g.
>
>  <g:glossary xmlns:g="http://myproject.org/lenya/glossary/1.0">
>    <g:term name="foo">
>      … Explanation of foo …
>    </g:term>
>    …
>  </g:glossary>
>
> - Use links like lenya-document:?glossaryTerm=foo to call the same page
> with a glossary column
>
> - Use an XSLT stylesheet to include the corresponding glossary entry
>
>  <xsl:if test="$glossaryTerm != ''">
>    <div class="glossaryColumn">
>      <ci:include src="site:/{$lang}/glossary"
>        select="/g:glossary/g:term[@name = $glossaryTerm]/node()"/>
>    </div>
>  </xsl:if>
>
>
>  I understand a bit of Cocoon architecture, and think that it should be
>> possible by using some kind of Transformer. Can you provide me reference to
>> such article or provide some guideline for achieving this.
>>
>> I have download Lenya 2.0 and installed on local machine. Still I am
>> getting some error. It says contact System administrator, but does not give
>> me detail of the error.
>>
>
> You find the error message in the page HTML (use "view source" in the
> browser).
>
>  Even not available in the log4j log file.
>>
>
>  Which version is currently stable for Lenya?
>>
>
> The stable version is 2.0.1 (at the moment only available via SVN).
>
> HTH,
>
> -- Andreas
>
> --
> Andreas Hartmann, CTO
> BeCompany GmbH
> http://www.becompany.ch
> Tel.: +41 (0) 43 818 57 01
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>


-- 
----
Pankaj

Re: Lenya customization - split main region area into two

Posted by Andreas Hartmann <an...@apache.org>.
Hi Pankaj,

Pankaj Mandaliya schrieb:

[…]

> In Lenya, we have the main body region, where we create XHTML document 
> in authoring mode and create articles. I want to create article which 
> contains a link, and clicking on this link, that article should be 
> divided into two separate parts. Here left part will still contain 
> original document, and the right part will contain the article 
> referenced by left side document.
> 
> If in my article, there are some difficult words, which requires some 
> explanation, then instead of redirecting user to another page for that 
> word-reference-link, I want to present that information on the same 
> page, by splitting the original page into two and word reference 
> information on the right side. And I want my user to build such pages 
> and create word-reference-link like this.

so you want to maintain a glossary? I'd recommend something like this:

- Use a glossary document containing all terms and explanations, e.g.

   <g:glossary xmlns:g="http://myproject.org/lenya/glossary/1.0">
     <g:term name="foo">
       … Explanation of foo …
     </g:term>
     …
   </g:glossary>

- Use links like lenya-document:?glossaryTerm=foo to call the same page 
with a glossary column

- Use an XSLT stylesheet to include the corresponding glossary entry

   <xsl:if test="$glossaryTerm != ''">
     <div class="glossaryColumn">
       <ci:include src="site:/{$lang}/glossary"
         select="/g:glossary/g:term[@name = $glossaryTerm]/node()"/>
     </div>
   </xsl:if>


> I understand a bit of Cocoon architecture, and think that it should be 
> possible by using some kind of Transformer. Can you provide me reference 
> to such article or provide some guideline for achieving this.
> 
> I have download Lenya 2.0 and installed on local machine. Still I am 
> getting some error. It says contact System administrator, but does not 
> give me detail of the error.

You find the error message in the page HTML (use "view source" in the 
browser).

> Even not available in the log4j log file. 

> Which version is currently stable for Lenya?

The stable version is 2.0.1 (at the moment only available via SVN).

HTH,

-- Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


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


Re: Lenya customization - split main region area into two

Posted by Pankaj Mandaliya <pa...@gmail.com>.
Thanks a lot Andreas and Solprovider,

You have given very vital information.
Basically, my glossary is not as small as word definition, it can have some
explanation with graph for the keywords and more details, and it (link) has
to be controlled by editor the page. But, I would try out based on your
responses.
Currently, I got stuck with other activities, will let you know what I tried
out and if something useful comes out of it.

Thanks again,
Pankaj

On Sat, Jul 12, 2008 at 2:02 AM, <so...@apache.org> wrote:

> On 7/10/08, Pankaj Mandaliya <pa...@gmail.com> wrote:
> >  In Lenya, we have the main body region, where we create XHTML document
> in
> > authoring mode and create articles. I want to create article which
> contains
> > a link, and clicking on this link, that article should be divided into
> two
> > separate parts. Here left part will still contain original document, and
> the
> > right part will contain the article referenced by left side document.
> >
> >  If in my article, there are some difficult words, which requires some
> > explanation, then instead of redirecting user to another page for that
> > word-reference-link, I want to present that information on the same page,
> by
> > splitting the original page into two and word reference information on
> the
> > right side. And I want my user to build such pages and create
> > word-reference-link like this.
> >  Pankaj
>
> For any functionality, start with the desired results.  Prototyping
> this functionality in HTML with a few definitions specifies the HTML
> and Javascript before creating the XMAP and XSLTs to integrate with
> Lenya.  Most of this post applies to any Web application.  Decide what
> the page should contain, then teach the system how to create that
> page.
>
> You want:
> 1. Words (links) that activate definitions.
> 2. A place to show the definitions.
>
> In ancient history (mid-1990s), this would be handled with FRAMEs.
> This method is highly discouraged today as ugly and
> less-than-user-friendly.  The rest of this post ignores this method
>
> Methods for showing the definitions:
> 1. HTML-only: Clicking a link refreshes the page with the definition shown.
> 2. Javascript: Clicking a link displays the definition without
> refreshing the page.
> 3. Javascript MouseOver: Show the definition when the mouse is over a
> highlighted word.
>
> Places to show the definition:
> 1. Defined area of page.
> 2. Defined area of page offset from current top of screen so the
> definition is forced into the viewable area.
> 3. In-page popup near the linked word, usually slightly below the
> word.  Best used with MouseOver triggering method.
>
> Methods for deciding glossary words:
> 1. Require the content editor to add links.
> 2. Use XSL to make every word found in the glossary into a link.
> 3. Use XSL to make the first occurrence of each word in the glossary
> found in the content body into a link.
> 4. Use JavaScript to make every word in the glossary into a link.
> 5. Use Javascript to make the first occurrence of each word in the
> glossary into a link.
>
> Creating the links can be handled by XSL or JavaScript.  XSL is better
> if editors must choose the words to become links.  Automating the
> process can use either method.  JavaScript's advantage is less
> server-side processing offset by more development and support work
> because Javascript often has browser-specific issues.  Using XSL
> requires one additional Transformation; using cache should remove any
> effect on performance.
>
> I discourage asking content editors to specify on each page where
> links to the glossary belong -- if they know a definition is needed,
> they should include the definition in the text.  Automating the
> process has several benefits:
> - New terms are used without editing existing content.
> - Content editors can ignore defining difficult terms on every page,
> - Content editors do not need to check whether a word is in the
> glossary while editing.  Publishing the page shows which terms are in
> the glossary.  Returning to the first benefit, adding a new term
> automatically updates the page without additional work
>
> Lenya-based technical methods for adding definition(s) to page:
> 1. For the HTML-only method, the linked word would probably be in the
> querystring.  Lenya looks up the word in the glossary and aggregates
> the definition into the page.  The same code should be used with or
> without the definition -- aggregate an empty definition when no word
> is specified in the querystring.
> 2. For other methods, all definitions need to be included with every
> page.  Now choose whether the content is presented as a DIV or set by
> Javascript:
> A. <div id="glossary-myword">"myword" is a word in the glossary</div>
> B. glossaryObject['myword'] = '"myword" is a word in the glossary.';
> The former is better when the DIV has a static location, just hide the
> previous DIV with display="none" and show the desired DIV with
> display="block" (or "inline".)
> The latter is better for dynamically creating the DIV with Javascript.
>
> Lenya can dynamically create the glossary when creating each page.
> Better performance is gained by updating a cached glossary pagelet
> when a glossary document is created or changed -- saving a definition
> updates a separate document aggregating all the definitions so normal
> page creation only aggregates that page.
>
> Maintenance of the glossary should be separated from maintenance of
> the content.  In Lenya, this is usually handled with a doctype.  The
> edit screen should alphabetize multiple terms and show the terms and
> definitions fields in a two-column expandable table.  Whether the data
> is stored in one document or many single-term documents is a design
> decision.  Single-term documents could be more scalable -- less
> conflicts when multiple editors are working at the same time if only
> changed terms are saved, but requires more development and server-side
> processing.
>
> HTH,
> solprovider
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>


-- 
----
Pankaj

Re: Lenya customization - split main region area into two

Posted by so...@apache.org.
On 7/10/08, Pankaj Mandaliya <pa...@gmail.com> wrote:
>  In Lenya, we have the main body region, where we create XHTML document in
> authoring mode and create articles. I want to create article which contains
> a link, and clicking on this link, that article should be divided into two
> separate parts. Here left part will still contain original document, and the
> right part will contain the article referenced by left side document.
>
>  If in my article, there are some difficult words, which requires some
> explanation, then instead of redirecting user to another page for that
> word-reference-link, I want to present that information on the same page, by
> splitting the original page into two and word reference information on the
> right side. And I want my user to build such pages and create
> word-reference-link like this.
>  Pankaj

For any functionality, start with the desired results.  Prototyping
this functionality in HTML with a few definitions specifies the HTML
and Javascript before creating the XMAP and XSLTs to integrate with
Lenya.  Most of this post applies to any Web application.  Decide what
the page should contain, then teach the system how to create that
page.

You want:
1. Words (links) that activate definitions.
2. A place to show the definitions.

In ancient history (mid-1990s), this would be handled with FRAMEs.
This method is highly discouraged today as ugly and
less-than-user-friendly.  The rest of this post ignores this method

Methods for showing the definitions:
1. HTML-only: Clicking a link refreshes the page with the definition shown.
2. Javascript: Clicking a link displays the definition without
refreshing the page.
3. Javascript MouseOver: Show the definition when the mouse is over a
highlighted word.

Places to show the definition:
1. Defined area of page.
2. Defined area of page offset from current top of screen so the
definition is forced into the viewable area.
3. In-page popup near the linked word, usually slightly below the
word.  Best used with MouseOver triggering method.

Methods for deciding glossary words:
1. Require the content editor to add links.
2. Use XSL to make every word found in the glossary into a link.
3. Use XSL to make the first occurrence of each word in the glossary
found in the content body into a link.
4. Use JavaScript to make every word in the glossary into a link.
5. Use Javascript to make the first occurrence of each word in the
glossary into a link.

Creating the links can be handled by XSL or JavaScript.  XSL is better
if editors must choose the words to become links.  Automating the
process can use either method.  JavaScript's advantage is less
server-side processing offset by more development and support work
because Javascript often has browser-specific issues.  Using XSL
requires one additional Transformation; using cache should remove any
effect on performance.

I discourage asking content editors to specify on each page where
links to the glossary belong -- if they know a definition is needed,
they should include the definition in the text.  Automating the
process has several benefits:
- New terms are used without editing existing content.
- Content editors can ignore defining difficult terms on every page,
- Content editors do not need to check whether a word is in the
glossary while editing.  Publishing the page shows which terms are in
the glossary.  Returning to the first benefit, adding a new term
automatically updates the page without additional work

Lenya-based technical methods for adding definition(s) to page:
1. For the HTML-only method, the linked word would probably be in the
querystring.  Lenya looks up the word in the glossary and aggregates
the definition into the page.  The same code should be used with or
without the definition -- aggregate an empty definition when no word
is specified in the querystring.
2. For other methods, all definitions need to be included with every
page.  Now choose whether the content is presented as a DIV or set by
Javascript:
A. <div id="glossary-myword">"myword" is a word in the glossary</div>
B. glossaryObject['myword'] = '"myword" is a word in the glossary.';
The former is better when the DIV has a static location, just hide the
previous DIV with display="none" and show the desired DIV with
display="block" (or "inline".)
The latter is better for dynamically creating the DIV with Javascript.

Lenya can dynamically create the glossary when creating each page.
Better performance is gained by updating a cached glossary pagelet
when a glossary document is created or changed -- saving a definition
updates a separate document aggregating all the definitions so normal
page creation only aggregates that page.

Maintenance of the glossary should be separated from maintenance of
the content.  In Lenya, this is usually handled with a doctype.  The
edit screen should alphabetize multiple terms and show the terms and
definitions fields in a two-column expandable table.  Whether the data
is stored in one document or many single-term documents is a design
decision.  Single-term documents could be more scalable -- less
conflicts when multiple editors are working at the same time if only
changed terms are saved, but requires more development and server-side
processing.

HTH,
solprovider

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