Problem with component properties
astik <[email protected]>
| Newsgroups | gmane.comp.cms.infoglue.devel |
|---|---|
| Message-ID | <[email protected]> |
I have defined a property for my bas component : footerPages binding
SiteNode multiple
When i use the properties palette into the decorated page, when i
click the link to set the properties (link titled "undefined"), i've
got an exception :
[28 août 2009 19:36:42 - Infoglue CMS] WARN (BeanUtil.java:192) -
Could not set parameter
"contentId":webwork.util.editor.PropertyEditorException: Unable to set
value for null
webwork.util.editor.PropertyEditorException: Unable to set value for
null
at
webwork
.util.editor.IntegerObjectEditor.getAsValue(IntegerObjectEditor.java:30)
at webwork.util.BeanUtil.getAsValue(BeanUtil.java:424)
at
webwork.util.BeanUtil.setStringValueWithPropertyEditor(BeanUtil.java:
826)
at webwork.util.BeanUtil.setValue(BeanUtil.java:568)
at webwork.util.BeanUtil.setProperty(BeanUtil.java:309)
at webwork.util.BeanUtil.setProperties(BeanUtil.java:177)
at
webwork
.action
.factory
.ParametersActionFactoryProxy
.getActionImpl(ParametersActionFactoryProxy.java:53)
at
webwork
.action
.factory
.ChainingActionFactoryProxy
.getActionImpl(ChainingActionFactoryProxy.java:52)
at
webwork
.action
.factory.DefaultActionFactory.getActionImpl(DefaultActionFactory.java:
107)
at webwork.action.factory.ActionFactory.getAction(ActionFactory.java:
63)
at
webwork
.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:119)
at
webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:174)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at
org
.apache
.catalina
.core
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
269)
at
org
.apache
.catalina
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
...
Here is the URL of the popup :
CMS/ViewSiteNodePageComponents!
showStructureTreeForMultipleBinding.action?
repositoryId
=
1
&siteNodeId
=
1
&languageId
=
4&contentId=null&componentId=3&propertyName=footerPages&showSimple=false
As you can see contentId is null and that is not good =/
Into
org.infoglue.deliver.invokers.DecoratedComponentBasedHTMLPageInvoker,
the url is defined like this :
assignUrl = componentEditorUrl +
componentProperty.getVisualizingAction() + "?repositoryId=" +
repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" +
languageId + "&contentId=" + contentId + "&componentId=" + componentId
+ "&propertyName=" + componentProperty.getName() + "&showSimple=" +
getTemplateController().getDeliveryContext().getShowSimple();
in debug, contentId was null, so i decided to watch the call stack ....
After traversing some function call, we arrived at line 173 in the
same file :
decoratePageTemplate = decorateComponent(baseComponent,
this.getTemplateController(), repositoryId,
this.getDeliveryContext().getSiteNodeId(),
this.getDeliveryContext().getLanguageId(),
this.getDeliveryContext().getContentId()/*,
metaInfoContentVO.getId()*/, 15, 0);
this.getDeliveryContext().getContentId was null ... i though if it was
null, the system change it to -1.
Anyway, that what i did into my htmltemplate content, using the Pre
processing template ("PreTemplate") :
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="infoglue-page" prefix="page" %>
<page:deliveryContext id="deliveryContext" disableNiceUri="true"/>
<c:if test="${empty deliveryContext.contentId}">
<jsp:setProperty property="contentId" name="deliveryContext"
value="null"/>
</c:if>
now it works great. Still, I hope it won't break anything in the future.
To conclude, i don't think that pretemplate trick is normal =/
By the way, i'm working with the latest stable version (2971)
__
Romain
http://blog.astik.info
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july