mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
add resources to template
This commit is contained in:
@@ -61,7 +61,6 @@ import sonia.scm.plugin.DefaultPluginManager;
|
|||||||
import sonia.scm.plugin.Plugin;
|
import sonia.scm.plugin.Plugin;
|
||||||
import sonia.scm.plugin.PluginLoader;
|
import sonia.scm.plugin.PluginLoader;
|
||||||
import sonia.scm.plugin.PluginManager;
|
import sonia.scm.plugin.PluginManager;
|
||||||
import sonia.scm.plugin.ScriptResourceServlet;
|
|
||||||
import sonia.scm.repository.ChangesetViewerUtil;
|
import sonia.scm.repository.ChangesetViewerUtil;
|
||||||
import sonia.scm.repository.DefaultRepositoryProvider;
|
import sonia.scm.repository.DefaultRepositoryProvider;
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
@@ -72,6 +71,7 @@ import sonia.scm.repository.xml.XmlRepositoryManager;
|
|||||||
import sonia.scm.resources.DefaultResourceManager;
|
import sonia.scm.resources.DefaultResourceManager;
|
||||||
import sonia.scm.resources.DevelopmentResourceManager;
|
import sonia.scm.resources.DevelopmentResourceManager;
|
||||||
import sonia.scm.resources.ResourceManager;
|
import sonia.scm.resources.ResourceManager;
|
||||||
|
import sonia.scm.resources.ScriptResourceServlet;
|
||||||
import sonia.scm.security.CipherHandler;
|
import sonia.scm.security.CipherHandler;
|
||||||
import sonia.scm.security.CipherUtil;
|
import sonia.scm.security.CipherUtil;
|
||||||
import sonia.scm.security.EncryptionHandler;
|
import sonia.scm.security.EncryptionHandler;
|
||||||
@@ -147,7 +147,7 @@ public class ScmServletModule extends ServletModule
|
|||||||
public static final String PATTERN_PAGE = "*.html";
|
public static final String PATTERN_PAGE = "*.html";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String PATTERN_PLUGIN_SCRIPT = "/plugins/sonia.plugin.js";
|
public static final String PATTERN_PLUGIN_SCRIPT = "/plugins/resources/js/*";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String PATTERN_RESTAPI = "/api/rest/*";
|
public static final String PATTERN_RESTAPI = "/api/rest/*";
|
||||||
|
|||||||
@@ -1,197 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2010, Sebastian Sdorra
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of SCM-Manager; nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived from this
|
|
||||||
* software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* http://bitbucket.org/sdorra/scm-manager
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sonia.scm.plugin;
|
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
|
||||||
|
|
||||||
import sonia.scm.util.IOUtil;
|
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Sebastian Sdorra
|
|
||||||
*/
|
|
||||||
public abstract class AbstractResourceServlet extends HttpServlet
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
public static final String DEFAULT_CHARSET = "UTF-8";
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private static final long serialVersionUID = -7703282364120349053L;
|
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param stream
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
protected abstract void appendResources(OutputStream stream)
|
|
||||||
throws ServletException, IOException;
|
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected abstract String getContentType();
|
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void init() throws ServletException
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
appendResources(output);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
throw new ServletException(ex);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.close(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.content = output.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
processRequest(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void doPost(HttpServletRequest request,
|
|
||||||
HttpServletResponse response)
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
processRequest(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected String getCharacterEncoding()
|
|
||||||
{
|
|
||||||
return DEFAULT_CHARSET;
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param response
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
private void processRequest(HttpServletResponse response)
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
response.setCharacterEncoding(getCharacterEncoding());
|
|
||||||
response.setContentType(getContentType());
|
|
||||||
response.setContentLength(content.length);
|
|
||||||
|
|
||||||
OutputStream output = response.getOutputStream();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
output.write(content);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.close(output);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private byte[] content;
|
|
||||||
}
|
|
||||||
@@ -1,285 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2010, Sebastian Sdorra
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* 3. Neither the name of SCM-Manager; nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived from this
|
|
||||||
* software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* http://bitbucket.org/sdorra/scm-manager
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
package sonia.scm.plugin;
|
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
|
||||||
import com.google.inject.Singleton;
|
|
||||||
|
|
||||||
import sonia.scm.boot.BootstrapUtil;
|
|
||||||
import sonia.scm.resources.ResourceHandler;
|
|
||||||
import sonia.scm.resources.ResourceHandlerComparator;
|
|
||||||
import sonia.scm.resources.ResourceType;
|
|
||||||
import sonia.scm.util.IOUtil;
|
|
||||||
import sonia.scm.util.Util;
|
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Sebastian Sdorra
|
|
||||||
*/
|
|
||||||
@Singleton
|
|
||||||
public class ScriptResourceServlet extends AbstractResourceServlet
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
public static final String CONTENT_TYPE = "text/javascript";
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private static final long serialVersionUID = -5769146163848821050L;
|
|
||||||
|
|
||||||
//~--- constructors ---------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs ...
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param pluginLoader
|
|
||||||
* @param resourceHandlers
|
|
||||||
*/
|
|
||||||
@Inject
|
|
||||||
public ScriptResourceServlet(PluginLoader pluginLoader,
|
|
||||||
Set<ResourceHandler> resourceHandlers)
|
|
||||||
{
|
|
||||||
this.pluginLoader = pluginLoader;
|
|
||||||
this.resourceHandlers = resourceHandlers;
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param stream
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void appendResources(OutputStream stream)
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
stream.write(
|
|
||||||
"function sayPluginHello(){ alert('Plugin Hello !'); }".concat(
|
|
||||||
System.getProperty("line.separator")).getBytes());
|
|
||||||
|
|
||||||
Collection<String> scriptResources = getScriptResources();
|
|
||||||
|
|
||||||
if (Util.isNotEmpty(scriptResources))
|
|
||||||
{
|
|
||||||
for (String resource : scriptResources)
|
|
||||||
{
|
|
||||||
appendResource(stream, resource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Util.isNotEmpty(resourceHandlers))
|
|
||||||
{
|
|
||||||
List<ResourceHandler> handlerList =
|
|
||||||
new ArrayList<ResourceHandler>(resourceHandlers);
|
|
||||||
|
|
||||||
Collections.sort(handlerList, new ResourceHandlerComparator());
|
|
||||||
|
|
||||||
for (ResourceHandler resourceHandler : resourceHandlers)
|
|
||||||
{
|
|
||||||
if (resourceHandler.getType() == ResourceType.SCRIPT)
|
|
||||||
{
|
|
||||||
appendResource(resourceHandler.getResource(), stream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getContentType()
|
|
||||||
{
|
|
||||||
return CONTENT_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param stream
|
|
||||||
* @param script
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws ServletException
|
|
||||||
*/
|
|
||||||
private void appendResource(OutputStream stream, String script)
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
InputStream input = getResourceAsStream(script);
|
|
||||||
|
|
||||||
appendResource(input, stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param input
|
|
||||||
* @param stream
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
private void appendResource(InputStream input, OutputStream stream)
|
|
||||||
throws IOException
|
|
||||||
{
|
|
||||||
if (input != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
IOUtil.copy(input, stream);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.close(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param resources
|
|
||||||
* @param plugin
|
|
||||||
*/
|
|
||||||
private void processPlugin(Set<String> resources, Plugin plugin)
|
|
||||||
{
|
|
||||||
PluginResources pluginResources = plugin.getResources();
|
|
||||||
|
|
||||||
if (pluginResources != null)
|
|
||||||
{
|
|
||||||
Set<String> scriptResources = pluginResources.getScriptResources();
|
|
||||||
|
|
||||||
if (scriptResources != null)
|
|
||||||
{
|
|
||||||
resources.addAll(scriptResources);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param resource
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private InputStream getResourceAsStream(String resource)
|
|
||||||
{
|
|
||||||
InputStream input = null;
|
|
||||||
ClassLoader classLoader = BootstrapUtil.getClassLoader(getServletContext());
|
|
||||||
|
|
||||||
if (classLoader != null)
|
|
||||||
{
|
|
||||||
String classLoaderResource = resource;
|
|
||||||
|
|
||||||
if (classLoaderResource.startsWith("/"))
|
|
||||||
{
|
|
||||||
classLoaderResource = classLoaderResource.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
input = classLoader.getResourceAsStream(classLoaderResource);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input == null)
|
|
||||||
{
|
|
||||||
input = ScriptResourceServlet.class.getResourceAsStream(resource);
|
|
||||||
}
|
|
||||||
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private Collection<String> getScriptResources()
|
|
||||||
{
|
|
||||||
Set<String> resources = new TreeSet<String>();
|
|
||||||
Collection<Plugin> plugins = pluginLoader.getInstalledPlugins();
|
|
||||||
|
|
||||||
if (plugins != null)
|
|
||||||
{
|
|
||||||
for (Plugin plugin : plugins)
|
|
||||||
{
|
|
||||||
processPlugin(resources, plugin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return resources;
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private PluginLoader pluginLoader;
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private Set<ResourceHandler> resourceHandlers;
|
|
||||||
}
|
|
||||||
@@ -39,6 +39,8 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
import sonia.scm.SCMContextProvider;
|
import sonia.scm.SCMContextProvider;
|
||||||
|
import sonia.scm.resources.ResourceManager;
|
||||||
|
import sonia.scm.resources.ResourceType;
|
||||||
import sonia.scm.util.IOUtil;
|
import sonia.scm.util.IOUtil;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
@@ -81,12 +83,15 @@ public class TemplateServlet extends HttpServlet
|
|||||||
*
|
*
|
||||||
* @param context
|
* @param context
|
||||||
* @param templateHandler
|
* @param templateHandler
|
||||||
|
* @param resourceManager
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public TemplateServlet(SCMContextProvider context,
|
public TemplateServlet(SCMContextProvider context,
|
||||||
TemplateHandler templateHandler)
|
TemplateHandler templateHandler,
|
||||||
|
ResourceManager resourceManager)
|
||||||
{
|
{
|
||||||
this.templateHandler = templateHandler;
|
this.templateHandler = templateHandler;
|
||||||
|
this.resourceManager = resourceManager;
|
||||||
this.version = context.getVersion();
|
this.version = context.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +116,7 @@ public class TemplateServlet extends HttpServlet
|
|||||||
|
|
||||||
params.put("contextPath", contextPath);
|
params.put("contextPath", contextPath);
|
||||||
params.put("version", version);
|
params.put("version", version);
|
||||||
|
params.put("scripts", resourceManager.getResources(ResourceType.SCRIPT));
|
||||||
|
|
||||||
Locale l = request.getLocale();
|
Locale l = request.getLocale();
|
||||||
|
|
||||||
@@ -174,6 +180,9 @@ public class TemplateServlet extends HttpServlet
|
|||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private ResourceManager resourceManager;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private TemplateHandler templateHandler;
|
private TemplateHandler templateHandler;
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,12 @@
|
|||||||
<!-- sonia.scm -->
|
<!-- sonia.scm -->
|
||||||
<script type="text/javascript" src="resources/js/sonia.scm.js"></script>
|
<script type="text/javascript" src="resources/js/sonia.scm.js"></script>
|
||||||
<!--/compress-->
|
<!--/compress-->
|
||||||
<script type="text/javascript" src="plugins/sonia.plugin.js"></script>
|
|
||||||
|
<!-- plugins -->
|
||||||
|
<#list scripts as script>
|
||||||
|
<script type="text/javascript" src="plugins/resources/js/${script.name}"></script>
|
||||||
|
</#list>
|
||||||
|
|
||||||
<#if country != 'en'>
|
<#if country != 'en'>
|
||||||
<script type="text/javascript" src="resources/extjs/i18n/ext-lang-${country}.js"></script>
|
<script type="text/javascript" src="resources/extjs/i18n/ext-lang-${country}.js"></script>
|
||||||
<script type="text/javascript" src="resources/js/i18n/${country}.js"></script>
|
<script type="text/javascript" src="resources/js/i18n/${country}.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user