{
// Zero lenght, if that so the flow definition must be implicitly derived.
// See JSF 2.2 section 11.4.3.3
//
FacesConfigImpl facesConfig = new FacesConfigImpl();
FacesFlowDefinitionImpl flow = new FacesFlowDefinitionImpl();
flow.setId(flowName);
// In this case the defining document id is implicit associated
flow.setDefiningDocumentId(systemId);
String startNodePath = systemId.substring(0, systemId.lastIndexOf('/')+1)+flowName+".xhtml";
//URL startNodeUrl = ectx.getResource(startNodePath);
//if (startNodeUrl != null)
//{
flow.setStartNode(startNodePath);
//}
// There is a default return node with name [flow-name]-return and
// that by default points to an outer /[flow-name]-return outcome
FacesFlowReturnImpl returnNode = new FacesFlowReturnImpl();
returnNode.setId(flowName+"-return");
NavigationCaseImpl returnNavCase = new NavigationCaseImpl();
returnNavCase.setFromOutcome("/"+flowName+"-return");
returnNode.setNavigationCase(returnNavCase);
flow.addReturn(returnNode);
facesConfig.addFacesFlowDefinition(flow);
return facesConfig;
}
if (log.isLoggable(Level.INFO))
{
log.info("Reading config " + systemId);
}
FacesConfigImpl facesConfig = (FacesConfigImpl)
getUnmarshaller(ectx).getFacesConfig(pbstream, systemId);
// Set default start node when it is not present.
for (FacesFlowDefinition definition : facesConfig.getFacesFlowDefinitions())
{
if (flowName.equals(definition.getId()))
{
FacesFlowDefinitionImpl flow = (FacesFlowDefinitionImpl) definition;
if (flow.getStartNode() == null)
{
String startNodePath = systemId.substring(0,
systemId.lastIndexOf('/')+1)+flowName+".xhtml";
flow.setStartNode(startNodePath);
}
}
}
return facesConfig;
//getDispenser().feed(getUnmarshaller().getFacesConfig(stream, systemId));