I just started to play with Magnolia and I'm stuck with a problem on the dam
control.
I've created a new data type in the Data section, I have also created the
Dialog to create a new item for the data type. Everything works fine until I
add a dam control to the dialog, the dam control works fine on existing data
items but when I try to create a new data item I'm getting the exception below,
by looking at the code in the svn looks like this is a maksed
NullPointerException.
Am I missing some configuration ? is it possible to use the dam control on new
datatypes ?
java.lang.RuntimeException: java.lang.RuntimeException: Can't determine the
site to use
info.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:159)
info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:60)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:75)
info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:88)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
info.magnolia.module.extendedtemplatingkit.filters.MultiSiteFilter.doFilter(MultiSiteFilter.java:94)
info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:88)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:73)
info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:60)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:84)
info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:64)
info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:88)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:88)
[code]private DAMSupport getDamSupport() {
try {
Site site;
// the content we are currently editing
Content websiteNode = this.getStorageNode();
if(websiteNode != null){
site = STKUtil.getSite(websiteNode);
}
// if this is a new content we get the site of the parent node
else if(MgnlContext.hasAttribute("mgnlPath")) {
String pathToParent = (String)
MgnlContext.getAttribute("mgnlPath");
Content parentNode =
ContentUtil.getContent(ContentRepository.WEBSITE, pathToParent);
site = STKUtil.getSite(parentNode);
}
else{
// in this case the dialog control is used in an other use case
// for instance to inspect a dialog configuration
// we cannot do better than use the current site
site = STKUtil.getSite();
}
return site.getDamSupport();
} catch (Exception e) {
throw new RuntimeException("Can't determine the site to use", e);
}
}[/code]
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=cf5c70a7-77b6-4968-aa05-cb8f4412d27d
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------