Package org.apache.cocoon.components.source

Examples of org.apache.cocoon.components.source.SourceHandler


     * Process the given <code>Environment</code> to generate the sitemap.
     */
    public void generateSitemap(Environment environment)
    throws Exception {
        ProgramGenerator programGenerator = null;
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        SourceHandler sourceHandler = null;
        try {
            programGenerator = (ProgramGenerator) this.componentManager.lookup(ProgramGenerator.ROLE);
            sourceHandler = (SourceHandler) this.componentManager.lookup(SourceHandler.ROLE);
            environment.setSourceHandler(sourceHandler);
            String markupLanguage = "sitemap";
View Full Code Here


     * Process the given <code>Environment</code> to generate Java code for specified XSP files.
     */
    public void generateXSP(String fileName, Environment environment)
    throws Exception {
        ProgramGenerator programGenerator = null;
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        SourceHandler sourceHandler = null;
        try {
            getLogger().debug("XSP generation begin:" + fileName);

            programGenerator = (ProgramGenerator) this.componentManager.lookup(ProgramGenerator.ROLE);
            sourceHandler = (SourceHandler) this.componentManager.lookup(SourceHandler.ROLE);
View Full Code Here

        synchronized (AbstractComplementaryConfigurableAction.configurations) {
            conf = (ConfigurationHelper) AbstractComplementaryConfigurableAction.configurations.get(descriptor);

            if (reloadable || conf == null) {
                SourceHandler sourceHandler = null;
                Source resource = null;

                try {
                    sourceHandler = (SourceHandler) this.manager.lookup(SourceHandler.ROLE);
                    if (descriptor.startsWith("file:")) {
                        resource = sourceHandler.getSource((Environment)resolver,((Environment)resolver).getContext(), descriptor.substring(5));
                    } else
                        resource = sourceHandler.getSource(null, descriptor);

                    if (conf == null || conf.lastModified < resource.getLastModified()) {
                        getLogger().debug("(Re)Loading " + descriptor);
                        if (conf == null)
                            conf = new ConfigurationHelper();
View Full Code Here

    protected void regenerateAsynchronously(Environment environment) throws Exception {
        if (this.sourceFileName.charAt(this.sourceFileName.length() - 1) == '/') {
            this.sourceFileName = this.sourceFileName + "sitemap.xmap";
        }
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        try {
            environment.setSourceHandler(this.sourceHandler);

            if (this.source != null) this.source.recycle();
            this.source = new DelayedRefreshSourceWrapper(
View Full Code Here

        throwEventualException();
    }

    public boolean process(Environment environment) throws Exception {
        checkSanity();
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        CocoonComponentManager.enterEnvironment(environment, environment.getObjectModel());
        try {
            environment.setSourceHandler(this.sourceHandler);
            return sitemap.process(environment);
        } finally {
View Full Code Here

    }

    public boolean process(Environment environment, StreamPipeline pipeline,
        EventPipeline eventPipeline) throws Exception {
        checkSanity();
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        CocoonComponentManager.enterEnvironment(environment, environment.getObjectModel());
        try {
            environment.setSourceHandler(this.sourceHandler);
            return sitemap.process(environment, pipeline, eventPipeline);
        } finally {
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void precompile(String fileName, Environment environment, String markupLanguage, String programmingLanguage)
    throws Exception {
        ProgramGenerator programGenerator = null;
        SourceHandler oldSourceHandler = environment.getSourceHandler();
        SourceHandler sourceHandler = null;
        try {
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("XSP generation begin:" + fileName);
            }

View Full Code Here

        }

        synchronized (XSPFormValidatorHelper.configurations) {
            conf = (ConfigurationHelper) XSPFormValidatorHelper.configurations.get(descriptor);
            Source source = null;
            SourceHandler sourceHandler = null;
            try {
                sourceHandler = (SourceHandler) manager.lookup(SourceHandler.ROLE);
                source = sourceHandler.getSource(null, descriptor);

                if (conf == null || ( reloadable && conf.lastModified < source.getLastModified())) {
                    logger.debug("XSPFormValidatorHelper.getConfiguration: (Re)Loading " + descriptor);

                    if (conf == null)
View Full Code Here

    }

    protected boolean process(Environment environment, InvokeContext context)
      throws Exception {

        SourceHandler oldSourceHandler = environment.getSourceHandler();
        CocoonComponentManager.enterEnvironment(environment, environment.getObjectModel());

        try {
            environment.setSourceHandler(this.sourceHandler);
            if (this.rootNode == null || this.source.getLastModified() > this.lastModified) {
View Full Code Here

        synchronized (AbstractComplementaryConfigurableAction.configurations) {
            conf = (ConfigurationHelper) AbstractComplementaryConfigurableAction.configurations.get(descriptor);

            if (reloadable || conf == null) {
                SourceHandler sourceHandler = null;
                Source resource = null;

                try {
                    sourceHandler = (SourceHandler) this.manager.lookup(SourceHandler.ROLE);
                    resource = sourceHandler.getSource(null, descriptor);

                    if (conf == null || conf.lastModified < resource.getLastModified()) {
                        getLogger().debug("(Re)Loading " + descriptor);
                        if (conf == null)
                            conf = new ConfigurationHelper();
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.source.SourceHandler

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.