mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Script and Template processor extension object support for Presentation tier.
- Additional root scope java objects can now be configured in for use by plain web-tier WebScripts, SURF components and SURF templates. - Initial config files provided for SURF web-framework - script/template services context - Also the first steps towards pluggable script/template processing engines for WebScripts git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14076 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -37,6 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.processor.ProcessorExtension;
|
||||
import org.alfresco.repo.processor.BaseProcessor;
|
||||
import org.alfresco.scripts.ScriptException;
|
||||
import org.alfresco.scripts.ScriptResourceHelper;
|
||||
@@ -46,7 +47,6 @@ import org.alfresco.service.cmr.model.FileNotFoundException;
|
||||
import org.alfresco.service.cmr.repository.ContentIOException;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.ProcessorExtension;
|
||||
import org.alfresco.service.cmr.repository.ScriptLocation;
|
||||
import org.alfresco.service.cmr.repository.ScriptProcessor;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
|
@@ -28,9 +28,9 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.processor.Processor;
|
||||
import org.alfresco.processor.ProcessorExtension;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.Processor;
|
||||
import org.alfresco.service.cmr.repository.ProcessorExtension;
|
||||
import org.alfresco.service.cmr.repository.ScriptProcessor;
|
||||
import org.alfresco.service.cmr.repository.ScriptService;
|
||||
import org.alfresco.service.cmr.repository.TemplateProcessor;
|
||||
@@ -60,7 +60,7 @@ public abstract class BaseProcessor implements Processor
|
||||
protected ServiceRegistry services;
|
||||
|
||||
/** A map containing all the processor extenstions */
|
||||
protected Map<String, ProcessorExtension> processorExtensions = new HashMap<String, ProcessorExtension>(10);
|
||||
protected Map<String, ProcessorExtension> processorExtensions = new HashMap<String, ProcessorExtension>(16);
|
||||
|
||||
/**
|
||||
* Registers this processor with the relevant services
|
||||
|
@@ -24,8 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.processor;
|
||||
|
||||
import org.alfresco.service.cmr.repository.Processor;
|
||||
import org.alfresco.service.cmr.repository.ProcessorExtension;
|
||||
import org.alfresco.processor.Processor;
|
||||
import org.alfresco.processor.ProcessorExtension;
|
||||
|
||||
/**
|
||||
* Abstract base class for a processor extension
|
||||
@@ -69,7 +69,7 @@ public abstract class BaseProcessorExtension implements ProcessorExtension
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.repository.ProcessorExtension#getExtensionName()
|
||||
* @see org.alfresco.processor.ProcessorExtension#getExtensionName()
|
||||
*/
|
||||
public String getExtensionName()
|
||||
{
|
||||
|
@@ -32,9 +32,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.processor.ProcessorExtension;
|
||||
import org.alfresco.repo.processor.BaseProcessor;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.ProcessorExtension;
|
||||
import org.alfresco.service.cmr.repository.TemplateException;
|
||||
import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
import org.alfresco.service.cmr.repository.TemplateProcessor;
|
||||
|
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.service.cmr.repository;
|
||||
|
||||
|
||||
/**
|
||||
* Processor interface.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public interface Processor
|
||||
{
|
||||
/**
|
||||
* Get the name of the processor
|
||||
*
|
||||
* @return the name of the processor
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* The file extension that the processor is associated with, null if none.
|
||||
*
|
||||
* @return the extension
|
||||
*/
|
||||
public String getExtension();
|
||||
|
||||
/**
|
||||
* Registers a processor extension with the processor
|
||||
*
|
||||
* @param processorExtension the process extension
|
||||
*/
|
||||
public void registerProcessorExtension(ProcessorExtension processorExtension);
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.service.cmr.repository;
|
||||
|
||||
/**
|
||||
* Interface to represent a server side script implementation
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public interface ProcessorExtension
|
||||
{
|
||||
/**
|
||||
* Returns the name of the extension
|
||||
*
|
||||
* @return the name of the extension
|
||||
*/
|
||||
String getExtensionName();
|
||||
}
|
@@ -26,6 +26,7 @@ package org.alfresco.service.cmr.repository;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.processor.Processor;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
|
@@ -26,6 +26,8 @@ package org.alfresco.service.cmr.repository;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import org.alfresco.processor.Processor;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by template engine wrapper classes. The developer is responsible
|
||||
* for interfacing to an appropriate template engine, using the supplied data model as input to
|
||||
|
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.service.cmr.repository;
|
||||
|
||||
import org.alfresco.processor.ProcessorExtension;
|
||||
|
||||
/**
|
||||
* Interface to represent a server side template extension implementation
|
||||
*
|
||||
|
Reference in New Issue
Block a user