You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Brad Gardner <bg...@gmail.com> on 2008/03/29 15:54:18 UTC

Velocity Portlet Question

I'm not too familiar with velocity, but have a portlet I am trying to
understand.  I have all of the related files to the portlet, but there is no
.vm template to display the edit page of the portlet.  It looks like all of
the information for the edit page is configured in the portlet entry in the
.xreg file.  Am I correct to assume that the portlet does not need a
template for an edit page and builds the page based on this definition by
default?

If thats correct, I'd assume there is a way to use a custom template for the
edit page if you want?

-- 
Brad Gardner

Re: Velocity Portlet Question

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Mar 29, 2008, at 7:54 AM, Brad Gardner wrote:

> I'm not too familiar with velocity, but have a portlet I am trying to
> understand.  I have all of the related files to the portlet, but  
> there is no
> .vm template to display the edit page of the portlet.  It looks like  
> all of
> the information for the edit page is configured in the portlet entry  
> in the
> .xreg file.  Am I correct to assume that the portlet does not need a
> template for an edit page and builds the page based on this  
> definition by
> default?
>
> If thats correct, I'd assume there is a way to use a custom template  
> for the
> edit page if you want?

NOTE: this is a Jetspeed-1 question....

Edit mode in j1 works a lot different than in the portlet api
In general, most portlets let jetspeed handle edit mode
Take for ex the Database Browser portlet, here is the base definition:

     <portlet-entry name="DatabaseBrowserPortlet" hidden="true"  
type="ref" parent="Velocity" application="false">
         <category>database</category>
         <parameter name="template" value="database-browser-portlet"  
hidden="true"/>
         <parameter name="action"  
value="portlets.browser.DatabaseBrowserAction" hidden="true"/>
     </portlet-entry>

and then a concrete definition. Jetspeed handles creating the edit  
mode template for you, using parameters.
Note that you can secure parameters, something not considered in the  
portlet api

	<portlet-entry name="DatabaseBrowserTest" hidden="false" type="ref"  
parent="DatabaseBrowserPortlet" application="false">
		<meta-info>
			<title>DatabaseBrowserTest</title>
			<description>Simple Test Database Browser Portlet Example</ 
description>
		</meta-info>
		<parameter name="sql" value="select * from coffees" type="style"  
hidden="false">
			<security-ref parent="admin-only"/>
			<meta-info>
				<title>SQL Query</title>
			</meta-info>
		</parameter>
		<parameter name="sql.style" value="TextArea" hidden="true"/>
		<parameter name="windowSize" value="5" hidden="false">
			<meta-info>
				<title>Window Size</title>
				<description>Number of rows per page to display</description>
			</meta-info>
		</parameter>
		<!-- to use an alternate torque pool, set this parameter -->
		<!-- parameter name="poolname" value="otherpool" hidden="true"/-->
		<media-type ref="html"/>
		<category>database</category>
	</portlet-entry>