JSF2.2 faces flow method call node - jsf-2.2

I am currently using JSF 2.2 faces flow with WildFly8.2.0 as JAVA EE 7 server.
Can anyone has any idea of , how to use/configure method call node using XML file configuration ?
I know how to invoke it using FlowBuilder API , but haven't found any tutorial on how to use XML for the same . (flowname-flow.xml).
Can anyone please help ?

Below is the syntax for calling a method call node in FacesFlow -
<flow-definition id="someFlow">
<start-node>start</start-node>
<method-call id="start">
<method>#{bean.init}</method>
<default-outcome>success</default-outcome>
</method-call>
<view id="initSuccess">
<vdl-document>/pages/init.xhtml</vdl-document>
</view>
</flow-definition>
where #{bean.init} returns outcome as "initSuccess" upon which init.xhtml is rendered.
success is the default outcome if method doesn't return anything.

Related

BuildCoreAdmin solrnetfacility is returning nullpointer exception

Need to do swapping of my cores and hence need to set the SolrCoreAdmin in my solrFacility, so I can use it throughout my application using my Windsor container.
When I do the following :
var solrFacility = new SolrNetFacility(ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress);
solrFacility.AddCore(AgentsIndex.IndexName, typeof(AgentsIndexMapper), ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress +"/"+ AgentsIndex.IndexName);
solrFacility.AddCore(AgentsIndex.SwapIndexName, typeof(AgentsIndexMapper), ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress + "/" + AgentsIndex.SwapIndexName);
solrFacility.BuildCoreAdmin(ConfigurationSettings.ContentSearch_Solr_ServiceBaseAddress);
_WindsorContainer.AddFacility("solr", solrFacility);
I get following error:
[NullReferenceException: Object reference not set to an instance of an object.]
Castle.Facilities.SolrNetIntegration.SolrNetFacility.BuildCoreAdmin(ISolrConnection conn) +40
I looked up the code inside BuildCoreAdmin using reflector and I think its trying to access a base.Kernel...is that null? How do I set that kernel? The base file is AbstractFacility and that has a function setKernel. What should this kernel be?
How do I solve this? im new to solrnet and need your help. Thanking you.
Regards,
Kasturi Chavan
I got the solution for this. I was doing it wrong. Thought of posting the answer so it helps others.
When initilaizing the solrnetfacility , the solrcoreadmin are also initialised. I later added this solrnetfacility to my container (castle windsor in this case) so i can use it over entire application.
Later when i wanted to swap the indexes after rebuild, i just resolved it
ISolrCoreAdmin _ISolrCoreAdmin = c.GetContainer().Resolve<ISolrCoreAdmin>();
ResponseHeader response = _ISolrCoreAdmin.Swap(corename, othername);
And all set!
Hope it helps someone. Thanks a lot for all help provided.

Shopware hook LegacyStructConverter problems

I`m trying subscribe hook for public method convertListProductStruct of LegacyStructConverter.
Path \Shopware\Components\Compatibility\LegacyStructConverter
My code:
$this->subscribeEvent(
'LegacyStructConverter::convertListProductStruct::after',
'afterListProductStruct'
);
But event does not appear :( What I`m doing wrong ?
The LegacyStructConverter is not hookable.
Please see: https://developers.shopware.com/developers-guide/shopware-5-core-service-extensions/

Apache Camel: How to properly nest a function?

In Camel's Simple documentation they say :
From Camel 2.9 onwards you can nest functions, such as shown below:
<setHeader headerName="myHeader">
<simple>${properties:${header.someKey}}</simple>
</setHeader>
Here is what I am trying to do:
<simple>${property.${property.prefix}variableName}</simple>
I am trying to access the exchange property whose name is:
exchange.getProperty("prefix", String.class) + "variableName"
But I'm getting this exception:
Caused by: org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: ${ cannot accept or at location 22
${property.${property.prefix}variableName}
What am I doing wrong here?
I'm using Camel version 2.13.0.
I confirm the following code works fine with Camel 2.13.0:
from("...")
.setProperty("prefix", constant("pre-"))
.setProperty("pre-variable", constant("value"))
.setHeader("myHeader", simple("${property.${property.prefix}variable}"))
You may have special character in the prefix property that prevents proper resolution.

insertNewChild is not a function in DHTML Tree grid Pro

I want to access child data from server when we append parent. Now I am using
mygrid.attachEvent("onOpenStart", getSubElements );
When I am using getSubElements, this method then it is showing an error: inserNewChild is not a function.
I am using this line, please review this and let me know where I am doing wrong.
mygrid.insertNewChild("a0J9000000TTdLtEAL","a0J9000000TTdKz","CLASS.000010",0,0,0,0,"");
Please note that the insertNewChild() is the method of the dhtmlxTree, and won't work in dhtmlxTreegrid.
http://docs.dhtmlx.com/api__dhtmlxtree_insertnewchild.html
You may use the addRow() method:
http://docs.dhtmlx.com/api__link__dhtmlxtreegrid_addrow.html
Also please try to use the onOpenEnd event instead of onOpenStart:
http://docs.dhtmlx.com/api__dhtmlxtreegrid_onopenend_event.html

How to check null value from Java Method of Tibco ActiveMatrix

I am having a trouble on checking null value from a Java Method component in Tibco ActiveMatrix process.
Basically, I have a Java Method component invoking java to get a billing account, if the return is null, I would like to log the searching criteria - billing account id; otherwise, I will map the object to be XML content...
The problem is while using the following in 'XPath' to check the null object in a transition (Success with condition):
empty($Get-BA-Details/ns5:JavaMethodActivityOutput/MethodReturnValue
count($Get-BA-Details/ns5:JavaMethodActivityOutput/MethodReturnValue)= 0
string-length($Get-BA-Details/ns5:JavaMethodActivityOutput/MethodReturnValue) = 0
'$Get-BA-Details' is the Java Method component.
they all return 'false', and then try to map the java object to be XML content, which results in error while billing account is not found.
Could anyone shed some lights?
Thanks a lot!
Try this:
$Get-BA-Details/ns5:JavaMethodActivityOutput/MethodReturnValue=""
From what I can tell you cannot check if the return from a Java Method activity is null using XPath. Instead you can create a Java Code activity that takes an ObjectReference as an input parameters and provides a boolean as an output parameter. You can then use code like to following to check if the object is null (object is the input parameter and isnull is the output parameter):
isnull = object == null;
I have created BWUnit tests in the for this in the latest snapshot of BWUnit, which you can download from http://windyroad.org/software/bwunit/download/BWUnit-11.2.zip
The tests are located at StackOverflow/UnitTestSuite/JavaMethodNullTestCase in the simple example, which is found in Examples/Simple within the download.

Resources