EasyForms - List of forms

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

EasyForms - List of forms

Resistol
Hi there,

My questions is pretty straight forward but I do not seem to find the answer. Basically, I just want to present to the user a list of "forms" he can access.

In the demo example, all the forms are given via the sitemap but there is no "list" for the user. I am creating my own list and I am stuck on querying the repository. I am using the overview component to create the list but it needs a "bean" but I cannot relate it to the jsp layout unlike the formtemplate.

I am trying to get only the title, name and introduction.
I may need to create a REST Service as well with the same data.

I appreciate any suggestion.

Cheers,
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

marijan milicevic
Hi Victor,
On 08/14/2012 05:33 PM, victor wrote:
Hi there,

My questions is pretty straight forward but I do not seem to find the
answer. Basically, I just want to present to the user a list of "forms" he
can access.

In the demo example, all the forms are given via the sitemap but there is no
"list" for the user. I am creating my own list and I am stuck on querying
the repository. I am using the overview component to create the list but it
needs a "bean" but I cannot relate it to the jsp layout unlike the
formtemplate.

I am trying to get only the title, name and introduction.
I may need to create a REST Service as well with the same data.

I appreciate any suggestion.

You can query for Form documents (FormBean.class) just like any other document type, however, you'll need to register easyform beans in your component  (see [1] getLocalAnnotatedClasses() method.)
Other way to do this is to define this within web.xml (see [2])

Once this is done, you can query Form documents like any other documents, for example see link [3]
hth,

cheers
marijan



[1] https://forge.onehippo.org/svn/easy-forms/easy-forms/trunk/hst/src/main/java/org/onehippo/forge/easyforms/hst/EasyFormComponent.java
[2] http://www.onehippo.org/7_7/library/concepts/web-application/automatic-scanning-for-content-bean-annotated-classes.html
[3] http://www.onehippo.org/7_7/library/concepts/search/hst-2-search.html





Cheers,



--
View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Resistol
Hi there,

I made some progress listing the forms. Right now, I am able to retrieve some data although I am not sure what...

After, following the information from you post (defining the beans in the web.xml) I setting the jsp I am able to get some information. However, I cannot get the values specified in the resultset and anything I try seems to give an exception.

In the following excerpt,  the "form" does not work at all but if I replace to item in the for each, it creates returns the right number of forms.
 
<nabble_embed> <%--@elvariable id="form" type="org.onehippo.forge.easyforms.model.Form"--%> ... <div data-role="content">   <ul data-role="listview" data-theme="c">     <c:forEach var="form" items="${result.hippoBeans}">       <hst:cmseditlink hippobean="${form}" />       <li>           <hst:link var="link" hippobean="${form.title}"/>           <a href="${link}" data-transition="turn" data-ajax="false">                      <p>             <h3 class="aqua">${form.title}</h3>              <font style="white-space: normal; font-size: small">${formIntro}</font>           </p>         </a>       </li>     </c:forEach>   </ul> </div> </nabble_embed>
Cheers,
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Jeroen Reijn
Administrator
Hi,

I think this will fail:

>           <hst:link var="link" hippobean="${form.title}"/>

I might be mistaken, but the form.title will not give you a bean. So
the HST cannot create a link out of that.

Jeroen


On Wed, Aug 15, 2012 at 5:25 PM, victor <[hidden email]> wrote:

> Hi there,
>
> I made some progress listing the forms. Right now, I am able to retrieve
> some data although I am not sure what...
>
> After, following the information from you post (defining the beans in the
> web.xml) I setting the jsp I am able to get some information. However, I
> cannot get the values specified in the resultset and anything I try seems to
> give an exception.
>
> In the following excerpt,  the "form" does not work at all but if I replace
> to item in the for each, it creates returns the right number of forms.
>
>
> <%--@elvariable id="form" type="org.onehippo.forge.easyforms.model.Form"--%>
> ...
>
> <div data-role="content">
>   <ul data-role="listview" data-theme="c">
>     <c:forEach var="form" items="${result.hippoBeans}">
>       <hst:cmseditlink hippobean="${form}" />
>       <li>
>           <hst:link var="link" hippobean="${form.title}"/>
>            ${link}
>
>           <p>
>
> ${form.title}
>
>             ${formIntro}
>           </p>
>
>       </li>
>     </c:forEach>
>   </ul>
> </div>
>
>
> Cheers,
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579051.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Jeroen Reijn
Solution Architect
Hippo

Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

http://about.me/jeroenreijn
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

EveOnline
I am trying the same actions, but having the same problem
I am using the following code

<c:forEach var="item" items="${result.hippoBeans}">
    <hst:cmseditlink hippobean="${item}" />
    <li>
        <hst:link var="linkform" hippobean="${item}"/>
        <a href="${linkform}">${item.title}</a>
    </li>
</c:forEach>

the link works it sends me to the correct easyform just the title is not showing (blank).

How do I call the title (or formIntro) I have tried form.title, item.title.
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Jeroen Reijn
Administrator
Since you call your variable "item" (var="item") you could also print
item ${item} to show what kind of object it is before you try to get a
property of the object.


On Tue, Aug 21, 2012 at 10:54 AM, EveOnline <[hidden email]> wrote:

> I am trying the same actions, but having the same problem
> I am using the following code
>
>
>
> the link works it sends me to the correct easyform just the title is not
> showing (blank).
>
> How do I call the title (or formIntro) I have tried *form.title,
> item.title*.
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579090.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Jeroen Reijn
Solution Architect
Hippo

Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

http://about.me/jeroenreijn
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

EveOnline
When I print out ${item} what it returns is the following.
org.onehippo.forge.easyforms.beans.FormBean@551ef8ac

I have tried when I check the FormBean it has the class getFormName.
So I have also tried ${item.formname} but this gives an error.

So can anyone help?
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Laurens Leeuwis
getFormName in Java maps to formName in JSP, so you made a typo probably?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of EveOnline
Sent: woensdag 22 augustus 2012 3:24
To: [hidden email]
Subject: Re: [Hippo-cms7-user] EasyForms - List of forms

When I print out ${item} what it returns is the following.


I have tried when I check the FormBean it has the class getFormName.
So I have also tried *${item.formname}* but this gives an error.

So can anyone help?



--
View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579108.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html






This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Jeroen Reijn
Administrator
Well if that's the thing that ${item.formName} should solve your problem ;-)

On Wed, Aug 22, 2012 at 3:26 PM, Leeuwis, Laurens
<[hidden email]> wrote:

> getFormName in Java maps to formName in JSP, so you made a typo probably?
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of EveOnline
> Sent: woensdag 22 augustus 2012 3:24
> To: [hidden email]
> Subject: Re: [Hippo-cms7-user] EasyForms - List of forms
>
> When I print out ${item} what it returns is the following.
>
>
> I have tried when I check the FormBean it has the class getFormName.
> So I have also tried *${item.formname}* but this gives an error.
>
> So can anyone help?
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579108.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>
>
>
>
>
>
> This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
> intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
> read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
> in error, please notify the sender immediately and delete all copies of this message.
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Jeroen Reijn
Solution Architect
Hippo

Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

http://about.me/jeroenreijn
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

EveOnline
This post was updated on .
In reply to this post by Laurens Leeuwis
Hi I pretty sure it's not a type-o.

Could it be that I forgot setting

1. I added it to the web.xml

2. component used is Overview.java
3. then update parameters to docType -> ef:forms

4. Then update jsp.

Am I forgetting steps?
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Resistol
Wow, I managed to get the same info from the form using indeed -formName-.
However, I am using the "Form Intro" as well. I tried a couple of things but have no idea to get that descriptive information in the jsp.

Do I need to add another bean to handle that?
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

marijan milicevic
Hi all,

On 08/22/2012 05:16 PM, victor wrote:
Wow, I managed to get the same info from the form using indeed -formName-. 
However, I am using the "Form Intro" as well. I tried a couple of things but
have no idea to get that descriptive information in the jsp.

Do I need to add another bean to handle that?

may be this[1] can be of help:

https://forge.onehippo.org/svn/easy-forms/demo/trunk/site/src/main/webapp/jsp/components/easyforms/formtemplate.jsp

cheers
marijan




--
View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579112.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Resistol
I tried this on the jsp...

<li>
  <hst:link var="link" hippobean="${item}"/>
  <a href="${link}">   
    <p>
      <h2>${item.formName}</h2> 
      <c:if test="${not empty formIntro}">
        <p><c:out value="${formIntro}"/></p>
      </c:if>
    </p>
  </a>
  </li>

I added the behavior as well as parameter to the component. However, I never prints the results of the items. I tried also "item.formIntro" but this just breaks the whole listing.

Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Woonsan Ko-3
Hi,

I think you can get form intro like this:

${item.property['ef:formintro']}

Regards,

Woonsan

On 8/22/12 1:57 PM, victor wrote:

> I tried this on the jsp...
>
>
>
> I added the behavior as well as parameter to the component. However, I never
> prints the results of the items. I tried also "item.formIntro" but this just
> breaks the whole listing.
>
>
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/EasyForms-List-of-forms-tp7579049p7579116.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>


--
[hidden email]     www.onehippo.com
Boston - 1 Broadway, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: EasyForms - List of forms

Resistol
Woonsan Ko-3, you are my hero!

This works better than the waterboiler of my mother!

Thanks,