[Design of JBoss Portal] - Re: Setting content type for the whole portal : ContentTypeI
by scollins311
free1000
I've been messing around with this for the past couple days and this is what I've found so far...
I edited the ContentTypeInterceptor to return MediaType.XHTML for certain URLs. Not the most elegant solution but it's just to test.
Then I went and edited the portal-core.war/WEB-INF/layout/portal-renderSet.xml to look like this
<?xml version="1.0" encoding="UTF-8"?>
| <portal-renderSet>
| <renderSet name="divRenderer">
| <set content-type="text/html">
| <region-renderer>org.jboss.portal.theme.impl.render.DivRegionRenderer</region-renderer>
| <window-renderer>org.jboss.portal.theme.impl.render.DivWindowRenderer</window-renderer>
| <portlet-renderer>org.jboss.portal.theme.impl.render.DivPortletRenderer</portlet-renderer>
| <decoration-renderer>org.jboss.portal.theme.impl.render.DivDecorationRenderer</decoration-renderer>
| </set>
| <set content-type="application/xhtml+xml">
| <region-renderer>org.jboss.portal.theme.impl.render.DivRegionRenderer</region-renderer>
| <window-renderer>org.jboss.portal.theme.impl.render.DivWindowRenderer</window-renderer>
| <portlet-renderer>org.jboss.portal.theme.impl.render.DivPortletRenderer</portlet-renderer>
| <decoration-renderer>org.jboss.portal.theme.impl.render.DivDecorationRenderer</decoration-renderer>
| </set>
| </renderSet>
| <renderSet name="emptyRenderer">
| <set content-type="text/html">
| <region-renderer>org.jboss.portal.theme.impl.render.EmptyRegionRenderer</region-renderer>
| <window-renderer>org.jboss.portal.theme.impl.render.EmptyWindowRenderer</window-renderer>
| <portlet-renderer>org.jboss.portal.theme.impl.render.EmptyPortletRenderer</portlet-renderer>
| <decoration-renderer>org.jboss.portal.theme.impl.render.EmptyDecorationRenderer</decoration-renderer>
| </set>
| <set content-type="application/xhtml+xml">
| <region-renderer>org.jboss.portal.theme.impl.render.EmptyRegionRenderer</region-renderer>
| <window-renderer>org.jboss.portal.theme.impl.render.EmptyWindowRenderer</window-renderer>
| <portlet-renderer>org.jboss.portal.theme.impl.render.EmptyPortletRenderer</portlet-renderer>
| <decoration-renderer>org.jboss.portal.theme.impl.render.EmptyDecorationRenderer</decoration-renderer>
| </set>
| </renderSet>
| </portal-renderSet>
and the portal-core.war/WEB-INF/layout/portal-strategies.xml to look like this:
<?xml version="1.0" encoding="UTF-8"?>
| <portal-strategies>
| <set name="maximizedRegion">
| <strategy content-type="text/html">
| <implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
| </strategy>
| <strategy content-type="application/xhtml+xml">
| <implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
| </strategy>
| </set>
| </portal-strategies>
Now things are starting to look promising. I'm getting a faces error because the action on the form isn't well-formated xml. I'm looking into that. And Internet Explorer seems to think the page is a downloadable file. So, there is that too.
Thanks for finding that interceptor for me. I'd still be lost if you hadn't.
Shaun
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961374#3961374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961374
17 years, 9 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Justification for
by scott.stark@jboss.org
"timfox" wrote : Wouldn't it be better if the method is written to always guarantee to leave the object in a well defined state?
|
| If the object is not left in a well defined state then even if you catch Throwable, then there's not much you can do since you don't know if the underlying resource (or whatever) was actually allocated.
|
| ...
|
| Then your're not leaving anything to chance and you can avoid throws Throwable.
|
| This is mentioned in Bloch's effective Java "Strive for failure atomicity"
|
| What am I missing?
|
You have made an assumption that all Throwables map to an IllegalStateException and that the actual type of the exception event is not relevant to the caller's state machine with respect to how it relates to obtaining a connection. I would miss the opportunity to have different transitions for different types of exception events:
|
| {
| Connection conn = null;
|
| try
| {
|
| log.info("before allocation");
|
| conn = ......
|
| log.info("after allocation");
| }
| catch(NoRouteToHostException e)
| {
| ...
| }
| catch(OutOfMemoryError e)
| {
| ...
| }
| catch (Throwable t)
| {
| if (conn != null) conn.close();
| // Why should I throw away the type and prevent my caller from doing fine-grained event handling?
| throw new IllegalStateException();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961365#3961365
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961365
17 years, 9 months