private static void validateNavRule(NavigationRule navRule, List<String> list, String ctxPath){ String fromId = navRule.getFromViewId(); String filePath = ctxPath + fromId; if(fromId != null && ! "*".equals(fromId) && ! new File(filePath).exists()) { list.add("File for navigation 'from id' does not exist " + filePath); } for (NavigationCase caze : navRule.getNavigationCases()) { String toViewPath = ctxPath + caze.getToViewId(); if(!new File(toViewPath).exists()) { list.add("File for navigation 'to id' does not exist " + toViewPath); } } }
String fromViewId = rule.getFromViewId();
String fromViewId = rule.getFromViewId();
private static void validateNavRule(NavigationRule navRule, List<String> list, String ctxPath){ String fromId = navRule.getFromViewId(); String filePath = ctxPath + fromId; if(fromId != null && ! "*".equals(fromId) && ! new File(filePath).exists()) { list.add("File for navigation 'from id' does not exist " + filePath); } for (NavigationCase caze : navRule.getNavigationCases()) { String toViewPath = ctxPath + caze.getToViewId(); if(!new File(toViewPath).exists()) { list.add("File for navigation 'to id' does not exist " + toViewPath); } } }
String fromViewId = rule.getFromViewId();
private static void validateNavRule(NavigationRule navRule, List<String> list, String ctxPath){ String fromId = navRule.getFromViewId(); String filePath = ctxPath + fromId; if(fromId != null && ! "*".equals(fromId) && ! new File(filePath).exists()) list.add("File for navigation 'from id' does not exist " + filePath); Collection cases = navRule.getNavigationCases(); Iterator iterator = cases.iterator(); while(iterator.hasNext()){ NavigationCase caze = (NavigationCase) iterator.next(); String toViewPath = ctxPath + caze.getToViewId(); if(! new File(toViewPath).exists()) list.add("File for navigation 'to id' does not exist " + toViewPath); } }
flow.addNavigationCases(rule.getFromViewId(), NavigationUtils.convertNavigationCasesToAPI(rule));
private static void validateNavRule(NavigationRule navRule, List<String> list, ExternalContext ctx) String fromId = navRule.getFromViewId(); URL filePath; try for (NavigationCase caze : navRule.getNavigationCases())
String fromViewId = rule.getFromViewId(); if (list == null) list = new ArrayList(rule.getNavigationCases()); cases.put(fromViewId, list); if (fromViewId.endsWith(ASTERISK)) list.addAll(rule.getNavigationCases());
private Set<NavigationCase> convertNavigationCasesToAPI(NavigationRule rule) { Collection<? extends org.apache.myfaces.config.element.NavigationCase> configCases = rule.getNavigationCases(); Set<NavigationCase> apiCases = new HashSet<NavigationCase>(configCases.size()); for(org.apache.myfaces.config.element.NavigationCase configCase : configCases) { if(configCase.getRedirect() != null) { String includeViewParamsAttribute = configCase.getRedirect().getIncludeViewParams(); boolean includeViewParams = false; // default value is false if (includeViewParamsAttribute != null) { includeViewParams = new Boolean(includeViewParamsAttribute); } apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(),configCase.getFromOutcome(),configCase.getIf(),configCase.getToViewId(),configCase.getRedirect().getViewParams(),true,includeViewParams)); } else { apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(),configCase.getFromOutcome(),configCase.getIf(),configCase.getToViewId(),null,false,false)); } } return apiCases; }
private Set<NavigationCase> convertNavigationCasesToAPI(NavigationRule rule) { Collection<? extends org.apache.myfaces.config.element.NavigationCase> configCases = rule.getNavigationCases(); Set<NavigationCase> apiCases = new HashSet<NavigationCase>(configCases.size()); for(org.apache.myfaces.config.element.NavigationCase configCase : configCases) { if(configCase.getRedirect() != null) { String includeViewParamsAttribute = configCase.getRedirect().getIncludeViewParams(); boolean includeViewParams = false; // default value is false if (includeViewParamsAttribute != null) { includeViewParams = new Boolean(includeViewParamsAttribute); } apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(),configCase.getFromOutcome(),configCase.getIf(),configCase.getToViewId(),configCase.getRedirect().getViewParams(),true,includeViewParams)); } else { apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(),configCase.getFromOutcome(),configCase.getIf(),configCase.getToViewId(),null,false,false)); } } return apiCases; }
public static Set<javax.faces.application.NavigationCase> convertNavigationCasesToAPI(NavigationRule rule) rule.getNavigationCases(); Set<javax.faces.application.NavigationCase> apiCases = new HashSet<javax.faces.application.NavigationCase>(configCases.size()); apiCases.add(new javax.faces.application.NavigationCase(rule.getFromViewId(), configCase.getFromAction(), configCase.getFromOutcome(),configCase.getIf(), apiCases.add(new javax.faces.application.NavigationCase(rule.getFromViewId(), configCase.getFromAction(), configCase.getFromOutcome(),configCase.getIf(),
private Set<NavigationCase> convertNavigationCasesToAPI(NavigationRule rule) { Collection<? extends org.apache.myfaces.config.element.NavigationCase> configCases = rule.getNavigationCases(); Set<NavigationCase> apiCases = new HashSet<NavigationCase>(configCases.size()); for(org.apache.myfaces.config.element.NavigationCase configCase : configCases) { if(configCase.getRedirect() != null) { String includeViewParamsAttribute = configCase.getRedirect().getIncludeViewParams(); boolean includeViewParams = false; // default value is false if (includeViewParamsAttribute != null) { includeViewParams = Boolean.valueOf(includeViewParamsAttribute); } apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(), configCase.getFromOutcome(),configCase.getIf(),configCase.getToViewId(), configCase.getRedirect().getViewParams(),true,includeViewParams)); } else { apiCases.add(new NavigationCase(rule.getFromViewId(),configCase.getFromAction(), configCase.getFromOutcome(),configCase.getIf(), configCase.getToViewId(),null,false,false)); } } return apiCases; }