[JBoss Seam] - Re: Trinidad Tree + Seam Action Bean
by petemuir
I have this working (for a treetable at least). I used a facelets function:
<tr:treeTable value="#{my:asRootedTree(value)}">...
| public class Utils {
| private static TreeModel asTree(Object tree, boolean createRoot) {
| if (createRoot && tree instanceof Collection) {
| TreeRoot root = new TreeRoot((Collection) tree);
| return new ChildPropertyTreeModel(root, "children");
| } else {
| return new ChildPropertyTreeModel(tree, "children");
| }
| }
|
| public static TreeModel asTree(Object root) {
| return asTree(root, false);
| }
|
| public static TreeModel asRootedTree(Object root) {
| return asTree(root, true);
| }
|
| public static class TreeRoot {
|
| private Collection<?> children;
|
| public TreeRoot(Collection<?> children) {
| this.children = children;
| }
|
| public Collection<?> getChildren() {
| return children;
| }
|
| public String getType() {
| return "root";
| }
| }
| }
N.B. These method can create a singly rooted tree from a list (with a dummy root) or take a single object as the root node.
and wired it up using my.taglib.xml. value can now be a Seam outjected list.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000312#4000312
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000312
19 years, 3 months
[JBoss Messaging] - Re: Jboss 5.0.0beta1 messaging problem
by zlajaj
This is from login-config.xml file :
<application-policy name="messaging">
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
<module-option name="unauthenticatedIdentity">guest</module-option>
<module-option name="usersProperties">props/messaging-users.properties</module-option>
<module-option name="rolesProperties">props/messaging-roles.properties</module-option>
</login-module>
</application-policy>
code :
private static TopicConnection getTopicConnection() throws NamingException, JMSException {
if (conn == null) {
conn = getTopicConnectionFactory().createTopicConnection("clientMessagePublisher", "clientMessagePublisher!");
conn.start();
conn.setExceptionListener(new ExceptionListener() {
public void onException(JMSException jmsException) {
Log.getInstance().addEntry(Log.LEVEL_ERR, jmsException, "Greska u komnunikaciji sa JBossMQ-om.");
stopConnection(jmsException);
}
});
}
return conn;
}
private static TopicConnectionFactory getTopicConnectionFactory() throws NamingException {
if (tcf == null) {
tcf = (TopicConnectionFactory)getInitialContext().lookup("ConnectionFactory");
}
return tcf;
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000309#4000309
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000309
19 years, 3 months