Package org.apache.cocoon.sitemap

Examples of org.apache.cocoon.sitemap.PatternException


                addLiteral(expr.substring(prev, pos - 1));
            }

            int end = expr.indexOf('}', pos);
            if (end == -1) {
                throw new PatternException("Unmatched '{' in " + expr);
            }

            int colon = expr.indexOf(':', pos);
            if (colon != -1 && colon < end) {
                   
                String module = expr.substring(pos, colon);
                String variable = expr.substring(colon + 1, end);

                // Module used
                addModuleVariable(module, variable);
            } else {
                throw new PatternException("Unknown variable format " + expr.substring(pos, end));
            }

            prev = end + 1;
        }
    }
View Full Code Here


        if (this.selector == null) {
            try {
                // First access to a module : lookup selector
                this.selector = (ComponentSelector)this.manager.lookup(InputModule.ROLE + "Selector");
            } catch(ComponentException ce) {
                throw new PatternException("Cannot access input modules selector", ce);
            }
        }
       
        // Get the module
        InputModule module;
        try {
            module = (InputModule)this.selector.select(moduleName);
        } catch(ComponentException ce) {
            throw new PatternException("Cannot get InputModule named '" + moduleName +
                "' in expression '" + this.expression + "'", ce);
        }
       
        // Is this module threadsafe ?
        if (module instanceof ThreadSafe) {
View Full Code Here

                        if (value != null) {
                            result.append(value);
                        }

                    } catch(ConfigurationException confEx) {
                        throw new PatternException("Cannot get variable '" + variable +
                            "' in expression '" + this.expression + "'", confEx);
                    }
                }
                break;
               
                case STATEFUL_MODULE :
                {
                    InputModule module = null;
                    String moduleName = (String)items.get(++i);
                    String variableName = (String)items.get(++i);
                    try {
                        module = (InputModule)this.selector.select(moduleName);
                       
                        Object value = module.getAttribute(variableName, null, ContextHelper.getObjectModel(this.context));
                       
                        if (value != null) {
                            result.append(value);
                        }
                       
                    } catch(ComponentException compEx) {
                        throw new PatternException("Cannot get module '" + moduleName +
                            "' in expression '" + this.expression + "'", compEx);
                           
                    } catch(ConfigurationException confEx) {
                        throw new PatternException("Cannot get variable '" + variableName +
                            "' in expression '" + this.expression + "'", confEx);
                           
                    } finally {
                        this.selector.release(module);
                    }
View Full Code Here

            }

        }
        catch (SQLException sqle)
        {
            throw new PatternException("Unable to obtain DSpace Context", sqle);
        }
    }
View Full Code Here

            // HandleUtil handles caching if needed.
            dso = HandleUtil.obtainHandle(objectModel);
        }
        catch (SQLException sqle)
        {
            throw new PatternException("Unable to obtain DSpace Object", sqle);
        }

        if (dso == null)
            return null;
View Full Code Here

            }

        }
        catch (SQLException sqle)
        {
            throw new PatternException("Unable to obtain DSpace Context", sqle);
        }
    }
View Full Code Here

       
        return result;
      }

    } catch (SQLException sqle) {
      throw new PatternException(sqle);
    }

    // No themes matched.
    return null;
  }
View Full Code Here


        }
        catch (SQLException sqle)
        {
            throw new PatternException("Unable to obtain DSpace Context", sqle);
        }
    }
View Full Code Here

                addLiteral(expr.substring(prev, pos - 1));
            }

            int end = expr.indexOf('}', pos);
            if (end == -1) {
                throw new PatternException("Unmatched '{' in " + expr);
            }

            int colon = expr.indexOf(':', pos);
            if (colon != -1 && colon < end) {
                if (expr.startsWith("sitemap:", pos)) {
View Full Code Here

        if (this.selector == null) {
            try {
                // First access to a module : lookup selector
                this.selector = (ComponentSelector)this.manager.lookup(InputModule.ROLE + "Selector");
            } catch(ComponentException ce) {
                throw new PatternException("Cannot access input modules selector", ce);
            }
        }
       
        // Get the module
        InputModule module;
        try {
            module = (InputModule)this.selector.select(moduleName);
        } catch(ComponentException ce) {
            throw new PatternException("Cannot get InputModule named '" + moduleName +
                "' in expression '" + this.originalExpr + "'", ce);
        }
       
        // Is this module threadsafe ?
        if (module instanceof ThreadSafe) {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sitemap.PatternException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.